Skip to main content

openscript

The engine that runs a compiled OpenScript program, in Python.

OpenScript is an open trading language. A script is compiled to a compiled program: plain data, an instruction list, never generated code. This package runs one.

It exists so that a platform can run a strategy where a JavaScript runtime is not available, which for a production trading server is the ordinary case. The compiler and the first engine are the openalgo-script package on npm; this is the second engine, and the two are held to each other by a conformance suite where any disagreement is a release blocker.

What it is

  • No compiler. This package is handed a compiled program and never a script. The program arrives as canonical text, which is what a run's hash is taken over, so an engine cannot quietly run something other than what was recorded.
  • Nothing builds code out of text. No string evaluator, no statement executor, no import driven by hand, no object graph loaded out of bytes. That is what lets a platform run many people's scripts in one process, and it is enforced by a check rather than intended.
  • Zero dependencies. The standard library only, and not the parts of it that stop a run being reproducible. Measured on every build against the module names the running interpreter says are its own.

Installing

pip install openscript

Python 3.12 or newer. Nothing else.

Using it

from openscript.run import load_text

loaded = load_text(program_text, settings, library)
if loaded.ok:
    result = loaded.run.execute_bar(0, bar)

A host loads a program once and pushes bars at it one at a time, keeping a checkpoint so a bar that is still moving can be executed again and rolled back. The conformance adapter is the other way in:

python -m openscript --describe
python -m openscript <case-directory>

Where the documentation is

The specification and the guides live in the repository:

  • docs/integrating/the-python-engine.md for what is in this package and what a host needs.
  • docs/integrating/running-a-strategy.md for driving it bar by bar: the load, the bar cycle, the rollback a moving bar rests on, and the order boundary.
  • spec/ for the language, the compiled program format, the standard library and the conformance suite.

Licence

Apache-2.0.

Release files for openscript 0.6.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 openscript 0.6.0
File Size Uploaded
openscript-0.6.0.tar.gz 384.0 kB Details

Built distribution (wheel)

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

Total release size: 676.7 kB

Release files / openscript-0.6.0.tar.gz

Download URL openscript-0.6.0.tar.gz
Size 384.0 kB
Tags Source
SHA-256 checksum
How to use checksums
512659883f02f91bc0c953a1ef9e250b2fe27b1d14a85b52c760a5b1e54c3869
BLAKE2b-256 checksum
How to use checksums
c137dd0a2f328b48c7fab1748c4405ad35f70e6ba0d8d718b968568fdf095139
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 24, 2026.

Transparency log

Release files / openscript-0.6.0-py3-none-any.whl

Download URL openscript-0.6.0-py3-none-any.whl
Size 292.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e381b57a4eb57deb7a4803f937385ab094a5c9eb818b1e523327e6acaedeeb3
BLAKE2b-256 checksum
How to use checksums
ea1fe8bbe20ad544244deacf5dd987093350f9f31b9bf34ddd0334eaa697835a
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 24, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.0

2 release files

0.4.0

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