Skip to main content
Pre-release

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

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: Beta

cdm-lite is currently in a beta development stage. While the core functionality is stable, we are actively refining the cleaning and generation logic based on community feedback.

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

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

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:$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 versions: View available versions on Maven Central.
  • cdm-lite install <version>: Fetch schemas and compile models.
  • 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.5.0b1

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.5.0b1
File Size Uploaded Provenance Actions
cdm_lite-0.5.0b1.tar.gz 19.4 kB Without provenance Details for cdm_lite-0.5.0b1.tar.gz

Built distribution (wheel)

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

Total release size: 44.5 kB

Release files / cdm_lite-0.5.0b1.tar.gz

Download URL cdm_lite-0.5.0b1.tar.gz
Size 19.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1d824deacfd3c3cd0ed72b6b32ed2ec96089318037ea6dd4530271597eb69049
BLAKE2b-256 checksum
How to use checksums
7c237586a1597f1d6dd0964849b34fe47cfd16a45a3a68ba72b6c97bfe3856fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","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.5.0b1-py3-none-any.whl

Download URL cdm_lite-0.5.0b1-py3-none-any.whl
Size 25.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
000ab93f1d972aa97b9e97f8056c5c39d821a812500c7fec3e104971ab92a29c
BLAKE2b-256 checksum
How to use checksums
a7952c6a44dc55c28d9e831d0d1978acd2e44c4d534d360a2e37bc1396012eae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","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.5.0b1

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