No project description provided
Project description
FINOS Common Domain Model — Python Distribution
The FINOS Common Domain Model (CDM) is a standardised, machine-readable and machine-executable blueprint for how financial products are traded and managed across the transaction lifecycle. This package distributes the CDM as a native Python library, generated automatically from the authoritative Rune model source.
Installation
pip install finos-cdm
Requires Python 3.11 or later.
Dependencies
| Package | Version |
|---|---|
| pydantic | >=2.10.3 |
| rune.runtime | >=2.0.0,<3.0.0 |
rune.runtime provides the base classes, validation infrastructure, and serialisation utilities used by all generated CDM types.
Quick Start
from finos.cdm.event.common.TradeState import TradeState
# All CDM types are Pydantic models — construct with keyword arguments
trade_state = TradeState(...)
All CDM classes are Pydantic v2 models, giving you automatic validation, JSON serialisation, and IDE auto-complete out of the box:
import json
# Serialise to JSON
payload = trade_state.rune_serialize()
# Deserialise from JSON
restored = BaseDataClass.rune_deserialize(payload)
Deserialisation returns an object of the appropriate type.
What Is and Is Not Supported
Supported
- Full CDM data model — every CDM type defined in the Rune DSL is generated as a Pydantic v2 class with field-level type checking, cardinality validation, and condition enforcement via
validate_model(). - CDM functions — functions whose logic is expressed directly in Rune DSL are generated as callable Python functions.
- Conditions and constraints — all Rune-defined conditions are generated and evaluated by the runtime when
validate_conditions()orvalidate_model()is called. - Rune-conformant serialisation —
rune_serialize()andrune_deserialize()produce and consume JSON that includes the@type,@model, and@versionenvelope required for interoperability with other Rune-based runtimes and tooling. - Object references — cross-object references defined in the CDM model are resolved automatically on deserialisation.
Not Supported
- Native Java function implementations — a subset of CDM functions are implemented natively in Java rather than expressed in Rune DSL. These functions are present in the Python distribution as stubs but will raise
NotImplementedErrorat runtime if called without a registered Python replacement. Python native implementations can be registered viarune_register_native()fromrune.runtime.native_registry. - Code list data loading — the
CodeList,CodeListIdentification, andCodeValuedata types are fully generated, but theLoadCodeListfunction that populates them is a native Java stub (see above). Applications that require runtime code list validation must supply their own implementation.
How This Package Is Generated
This package is automatically generated from the CDM Rune DSL source using the Rune Python Generator. The generated code is published to PyPI as part of each CDM release. Do not edit the generated source directly — raise a CDM model change via the contribution process instead.
Versioning
This package follows the CDM release version. A CDM release X.Y.Z corresponds to finos-cdm==X.Y.Z on PyPI. Pre-release builds are published as X.Y.Z.devN.
Documentation
- CDM Documentation — full model documentation and design principles
- CDM GitHub Repository — model source, issues, and contributions
- Rune Python Runtime — runtime library documentation
Community and Support
- Mailing list: cdm+subscribe@lists.finos.org
- Issues: github.com/finos/common-domain-model/issues
- FINOS Community: community.finos.org
License
Copyright 2021 FINOS and CDM Participants
The CDM model specification is subject to the Community Specification License 1.0.
The Python runtime binding code in this distribution is licensed under the Apache License, Version 2.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file finos_cdm-6.22.0-py3-none-any.whl.
File metadata
- Download URL: finos_cdm-6.22.0-py3-none-any.whl
- Upload date:
- Size: 4.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c18981cf2f9639926dda7be504ec2c4f0fdf4c6dd633144d9d515b98da69845
|
|
| MD5 |
a9f54246c18e2db7f013af947c10635e
|
|
| BLAKE2b-256 |
d772099755185931464dd4ce79659de7729e7b834ff8eba78359cd9409f3e977
|