Skip to main content

cdm-lite

CI License Python Ruff pre-commit

Python Pydantic models for the FINOS Common Domain Model (CDM).

cdm-lite provides a lightweight CLI to download, clean, and compile official FINOS CDM JSON schemas into Pydantic v2 models. This enables strict validation, autocompletion, and robust deserialization of CDM JSON payloads in Python codebases without heavy Java dependencies.

Status

Current Phase: Stable (v0.6.0)

cdm-lite is a stable release. The CLI surface, the on-disk cache layout and the layout of the generated models follow Semantic Versioning: breaking changes will only be made in a major release. The schemas published by FINOS are cleaned and compiled on your machine, so the models you get always match the CDM version you installed.

Feedback Welcome: We gratefully encourage users to provide comments, recommendations, or report any issues found during usage. Your input will help in reaching a stable 1.0 release.

Scope & Limitations

⚠️ Disclaimer: cdm-lite is intended primarily as a lightweight deserializer. The generated Python models are derived directly from the published JSON Schemas. While they provide close structural validation, we cannot guarantee that the generated models perfectly match the behavioral constraints of the full Common Domain Model.

Pydantic classes inherently cannot capture the full extent of the CDM's functionality, such as complex cross-field cardinality checks, conditions, or rosetta-injected logic. For robust serialization and comprehensive domain validation, we strongly recommend using the official, full CDM project implementations (e.g., the Java distribution).

Installation

uv tool install cdm-lite

Workflow

Download and compile the CDM models for your required schema version:

# List available FINOS CDM versions from Maven Central
cdm-lite versions

# Download schemas and compile Pydantic models locally
cdm-lite install 6.19.0

# Activate the version (updates a local symlink)
cdm-lite use 6.19.0

# Or: install the latest stable version and activate it in one step
cdm-lite upgrade

Note: Models are compiled into a user-level cache directory (e.g., ~/.cache/cdm-lite/). Run cdm-lite status to view your specific path.

Downloads are verified against the SHA-1 checksum published on Maven Central, and version discovery caches the Maven metadata so cdm-lite versions keeps working offline.

Project Integration

To use the compiled models in your application, point your environment to the active models directory.

Using uv (pyproject.toml):

[tool.uv.sources]
# Use the exact absolute path returned by `cdm-lite use`
cdm-models = { path = "/home/user/.cache/cdm-lite/current" }

[project]
dependencies = ["cdm-models"]

Using PYTHONPATH:

# Use the exact absolute path returned by `cdm-lite use`
export PYTHONPATH="/home/user/.cache/cdm-lite/current/src:$PYTHONPATH"

Deserializing JSON

Once the models are available in your path, use standard Pydantic APIs to parse, validate, and interact with incoming JSON objects:

from cdm_models.models.cdm_event_common_TradeState_schema import TradeState  # Exact import paths depend on the CDM schema

payload = '{"trade": {"tradeDate": {"value": "2023-10-25"}}}'

# Deserialize and strictly validate the JSON string
trade_state = TradeState.model_validate_json(payload)

# Access typed and autocompleted attributes
print(trade_state.trade.trade_date.value)

Releasing

Releases are published to PyPI automatically from a git tag, using Trusted Publishing (OIDC) — no API token is stored in GitHub.

  1. Bump the version and update every version reference in one command:

    uv run python scripts/bump_version.py 0.6.1 --note "Add a cdm-lite upgrade command."
    

    This updates pyproject.toml (version and development status classifier), the README status line and the CHANGELOG in a single commit.

  2. Open a pull request. CI checks that the CHANGELOG documents the version in pyproject.toml.

  3. Merge, then tag and push the tag:

    git tag v0.6.1
    git push origin v0.6.1
    
  4. The Release workflow verifies the tag matches the project version, builds the sdist and wheel, and publishes them to PyPI.

One-time PyPI setup: on the cdm-lite project page, add a GitHub trusted publisher with owner ben05allen, repository cdm-lite, workflow release.yml and environment pypi. The pypi environment must therefore be referenced by the release workflow; if you configure the publisher without an environment name, remove the environment: block from .github/workflows/release.yml.

Reference Commands

  • cdm-lite --version: Print the installed version.
  • cdm-lite versions: View available versions on Maven Central.
  • cdm-lite install <version>: Fetch schemas and compile models.
  • cdm-lite upgrade [version]: Install the latest stable version (or a specific one) and make it active.
  • cdm-lite use <version>: Set the active version for the current symlink.
  • cdm-lite list: Show locally compiled versions.
  • cdm-lite status: Print active version and system cache location.
  • cdm-lite remove <version>: Delete a specific version from the local cache.
  • cdm-lite clear: Remove all local schemas and generated models.

Metadata

Release files for cdm-lite 0.6.0

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

Source distribution (sdist)

Source distribution for cdm-lite 0.6.0
File Size Uploaded Provenance Actions
cdm_lite-0.6.0.tar.gz 23.8 kB Without provenance Details for cdm_lite-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cdm-lite 0.6.0
File Interpreter ABI Platform Actions
cdm_lite-0.6.0-py3-none-any.whl Python 3 none any Details for cdm_lite-0.6.0-py3-none-any.whl

Total release size: 53.3 kB

Release files / cdm_lite-0.6.0.tar.gz

Download URL cdm_lite-0.6.0.tar.gz
Size 23.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1395d146f60a53542b6beb4ecd0e3cb7b014f6d2b0bb9a4d9862dcd741dfc755
BLAKE2b-256 checksum
How to use checksums
1018f1fe8ee9853e4bdf8c26887e811e4113cc1ced61732d358de8cdd956230b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / cdm_lite-0.6.0-py3-none-any.whl

Download URL cdm_lite-0.6.0-py3-none-any.whl
Size 29.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
65caef186fd282482eabc89bb97b29a9eff7078e20b988b80be7d90ed1501556
BLAKE2b-256 checksum
How to use checksums
3dd7c872d5f3cd9f68b36d41f046a0cb24f73debc87693c945dea0e083e98b03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for cdm-lite 0.6.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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