Skip to main content

FINOS Common Domain Model — Python Distribution

FINOS - Active PyPI Python License

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() or validate_model() is called.
  • Rune-conformant serialisation — rune_serialize() and rune_deserialize() produce and consume JSON that includes the @type, @model, and @version envelope 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 NotImplementedError at runtime if called without a registered Python replacement. Python native implementations can be registered via rune_register_native() from rune.runtime.native_registry.
  • Code list data loading — the CodeList, CodeListIdentification, and CodeValue data types are fully generated, but the LoadCodeList function 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

Community and Support

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.

Release files for finos-cdm 6.29.0

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

Built distribution (wheel)

Table of built distributions (wheels) for finos-cdm 6.29.0
File Interpreter ABI Platform
finos_cdm-6.29.0-py3-none-any.whl Python 3 none any Details

Release files / finos_cdm-6.29.0-py3-none-any.whl

Download URL finos_cdm-6.29.0-py3-none-any.whl
Size 4.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
6074b978902d3690dfe9414dfbea1183157e1c1845600c137645ca10801755a5
BLAKE2b-256 checksum
How to use checksums
0c72815bdae6ab59cf0ac7c138f6f3275ef6727ff0fb8d4494c5176b88539d3b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14
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