Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

xtce-lib

Python License: MIT Development Status Code Style Package Manager

xtce-lib provides Python tools for working with XTCE databases.

It focuses on three pieces of functionality:

  • A unified, Pythonic XTCE model that flattens version-specific XML structure into a cleaner API.
  • XTCE file parsing and schema validation for XTCE 1.1, 1.2, and 1.3 files.
  • XTCE path and registry helpers for resolving references inside a database.

Alpha software: the API is not stable yet and may change in future releases.

Supported Versions

xtce-lib currently supports XTCE versions 1.1, 1.2, and 1.3.

Installation

From PyPI:

pip install xtce-lib

Quick Start

Create an XTCE database

from xtce_lib import XtceDatabase, xtce

db = XtceDatabase(name="CONKSAT1")

db.command_metadata = xtce.CommandMetadata(
    argument_types=[
        xtce.IntegerArgument(
            name="uint32",
            encoding_type=xtce.IntegerDataEncoding(
                encoding=xtce.IntegerEncoding.UNSIGNED,
                size_in_bits=32,
            ),
            signed=False,
        ),
        xtce.FloatArgument(
            name="float32",
            encoding_type=xtce.FloatDataEncoding(
                encoding=xtce.FloatEncoding.IEEE754,
                size_in_bits=32,
            ),
        ),
    ],
)

The database model removes XML-only intermediate nodes, so you can work with the model directly:

for argument in db.command_metadata.argument_types:
    print(argument.name)

After creating the database, writing to an XTCE document is as simple as:

from pathlib import Path
from xtce_lib import XtceFile, XtceVersion

db.to_file(Path("CONKSAT1_XTCE.xml"), XtceVersion.V1_2)

Parse an XTCE file

from pathlib import Path
from xtce_lib import XtceDatabase, XtceFile

xtce_file = XtceFile(Path("CONKSAT1-XTCE.xml"))
db: XtceDatabase = xtce_file.database

XtceFile can validate the XTCE against the XML schema and parse the XML into the unified XtceDatabase model.

Work with object paths

>>> from xtce_lib import XtcePath
>>> path = XtcePath("/CONKSAT1/BUS[2].BatteryVoltage")
>>> root_path = XtcePath("/CONKSAT1")
>>> path.relative_to(root_path)
XtcePath('BUS[2].BatteryVoltage')
>>> path.contains_array
True
>>> path.contains_aggregate
True

XtcePath is a pathlib-like helper for XTCE hierarchies, including support for array and aggregate objects.

Development Roadmap

  • Write a class to represent XTCE object paths (XtcePath)
  • Generate Python representations of the XML schemas with xsdata
  • Write a class to represent an XTCE file (XtceFile)
  • Write a class to represent the unified XTCE model (XtceDatabase)
  • Scaffold the structure of the unified XTCE model
  • Implement all base subclasses in the unified model, including translation methods
    • Algorithm models
    • Array models
    • Calibrator models
    • Common models
    • Condition models
    • Range models
    • Reference models
    • Stream models
    • Time models
    • Trigger models
    • Verifier models
    • Alarm models
    • Codec models
    • Datatype models
    • Argument models
    • Container models
    • Command models
    • Parameter models
    • Telemetry models
    • Space system
    • Enum models
  • Refactor translation methods for inherited classes
  • Implement unified model serialization and deserialization
  • Release alpha
  • Fix the many things I messed up in the alpha
  • Fix unit tests
  • Implement full model semantic validation
  • Write end-to-end tests for generating and parsing XTCE files
  • Write documentation
    • Add examples to all applicable model Fields
    • Automate API documentation generation

Disclaimer

This project is an independent open-source implementation and is not affiliated with, endorsed by, or sponsored by the Object Management Group (OMG). XTCE is a specification developed by OMG. All trademarks are the property of their respective owners.

Metadata

Release files for xtce-lib 0.1.0a2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xtce-lib 0.1.0a2
File Size Uploaded Provenance Actions
xtce_lib-0.1.0a2.tar.gz 521.7 kB With provenance Details for xtce_lib-0.1.0a2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for xtce-lib 0.1.0a2
File Interpreter ABI Platform Actions
xtce_lib-0.1.0a2-py3-none-any.whl Python 3 none any Details for xtce_lib-0.1.0a2-py3-none-any.whl

Total release size: 970.1 kB

Release files / xtce_lib-0.1.0a2.tar.gz

Download URL xtce_lib-0.1.0a2.tar.gz
Size 521.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4a1941174ff6822931f3a757cb45933fb28426d5a1436c40cae6a2598d5f30ff
BLAKE2b-256 checksum
How to use checksums
278e9af3002185aaaf6a09f046fac5c5803b4401b46309d9ef6e7e58432797b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 30, 2026.

Transparency log

Release files / xtce_lib-0.1.0a2-py3-none-any.whl

Download URL xtce_lib-0.1.0a2-py3-none-any.whl
Size 448.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
21d841ae0aaa235bfdaf3db139234969b78678a048de8d885dad7f1b85b0c70c
BLAKE2b-256 checksum
How to use checksums
9c734ca5d25a286f74264418acc7cb95b2545ebb13bedf72fd9acbd09b748ff7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 30, 2026.

Transparency log

Security for xtce-lib 0.1.0a2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for xtce_lib-0.1.0a2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page