Woxi for Python
Python bindings for Woxi, an interpreter for a subset of the Wolfram Language implemented in Rust. Woxi is a computer algebra system (CAS), so computations are solved symbolically.
pip install woxi
Python API
import woxi
woxi.interpret("Plus[1, 2]")
# => '3'
woxi.interpret("Integrate[x^2, x]")
# => 'x^3/3'
# Session state persists across calls (per thread):
woxi.interpret("x = 42;")
woxi.interpret("x + 1")
# => '43'
woxi.clear_state()
# Capture stdout, graphics, sound, and warnings:
res = woxi.evaluate('Print["hi"]; Plot[Sin[x], {x, 0, 10}]')
res.stdout # => 'hi\n'
res.graphics # => '<svg …' (SVG markup)
# Reproducible random numbers:
woxi.seed_rng(1)
# Errors raise woxi.WolframError:
try:
woxi.interpret("1 +")
except woxi.WolframError as err:
print(err)
Expression trees
Results are also available as a structured tree, so you don't have to parse Wolfram output text to use them:
import woxi
woxi.evaluate("1/3 + 1/6").expr
# => Expr(Symbol("Rational"), [1, 2])
woxi.evaluate("Solve[x^2 == 2, x]").expr
# => [[Expr(Symbol("Rule"), [Symbol("x"), …])], …]
The tree mirrors Wolfram's FullForm,
so x + y is Plus[x, y] and a/b is Times[a, Power[b, -1]]
no matter how they were written.
Only exact, total mappings use native Python types:
| Wolfram | Python |
|---|---|
Integer, BigInteger |
int |
Real |
float |
String |
str |
List[…] |
list |
| symbol or constant | woxi.Symbol |
| arbitrary-precision real | woxi.BigReal |
| everything else | woxi.Expr(head, args) |
woxi.to_python converts the rest
when convenience matters more than exactness —
Rational to fractions.Fraction, Complex to complex,
Association to dict, and True/False/Null
to True/False/None:
woxi.to_python(woxi.evaluate("1/3 + 1/6").expr)
# => Fraction(1, 2)
woxi.to_python(woxi.evaluate('<|"a" -> 1|>').expr)
# => {'a': 1}
Trees also go the other way, so Python values reach an evaluation without string concatenation:
from woxi import wl
woxi.evaluate_expr(wl.Integrate(wl.Power(wl.x, 2), wl.x)).result
# => 'x^3/3'
woxi.evaluate_expr(wl.Total([1, 2, 3, 4])).result
# => '10'
# A str argument is data here, never code:
woxi.evaluate_expr(wl.StringLength("1 + 1")).result
# => '5'
wl.<name> is the symbol of that name and calling it applies it,
so any Wolfram expression can be built without quoting.
woxi.parse_expr parses source into a tree without evaluating it:
woxi.parse_expr("1 + 1")
# => Expr(Symbol("Plus"), [1, 1])
Command line
The package also installs a woxi command:
woxi eval 'Plus[1, 2]' # Evaluate an expression
woxi run script.wls # Run a Wolfram Language file
woxi repl # Interactive session
For the full-featured native CLI (including the Jupyter kernel),
install the Rust binary instead: cargo install woxi.
Building from source
The package is built with maturin and requires a Rust toolchain:
cd woxi-py
pip install maturin
maturin develop # Build and install into the active virtualenv
Run the tests with:
python -m pytest tests/
License
AGPL-3.0-or-later
Metadata
Release files for woxi 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| woxi-0.4.0.tar.gz | 9.4 MB | With provenance | Details for woxi-0.4.0.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| woxi-0.4.0-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details for woxi-0.4.0-cp310-abi3-win_amd64.whl |
| woxi-0.4.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ x86-64 | Details for woxi-0.4.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
| woxi-0.4.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ ARM64 | Details for woxi-0.4.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
| woxi-0.4.0-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details for woxi-0.4.0-cp310-abi3-macosx_11_0_arm64.whl |
| woxi-0.4.0-cp310-abi3-macosx_10_12_x86_64.whl | CPython 3.10 | abi3 | macOS 10.12+ x86-64 | Details for woxi-0.4.0-cp310-abi3-macosx_10_12_x86_64.whl |
Total release size: 163.4 MB
Release files / woxi-0.4.0.tar.gz
| Download URL | woxi-0.4.0.tar.gz |
|---|---|
| Size | 9.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
26dc7d3bcaeffb648f1d551d84d74cd936b5b1e98a4cca0487daae5c077fd56a
|
|
BLAKE2b-256 checksum How to use checksums |
684da0d4a4f09a6937ee86457fb147a6aa8552a0dd81b1d89c038fe4d9708712
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 8, 2026.
Transparency logRelease files / woxi-0.4.0-cp310-abi3-win_amd64.whl
| Download URL | woxi-0.4.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 34.6 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
7259bacb2b919f8e68dec446ffb937d17edae14e850296b07360e6446942dcaf
|
|
BLAKE2b-256 checksum How to use checksums |
a486987530030dba93aaa00b5752be1da1e9e7cb9395766bb4d7505d610bd5c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 8, 2026.
Transparency logRelease files / woxi-0.4.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | woxi-0.4.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 31.4 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
842dba9d60663cb82ffabcc42f48afca5b4ba362921ae97098ebac39ff39c935
|
|
BLAKE2b-256 checksum How to use checksums |
c8cc1cd413ed394d717fa8f194d2f7258651dd7e9503035ec8fa024e97954361
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 8, 2026.
Transparency logRelease files / woxi-0.4.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
| Download URL | woxi-0.4.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
|---|---|
| Size | 29.2 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
399223f2c59a1a4b91f4a5678204b3a9280a4e00414eee62cd3acd12be99e458
|
|
BLAKE2b-256 checksum How to use checksums |
5f0f2a98eda717287132ab02ddeaea1d480052033dae33228fa4c627b60b5a8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 8, 2026.
Transparency logRelease files / woxi-0.4.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | woxi-0.4.0-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 28.4 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c2ba946c437fe8c6f3186b284bc856a6a682adff98dd9508b49a11cc277bb228
|
|
BLAKE2b-256 checksum How to use checksums |
edbf5e4dae9ac550240f1f19bc3e13990443ad51209a1c2d14348ca3af1a7abb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 8, 2026.
Transparency logRelease files / woxi-0.4.0-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | woxi-0.4.0-cp310-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 30.6 MB |
| Tags | CPython 3.10 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
babe3ba3922f51c329382d587a66ed1ae56ff93da06f4a97e64b53a244b93cfc
|
|
BLAKE2b-256 checksum How to use checksums |
cbed9406b2f5825be74dac042633bf7e2a29f7aec8aea9ece0de3b7afdfb271e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 8, 2026.
Transparency logSecurity for woxi 0.4.0
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.
Full provenance
All 6 files in this release have been uploaded with provenance metadata.
Attestation for woxi-0.4.0.tar.gz
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 Nov 8, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.