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.7.1)

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)

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.7.1

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.7.1
File Size Uploaded Provenance Actions
cdm_lite-0.7.1.tar.gz 23.3 kB Without provenance Details for cdm_lite-0.7.1.tar.gz

Built distribution (wheel)

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

Total release size: 52.3 kB

Release files / cdm_lite-0.7.1.tar.gz

Download URL cdm_lite-0.7.1.tar.gz
Size 23.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d10cd0defb19c8b4c674ac33addbf9bac4089f974d84c415adeef85efcdd3df2
BLAKE2b-256 checksum
How to use checksums
f38cae09cee477aa82616e976b5e367517920da858ede72195ef9d38258f4e8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","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":true}

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

Download URL cdm_lite-0.7.1-py3-none-any.whl
Size 29.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fc761f5544bf1d171450c3e4ec8ec4e3caa542f9ff992f86c0cb078c959a976d
BLAKE2b-256 checksum
How to use checksums
6d2cfae82f049efedc54d53d03d107349cf020ba1b82e82a2ba7ab8a7f364bc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","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":true}

Security for cdm-lite 0.7.1

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