Skip to main content

graphsolve

Python client for the GraphSolve engine API — production-network solving, PVT/EOS, flow assurance and transient multiphase flow, as a hosted service.

pip install graphsolve
export GRAPHSOLVE_API_KEY=...
from graphsolve import GraphSolve

gs = GraphSolve()          # or GraphSolve(api_key)

# Any of the 98 tools
result = gs.call("solve_network", {"network_json": model})
print(result["metadata"]["billing"]["credits_charged"])

# Price a long run before committing to it
quote = gs.quote("run_transient_wave", request)
print(quote["quote"]["estimated_credits"])

# Long-running work, without the async
answer = gs.run("run_transient_wave", request)

# Which key this is, and what it may do
print(gs.me()["scopes"])

Units

SI throughout — pressure MPa, temperature K, rates kSm³/day, lengths m. Permeability in millidarcy is the single exception.

Errors

Failures are typed, because the right response differs in each case — and so does the bill:

Raised Meaning Charged
InvalidPayload the request was wrong; nothing ran no
AuthenticationError the API key was rejected, or the token is invalid no
ToolNotPermitted the key lacks the scope this tool needs no
RateLimited slow down; carries retry_after no
SolverDidNotConverge it ran and produced no answer yes
ServerError our fault no

That distinction is the one worth knowing: a calculation that runs and does not converge is a real result which consumed real compute, so it is charged. A malformed request is free.

Keys carry scopes. engine:read covers the free catalogue and property lookups; engine:solve covers anything that runs a calculation.

Authentication

The API key is exchanged at the platform's token endpoint for a short-lived access token on the first call. The token is cached and refreshed before it expires, so nothing in your code has to think about it. Sharing one client across threads is safe, and concurrent first calls produce a single exchange.

token = gs.get_access_token()   # if you need the same bearer elsewhere

For a non-production platform, point both endpoints at it with base_url and token_url, or GRAPHSOLVE_BASE_URL and GRAPHSOLVE_TOKEN_URL. The token URL is never derived from the base URL.

Retries

429 and 503 are retried with backoff and jitter, honouring Retry-After. Nothing else is — a 400 fails identically every time. Every call carries an Idempotency-Key, so a retry after a network timeout is never billed twice.

Licence

Apache-2.0.

Metadata

Release files for graphsolve 1.0.40

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

Source distribution (sdist)

Source distribution for graphsolve 1.0.40
File Size Uploaded
graphsolve-1.0.40.tar.gz 30.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for graphsolve 1.0.40
File Interpreter ABI Platform
graphsolve-1.0.40-py3-none-any.whl Python 3 none any Details

Total release size: 59.4 kB

Release files / graphsolve-1.0.40.tar.gz

Download URL graphsolve-1.0.40.tar.gz
Size 30.7 kB
Tags Source
SHA-256 checksum
How to use checksums
993813a605674b702d42bccddbe9d37b8cee89e6cbc3f257f59b2582a7147e5a
BLAKE2b-256 checksum
How to use checksums
1ff398261c2e772e49124d949f3f72d82e0bf7b4fc5f14d45f606532b9cba14d
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 30, 2026.

Transparency log

Release files / graphsolve-1.0.40-py3-none-any.whl

Download URL graphsolve-1.0.40-py3-none-any.whl
Size 28.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
db82d41fd40177a85cfc3385d85cc02f0b85d33f810fa32e81b7a82b0db0477e
BLAKE2b-256 checksum
How to use checksums
cdb9d629804538e9c616fa2dbf004e7c99d1851d300675dc3cb6671f04965a02
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 30, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.40 This release

2 release files

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