Skip to main content

No project description provided

Project description

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.

Project details


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-7.0.0.dev129-py3-none-any.whl (4.7 MB view details)

Uploaded Python 3

File details

Details for the file finos_cdm-7.0.0.dev129-py3-none-any.whl.

File metadata

File hashes

Hashes for finos_cdm-7.0.0.dev129-py3-none-any.whl
Algorithm Hash digest
SHA256 ba25803721a9e0bf0c877ed0b7b5da450322f62f6e4c4353ed1b4d8d58fb66f1
MD5 8a80d577acd479866171b0d78ae9ce4d
BLAKE2b-256 12dd7680bb9e98ba3b25355b4384f167427fabc10f0ae4eff0317676b002eacc

See more details on using hashes here.

Supported by

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