Skip to main content

SharpeArena for Python

The Python distribution combines the native SharpeArena engine with a Gymnasium-compatible environment and optional adapters for multi-agent, RLVR, offline-RL, MCP, and local-model workflows.

Point-in-time observations prevent future-bar access through the environment API. They do not isolate Python code from the host. Run trusted local code here, or use SharpeBench's digest-pinned container path for an untrusted entrant.

Install

pip install sharpearena

The base install includes NumPy, Gymnasium, the Python package, and the compiled pyo3 extension. Optional integrations are explicit:

pip install "sharpearena[pettingzoo]"
pip install "sharpearena[verifiers]"
pip install "sharpearena[minari]"
pip install "sharpearena[mcp]"

Step a Gymnasium environment

from sharpearena import SharpeArenaEnv

env = SharpeArenaEnv(n_symbols=4, n_days=120, seed=7)
observation, info = env.reset(seed=7)

terminated = truncated = False
while not (terminated or truncated):
    action = env.action_space.sample()
    observation, reward, terminated, truncated, info = env.step(action)

Actions are signed target-weight vectors in the environment's symbol order. The default range is [-1, 1]; pass allow_short=False to make it [0, 1], or set max_weight to change the per-symbol bound.

Importing sharpearena registers the following Gymnasium IDs:

SharpeArena/Calm-v1          SharpeArena/Calm-Eval-v1
SharpeArena/Hard-v1          SharpeArena/Hard-Eval-v1
SharpeArena/Extreme-v1       SharpeArena/Extreme-Eval-v1

The -Eval-v1 environments draw from the disjoint evaluation seed band. The -v1 suffix freezes the environment semantics; a rule change requires a new versioned ID.

Native boundary

sharpearena.sharpearena_py.TradingEnv is the low-level binding. Its boundary is JSON: reset() returns an observation string, and step(decision_json) returns (observation_json, reward, done, info_json). The Python Gymnasium wrapper converts between that wire format and NumPy spaces.

The wheel ships py.typed and a stub for the compiled extension. Typed boundary exceptions distinguish invalid input, invalid JSON, invalid salt, unavailable data, and engine failures.

Other surfaces

Task Surface
Batched Gymnasium rollout SharpeArenaVectorEnv or gymnasium.make_vec(...)
Multi-agent environment MultiAgentSharpeArenaEnv with the pettingzoo extra
RLVR / Prime RL load_environment() with the verifiers extra
Offline RL export to_minari, to_minari_train_test with the minari extra
External tool server MCP server with the mcp extra
Evidence field sharpearena-local-field and the model transport shims
Benchmark compilation sharpearena-compile-bench
Strategy search sharpearena-strategy-search

See the repository's Gymnasium guide, training guide, and agent contract for the full workflows.

Build from source

python -m maturin develop --manifest-path crates/sharpearena-py/Cargo.toml

License

MIT OR Apache-2.0

Metadata

Release files for sharpearena 0.24.0

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

Source distribution (sdist)

Source distribution for sharpearena 0.24.0
File Size Uploaded
sharpearena-0.24.0.tar.gz 609.3 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for sharpearena 0.24.0
File
sharpearena-0.24.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details
sharpearena-0.24.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
sharpearena-0.24.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
sharpearena-0.24.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details

Total release size: 4.9 MB

Release files / sharpearena-0.24.0.tar.gz

Download URL sharpearena-0.24.0.tar.gz
Size 609.3 kB
Tags Source
SHA-256 checksum
How to use checksums
585a9457fea301f688ad362b031c049d7f27722b8e1bcfae7337e30e196b4395
BLAKE2b-256 checksum
How to use checksums
0954051a0b648a2d597e6088f60286b176cacdba05363292f3066f027b4dcc7d
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 4, 2026.

Transparency log

Release files / sharpearena-0.24.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL sharpearena-0.24.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.1 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
27746a8ecd63d58a3f2dc0c94cea055b63d0ea28572f1771b6e650ed8993713b
BLAKE2b-256 checksum
How to use checksums
ab9301d5592a48d276ce2eeb7021bbf3f7198d26da3e67ba575d65efaa57107f
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 4, 2026.

Transparency log

Release files / sharpearena-0.24.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL sharpearena-0.24.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.1 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
1091dbdc286e2467f544a7fa16fcb0cfd1a2528ed2fe611cf29ba245d8088a72
BLAKE2b-256 checksum
How to use checksums
6c9da0b5c3bd6783affbf9ace30c5abd7bbff00a20748eb33c6b9bc42e969d6b
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 4, 2026.

Transparency log

Release files / sharpearena-0.24.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL sharpearena-0.24.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.1 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
7930775347933204d04380d1c5b5a58a19b065e6616cf4eef99504e86aabad2b
BLAKE2b-256 checksum
How to use checksums
e9b4fdeee68668029a2a2412143c434859cd59916d6b1a7709f337363489411d
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 4, 2026.

Transparency log

Release files / sharpearena-0.24.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL sharpearena-0.24.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.1 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
f57935151f080dea6ae12c5fe1f8d879125d3d6cc58db16c14b9854a970d4cc1
BLAKE2b-256 checksum
How to use checksums
aabe226aaa6b72cb9edcbf5a066f74bfbb84aed6bbd4f67b8d7f310bc77bad95
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 4, 2026.

Transparency log

Release history Release notifications | RSS feed

0.31.0

5 release files

0.30.0

5 release files

0.29.0

5 release files

0.28.0

5 release files

0.27.0

5 release files

0.26.0

5 release files

0.25.0

5 release files

This release

0.24.0 This release

5 release files

0.21.0

5 release files

0.20.0

5 release files

0.19.0

5 release files

0.18.0

5 release files

0.17.0

5 release files

0.16.0

5 release files

0.15.0

5 release files

0.14.0

5 release files

0.13.0

5 release files

0.12.0

5 release files

0.11.1

5 release files

0.10.0

5 release files

0.9.0

5 release files

0.8.0

5 release files

0.7.0

5 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