Python SDK for Niyati, the hosted engine for reachability, fragility, and collapse-aware decision intelligence
Project description
niyati-core
Python SDK for Niyati, the hosted engine for:
- reachable-future analysis
- collapse and fragility detection
- point-of-no-return tracking
- decision support under resource and timing constraints
Niyati is for cases where probability forecasts are not enough and you need to know what remains structurally possible.
Typical use cases:
- startup runway and survival planning
- prediction market and scenario elimination
- game decision validation and scoring
- strategic planning under budget, constraint, and path dependence
Install
Published package flow:
pip install niyati-core
Local development flow:
pip install maturin
maturin develop
Build
maturin build --release
Python 3.8 through 3.13 are supported directly. Python 3.14+ requires PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1.
Hosted API
Default production API:
https://api.causalorlabs.com
The current Python release line targets the live hosted API contract and sends the required version header automatically.
Usage
import json
import niyati
schema = {
"version": "1.0.0",
"metadata": {"name": "SDK Demo"},
"time": {"type": "discrete", "horizon": 4},
"resources": {
"money": {"initial": 1000.0, "min": 0.0, "max": 10000.0}
},
"variables": {
"x": {
"type": "float",
"initial": 0.0,
"min": 0.0,
"max": 10.0,
"discretization": 1.0
}
},
"actions": [
{
"name": "increment",
"cost": {"money": 10.0},
"effects": {"x": {"op": "add", "value": 1.0}},
"preconditions": []
}
],
"transitions": [],
"constraints": [],
"goal": {
"type": "threshold",
"conditions": [{"variable": "x", "operator": "gte", "value": 3.0}]
}
}
session = niyati.NiyatiSession(
json.dumps(schema),
api_key="your_api_key_here",
base_url="https://api.causalorlabs.com"
)
remote_result = json.loads(session.evaluate())
local_result = json.loads(session.simulate_local())
What You Get Back
Responses include:
verdicttimelinepoint_of_no_returnrecommendationtrust_levelerror_bounds
That means the SDK is not just returning a binary answer; it gives you enough structure to build operator dashboards, game loops, alerts, and scenario tooling.
Functions
simulate(schema_json, budget=None, api_key=None, base_url=None, capability=None)- one-off remote evaluation (capability:fullorlite, defaultfull)simulate_local(schema_json, budget=None)- one-off local engine executionNiyatiSession.evaluate(budget=None, capability=None)- remote evaluation with timeout and retriesNiyatiSession.simulate_local(budget=None)- capped local executionNiyatiSession.solve_reachability(payload_json)- calls/v1/solve/reachabilityNiyatiSession.solve_fragility(payload_json)- calls/v1/solve/fragilityNiyatiSession.solve_trajectory(payload_json)- calls/v1/solve/trajectoryNiyatiSession.solve_multiagent(payload_json)- calls/v1/solve/multiagentNiyatiSession.solve_competition(payload_json)- calls/v1/solve/competitionNiyatiSession.solve_pareto(payload_json)- calls/v1/solve/pareto
Runtime Notes
- Remote calls send the version header required by the hosted API.
- Retry attempts preserve
X-Niyati-Key. POST /v1/simulatecan be used anonymously, but/v1/solve/*requires a valid API key.- Legacy class alias
CausalorSessionremains available during migration. - Local execution is capped to
<= 5variables and horizon<= 12. - The production hosted API for Niyati is expected at
https://api.causalorlabs.com.
Learn More
- GitHub:
https://github.com/CausalorLabs/Niyati - API onboarding:
niyati-core/docs/API_ONBOARDING.md - Developer guide:
niyati-core/docs/DEVELOPER_GUIDE.md
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 Distribution
Built Distribution
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 niyati_core-0.3.18.tar.gz.
File metadata
- Download URL: niyati_core-0.3.18.tar.gz
- Upload date:
- Size: 186.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0464afddc641f4fb56dc3a9dff363df2622911dc9ef2a25af877e0aae589533
|
|
| MD5 |
4055450cc46cad4f6cacf2edfc4df16b
|
|
| BLAKE2b-256 |
3be7b02ee45d402e0880328d9d9f88f5ee4bc91f6e72350cc049fe8ef0200298
|
File details
Details for the file niyati_core-0.3.18-cp312-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: niyati_core-0.3.18-cp312-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.12+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e860f0f2b80c7fd2dd877b9ef02fae6fbb1c29b5d97ef8b19115061384a12ce
|
|
| MD5 |
a519dcdf02751ede881a2c70e3a962fa
|
|
| BLAKE2b-256 |
3c129bc3db8ccfa1e7c603a922f1277187233b2b00a4d783cafd38802e82c7e2
|