org.accellera package

Subpackages

Submodules

org.accellera.standard module

Utilities for representing supported SPIRIT / IP-XACT standard versions.

This module provides a single source of truth for supported standards via the Standard dataclass and the STANDARDS registry plus a few helper functions for validation and namespace / schema URL construction.

class org.accellera.standard.Standard(name, prefix, schema_root, token, versions)

Bases: object

Metadata for a standards family and its supported versions.

Attributes

name:

Canonical lowercase name ("spirit" or "ipxact").

prefix:

XML namespace prefix to be used (often identical to name).

schema_root:

Base root URL for schemas of this standard family.

token:

Upper-case token inserted inside the namespace URL path.

versions:

Ordered collection (tuple) of all supported version strings.

static get(name, version=None)

Retrieve standard metadata, optionally validating a version.

Parameters:
  • name (str) – Standard family name (case-insensitive).

  • version (str | None) – Optional version identifier to validate against the standard.

Returns:

Corresponding metadata object.

Return type:

Standard

Raises:

VersionError – If the standard is unknown or the version is unsupported.

name: str
static namespace_map_for(standard, version)

Return the XML namespace prefix→URI map for a standard/version.

Parameters:
  • standard (str) – Standard family name.

  • version (str) – Version identifier.

Returns:

Namespace mapping including xsi and standard prefix.

Return type:

dict[str, str]

static ns_url_for(standard, version)

Return the namespace URL for the given standard/version.

Parameters:
  • standard (str) – Standard family name.

  • version (str) – Version identifier.

Returns:

The full namespace URL (without trailing index.xsd).

Return type:

str

prefix: str
static schema_location_for(standard, version)

Return the value for xsi:schemaLocation for a standard/version.

Parameters:
  • standard (str) – Standard family name.

  • version (str) – Version identifier.

Returns:

Concatenated namespace URL and its index.xsd path.

Return type:

str

schema_root: str
token: str
static validate(standard, version)

Validate a standard/version pair.

Parameters:
  • standard (str) – Standard family name.

  • version (str) – Version identifier.

Raises:

VersionError – If the standard or version is unsupported.

Return type:

None

versions: tuple[str, ...]
Parameters:
  • name (str)

  • prefix (str)

  • schema_root (str)

  • token (str)

  • versions (tuple[str, ...])

exception org.accellera.standard.VersionError

Bases: ValueError

Raised when an unknown standard or version is referenced.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

args
with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

Module contents

Accellera standards utilities package.

Provides transformation metadata and exposes TRANSFORMATIONS for XSL based version upgrading. Version enumeration symbols were removed in favor of the Standard registry inside standard.

class org.accellera.Standard(name, prefix, schema_root, token, versions)

Bases: object

Metadata for a standards family and its supported versions.

Attributes

name:

Canonical lowercase name ("spirit" or "ipxact").

prefix:

XML namespace prefix to be used (often identical to name).

schema_root:

Base root URL for schemas of this standard family.

token:

Upper-case token inserted inside the namespace URL path.

versions:

Ordered collection (tuple) of all supported version strings.

static get(name, version=None)

Retrieve standard metadata, optionally validating a version.

Parameters:
  • name (str) – Standard family name (case-insensitive).

  • version (str | None) – Optional version identifier to validate against the standard.

Returns:

Corresponding metadata object.

Return type:

Standard

Raises:

VersionError – If the standard is unknown or the version is unsupported.

name: str
static namespace_map_for(standard, version)

Return the XML namespace prefix→URI map for a standard/version.

Parameters:
  • standard (str) – Standard family name.

  • version (str) – Version identifier.

Returns:

Namespace mapping including xsi and standard prefix.

Return type:

dict[str, str]

static ns_url_for(standard, version)

Return the namespace URL for the given standard/version.

Parameters:
  • standard (str) – Standard family name.

  • version (str) – Version identifier.

Returns:

The full namespace URL (without trailing index.xsd).

Return type:

str

prefix: str
static schema_location_for(standard, version)

Return the value for xsi:schemaLocation for a standard/version.

Parameters:
  • standard (str) – Standard family name.

  • version (str) – Version identifier.

Returns:

Concatenated namespace URL and its index.xsd path.

Return type:

str

schema_root: str
token: str
static validate(standard, version)

Validate a standard/version pair.

Parameters:
  • standard (str) – Standard family name.

  • version (str) – Version identifier.

Raises:

VersionError – If the standard or version is unsupported.

Return type:

None

versions: tuple[str, ...]
Parameters:
  • name (str)

  • prefix (str)

  • schema_root (str)

  • token (str)

  • versions (tuple[str, ...])

exception org.accellera.VersionError

Bases: ValueError

Raised when an unknown standard or version is referenced.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

args
with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.