Skip to main content
Pre-release

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

TRAC Model Runtime for Python

TRAC D.A.P. is a next-generation data and analytics platform for use in highly regulated environments

The TRAC model runtime provides all the APIs needed to write models for the TRAC platform. It includes an implementation of the runtime library that can be used as a development sandbox, so you can run and debug TRAC models right away from your favourite IDE or notebook. A number of tools are included to make it easy to plug in development data and configuration. When your models are ready they can be loaded into a real instance of TRAC for testing and eventual deployment.

Documentation for the TRAC platform is available on our website at tracdap.finos.org.

Requirements

The TRAC runtime for Python has these requirements:

  • Python: 3.8 up to 3.12
  • Pandas: 1.2 up to 2.2
  • PySpark 3.0 up to 3.5 (optional)

3rd party libraries may impose additional constraints on supported versions of Python, Pandas or PySpark. As of February 2024, the Python libraries for GCP do not yet support Python 3.12.

Installing the runtime

The TRAC runtime package can be installed directly from PyPI:

pip install tracdap-runtime

The TRAC runtime depends on Pandas and PySpark, so these libraries will be pulled in as dependencies. If you want to target particular versions, install them explicitly first.

Writing a model

Once the runtime is installed you can write your first TRAC model! Start by inheriting the TracModel base class, your IDE should be able to generate stubs for you:

import tracdap.rt.api as trac

class SampleModel(trac.TracModel):

    def define_parameters(self) -> tp.Dict[str, trac.ModelParameter]:
        pass

    def define_inputs(self) -> tp.Dict[str, trac.ModelInputSchema]:
        pass

    def define_outputs(self) -> tp.Dict[str, trac.ModelOutputSchema]:
        pass

    def run_model(self, ctx: trac.TracContext):
        pass

You can fill in the three define_* methods to declare any parameters, inputs and outputs your model is going to need, then start writing your model code in run_model.

To learn about modelling with TRAC D.A.P. and what is possible, check out the modelling tutorials available in our online documentation. The tutorials are based on example models in the TRAC GitHub repository. We run these examples as part of our CI, so they will always be in sync with the corresponding version of the runtime library.

Building the runtime from source

This is not normally necessary for model development, but if you want to do it here are the commands.

cd tracdap-runtime/python

# Configure a Python environment

python -m venv ./venv
venv\Scripts\activate              # For Windows platforms
. venv/bin/activate                # For macOS or Linux
pip install -r requirements.txt

# Build the Python package files

python ./build_runtime.py --target dist

The package files will appear under build/dist

Metadata

Release files for tracdap-runtime 0.8.0b3

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

Source distribution (sdist)

Source distribution for tracdap-runtime 0.8.0b3
File Size Uploaded Provenance Actions
tracdap_runtime-0.8.0b3.tar.gz 197.0 kB Without provenance Details for tracdap_runtime-0.8.0b3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tracdap-runtime 0.8.0b3
File Interpreter ABI Platform Actions
tracdap_runtime-0.8.0b3-py3-none-any.whl Python 3 none any Details for tracdap_runtime-0.8.0b3-py3-none-any.whl

Total release size: 469.8 kB

Release files / tracdap_runtime-0.8.0b3.tar.gz

Download URL tracdap_runtime-0.8.0b3.tar.gz
Size 197.0 kB
Tags Source
SHA-256 checksum
How to use checksums
9b51874c2c6957b4e7974be27748e384d7384b6fefa641bfa7912bfda025d755
BLAKE2b-256 checksum
How to use checksums
f52e0e1493ee9498f2f7e174d28093ccd1b83792ebe5963ddb2650755b394658
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Release files / tracdap_runtime-0.8.0b3-py3-none-any.whl

Download URL tracdap_runtime-0.8.0b3-py3-none-any.whl
Size 272.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
17fb0b6612ac846d4b677aca3225000e595c90064b441beb225777fc4dd8f292
BLAKE2b-256 checksum
How to use checksums
bc522652dcd74082556b1f06c1eefdff41dd2e9324eb4ed187715c06accebf26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Security for tracdap-runtime 0.8.0b3

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.

Release history Release notifications | RSS feed

This release
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