Skip to main content
Pre-release

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

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

finos_cdm-8.0.0.dev3-py3-none-any.whl (4.6 MB view details)

Uploaded Python 3

File details

Details for the file finos_cdm-8.0.0.dev3-py3-none-any.whl.

File metadata

  • Download URL: finos_cdm-8.0.0.dev3-py3-none-any.whl
  • Upload date:
  • Size: 4.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for finos_cdm-8.0.0.dev3-py3-none-any.whl
Algorithm Hash digest
SHA256 491e8207c2f921f356cbda533a13b4c00824aecd8fc744527aa4b59e9e9838ed
MD5 9c52b5e79ab998ed99bb08046054d92f
BLAKE2b-256 cd5a75631d55d4c1d6bd402d8f9c3d5c1901aedc33c219392cf0982138e491d6

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

8.0.0.dev3 This release

1 file

7.1.0

1 file

7.0.0

1 file

6.25.0

1 file

6.24.0

1 file

6.22.0

1 file

6.21.0

1 file

6.20.6

1 file

5.40.0

1 file

5.39.0

1 file

5.38.0

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page