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.

Numerical results in 0.7.0

The two engines use the same specified rounding, seeds and missing-value rules. Portable elementary kernels remove host-dependent final-bit differences; the release audit requires exact agreement for every numerical signature it covers, including forming-bar replacement and checkpoint replay. Install the matching 0.7.0 compiler package when comparing browser and server results. Source calls and the compiled format are unchanged, but corrected results can differ from previous releases.

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.7.1

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.7.1
File Size Uploaded
openscript-0.7.1.tar.gz 413.7 kB Details

Built distribution (wheel)

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

Total release size: 713.8 kB

Release files / openscript-0.7.1.tar.gz

Download URL openscript-0.7.1.tar.gz
Size 413.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8615ad164e812510aed22e2c42abd80eec24a64b652486683276c103e84854b3
BLAKE2b-256 checksum
How to use checksums
d9b51b7e387d08ffe4ebc1312f49418e26ddff4b94c7afef782f8db77af987c6
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 25, 2026.

Transparency log

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

Download URL openscript-0.7.1-py3-none-any.whl
Size 300.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7455eeb9a35b37238c55731f3f75aa43f3e833434d28ee4867e82adb210777f2
BLAKE2b-256 checksum
How to use checksums
9bfd74cf38a71bd07fb2bb257a5232d9ede24421c6ab1aed17c6e6b6ae511265
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 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.7.1 This release

2 release files

0.7.0

2 release files

0.6.0

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