return-scenario-engine (Python)
The Python distribution provides the same dependency-free normalized-index
scenario API, methodology JSON, public SHA-256 hash, and synthetic golden corpus
as the TypeScript package. Install with python -m pip install return-scenario-engine, then call calculate_scenario with explicit artifact
dictionaries. Full contract, limits, examples, and security guidance are in the
repository README.
from return_scenario_engine import calculate_scenario
dates = ["2024-01-01", "2024-01-02", "2024-01-03"]
base = {"schemaVersion": 1, "methodologyVersion": "return-scenario-v1.0.0", "seriesBasis": "close_index", "annualizationFactor": 365, "dates": dates}
result = calculate_scenario({"amountCents": 100_000, "requestedStart": dates[0], "requestedEnd": dates[-1], "assetA": base | {"assetKey": "sample-a", "growthIndex": [100, 110, 121]}, "assetB": base | {"assetKey": "sample-b", "growthIndex": [100, 95, 100]}})
assert result["status"] == "ok"
Release files for return-scenario-engine 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| return_scenario_engine-0.1.0.tar.gz | 17.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| return_scenario_engine-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.5 kB
Release files / return_scenario_engine-0.1.0.tar.gz
| Download URL | return_scenario_engine-0.1.0.tar.gz |
|---|---|
| Size | 17.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2af00960ccfddc8b60704ad5dbdd3db6a8b2a8e0c3113544f6af86acab3cc77f
|
|
BLAKE2b-256 checksum How to use checksums |
f4a5b982b618eae82c96b9d9a683cab59633109830693adb3556e918651d8f01
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.
Transparency logRelease files / return_scenario_engine-0.1.0-py3-none-any.whl
| Download URL | return_scenario_engine-0.1.0-py3-none-any.whl |
|---|---|
| Size | 16.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5e3274555a516651ae5a99e98db45b37ebf5b9f00a8419e98f7c09287796509d
|
|
BLAKE2b-256 checksum How to use checksums |
d48e6813001894b0f5d8f2f6c7a3184ff252f5d53cb999111c4b18e7846874de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.
Transparency log