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 101 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.42

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.42
File Size Uploaded
graphsolve-1.0.42.tar.gz 31.8 kB Details

Built distribution (wheel)

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

Total release size: 61.1 kB

Release files / graphsolve-1.0.42.tar.gz

Download URL graphsolve-1.0.42.tar.gz
Size 31.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a68d35d76665db5312aea9fe670d50cab8cd7a7add2fe57b63ee170d5c74584e
BLAKE2b-256 checksum
How to use checksums
4bcd2527705412c6fab9284d4d5adf04ae1e435d0e785a30f30f3438ac6f4b02
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 Oct 8, 2026.

Transparency log

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

Download URL graphsolve-1.0.42-py3-none-any.whl
Size 29.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7b95f080e17d71a849c1d73bf0a2dd1abcae79e60ef6ad2e50d4dc4468a2e67
BLAKE2b-256 checksum
How to use checksums
2ba74290f335569785ee9ca09a9cb7440e042932b728700448296db0da1adf5c
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 Oct 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.42 This release

2 release files

1.0.40

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