Directed Acyclic Graph (DAG) management specifically for financial data workflows.
Project description
finance-dag: a finance focused DAG library for Python
Introduction
finance-dag is a Python library for managing Directed Acyclic Graphs (DAGs) specifically built for financial data workflows, such as portfolio rebalancing and risk calculations.
Installing
Requires Python 3.12+. Download and install the latest release:
pip install finance-dag
Quick Start
Define your financial logic using the ReactiveMixin and decorate your nodes with @node. Dependencies are resolved automatically.
from fdag import ReactiveMixin, node
class Portfolio(ReactiveMixin):
@node
def node_total_value(self) -> float:
return self.node_cash() + self.node_equity()
@node
def node_cash(self) -> float:
return 1000.0
@node
def node_equity(self) -> float:
return 5000.0
if __name__ == "__main__":
portfolio = Portfolio()
# Calculates cash, equity, and total_value automatically
print("Total Value:", portfolio.node_total_value()) # 6000.0
# Cached access (instantaneous)
print("Cached Value:", portfolio.node_total_value())
# Changing value invalidates a base node; cascades to dependent nodes
portfolio.node_equity = 3000
# Recalculates total_value on next access
print("Recalculated Value:", portfolio.node_total_value()) # 4000.0
Documentation
Features
- Application Modeling: model relationships between entities in a straight-forward way
- Dependency Tracking: automatically infers and tracks dependencies between nodes
- Caching and Recalculation: caches computed values, invalidates only affected dependent nodes, and recomputes them when needed
- Graph Evaluation: eagerly evaluates static parts of the graph while lazily computing reactive nodes on demand
License
This project is licensed under the Apache License, Version 2.0. See LICENSE.txt for the full text.
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 Distributions
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 finance_dag-0.1.0.dev7-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: finance_dag-0.1.0.dev7-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 183.0 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46dce089599545267f09c788e9a9647cc340ab7e4cf3de20f4f4cd0fd0d36edd
|
|
| MD5 |
c9c60d76463c8786e06d63c9603b79d3
|
|
| BLAKE2b-256 |
59f18ca93f329c20f6474f790533617f0f2be0125740d617275b7981a07e1e25
|
Provenance
The following attestation bundles were made for finance_dag-0.1.0.dev7-cp312-cp312-win_amd64.whl:
Publisher:
release.yml on tinamou8/finance-dag
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
finance_dag-0.1.0.dev7-cp312-cp312-win_amd64.whl -
Subject digest:
46dce089599545267f09c788e9a9647cc340ab7e4cf3de20f4f4cd0fd0d36edd - Sigstore transparency entry: 1366148279
- Sigstore integration time:
-
Permalink:
tinamou8/finance-dag@35baa30c07f4bd3e512d3e109557d008d0c0b781 -
Branch / Tag:
refs/tags/v0.1.0-dev7 - Owner: https://github.com/tinamou8
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@35baa30c07f4bd3e512d3e109557d008d0c0b781 -
Trigger Event:
push
-
Statement type:
File details
Details for the file finance_dag-0.1.0.dev7-cp312-cp312-win32.whl.
File metadata
- Download URL: finance_dag-0.1.0.dev7-cp312-cp312-win32.whl
- Upload date:
- Size: 145.4 kB
- Tags: CPython 3.12, Windows x86
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
670064c295e467dbc87d30a545b7a2a1b064275a62cacb9f09a6199e245abf4a
|
|
| MD5 |
dd61fe89366186b7dced4ae8506137f1
|
|
| BLAKE2b-256 |
33d3e44237bb9000c0d8c73d5e25769140ae809bff83e2d6c419147024f33132
|
Provenance
The following attestation bundles were made for finance_dag-0.1.0.dev7-cp312-cp312-win32.whl:
Publisher:
release.yml on tinamou8/finance-dag
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
finance_dag-0.1.0.dev7-cp312-cp312-win32.whl -
Subject digest:
670064c295e467dbc87d30a545b7a2a1b064275a62cacb9f09a6199e245abf4a - Sigstore transparency entry: 1366148423
- Sigstore integration time:
-
Permalink:
tinamou8/finance-dag@35baa30c07f4bd3e512d3e109557d008d0c0b781 -
Branch / Tag:
refs/tags/v0.1.0-dev7 - Owner: https://github.com/tinamou8
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@35baa30c07f4bd3e512d3e109557d008d0c0b781 -
Trigger Event:
push
-
Statement type:
File details
Details for the file finance_dag-0.1.0.dev7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: finance_dag-0.1.0.dev7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 386.4 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bb89fbc7d11b93697d7fc246be14f58751eab98a2af1aba71ef1197123cee4c
|
|
| MD5 |
05a6cffd4fd7c748c10d81852fffa255
|
|
| BLAKE2b-256 |
3f1886d50737b2d2bb0b77a06a37de9af3df0915b2b7c9698af4fbce12785b36
|
Provenance
The following attestation bundles were made for finance_dag-0.1.0.dev7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on tinamou8/finance-dag
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
finance_dag-0.1.0.dev7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
9bb89fbc7d11b93697d7fc246be14f58751eab98a2af1aba71ef1197123cee4c - Sigstore transparency entry: 1366148368
- Sigstore integration time:
-
Permalink:
tinamou8/finance-dag@35baa30c07f4bd3e512d3e109557d008d0c0b781 -
Branch / Tag:
refs/tags/v0.1.0-dev7 - Owner: https://github.com/tinamou8
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@35baa30c07f4bd3e512d3e109557d008d0c0b781 -
Trigger Event:
push
-
Statement type:
File details
Details for the file finance_dag-0.1.0.dev7-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: finance_dag-0.1.0.dev7-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 376.6 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ i686, manylinux: glibc 2.5+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3d91f34d0b69910c1a3739683fba6be9abb162ed975f456e352052116030033
|
|
| MD5 |
55352ad9b7f803bec5d9f13ab85e4220
|
|
| BLAKE2b-256 |
d1497db5f6c1924a23cd0461bd8c2985a55453087935f56a518885923e4842dd
|
Provenance
The following attestation bundles were made for finance_dag-0.1.0.dev7-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl:
Publisher:
release.yml on tinamou8/finance-dag
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
finance_dag-0.1.0.dev7-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl -
Subject digest:
b3d91f34d0b69910c1a3739683fba6be9abb162ed975f456e352052116030033 - Sigstore transparency entry: 1366148469
- Sigstore integration time:
-
Permalink:
tinamou8/finance-dag@35baa30c07f4bd3e512d3e109557d008d0c0b781 -
Branch / Tag:
refs/tags/v0.1.0-dev7 - Owner: https://github.com/tinamou8
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@35baa30c07f4bd3e512d3e109557d008d0c0b781 -
Trigger Event:
push
-
Statement type:
File details
Details for the file finance_dag-0.1.0.dev7-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: finance_dag-0.1.0.dev7-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 156.2 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a4f006b5acacd06777c7bc24bfdb05738ed9199818034d615038a284da82b7f
|
|
| MD5 |
7b354f63e8c5fe3af4e5710562c6110c
|
|
| BLAKE2b-256 |
edb09ff93ae6d0bb8ac355fbe2d41d8bbac506a341f62b3ae3cda9f441c21ddc
|
Provenance
The following attestation bundles were made for finance_dag-0.1.0.dev7-cp312-cp312-macosx_11_0_arm64.whl:
Publisher:
release.yml on tinamou8/finance-dag
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
finance_dag-0.1.0.dev7-cp312-cp312-macosx_11_0_arm64.whl -
Subject digest:
0a4f006b5acacd06777c7bc24bfdb05738ed9199818034d615038a284da82b7f - Sigstore transparency entry: 1366148330
- Sigstore integration time:
-
Permalink:
tinamou8/finance-dag@35baa30c07f4bd3e512d3e109557d008d0c0b781 -
Branch / Tag:
refs/tags/v0.1.0-dev7 - Owner: https://github.com/tinamou8
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@35baa30c07f4bd3e512d3e109557d008d0c0b781 -
Trigger Event:
push
-
Statement type: