Skip to main content

ArxPy

ArxPy is the typed Python-facing API for the Arx compiler.

Status: pre-stable compiler facade. Parse, semantic check, host compilation, captured execution, structured diagnostics, and typed artifacts are available. Cancellation, cross-target compilation, query/LSP APIs, and API compatibility guarantees are not complete.

Install

pip install arxpy

Current API

from arxpy import (
    ArtifactKind,
    ArxError,
    Compiler,
    CompileError,
    Diagnostic,
    DiagnosticSeverity,
    ExecutionError,
    ParseError,
)

Diagnostic is an immutable external record with severity, message, filename, line, column, and optional code. ArxPy adapters translate IRx structured diagnostics and Arx parser exceptions without exposing raw compiler nodes.

All expected public failures inherit from ArxError and carry a diagnostics list. Unexpected internal compiler exceptions are not relabeled as user input errors.

from pathlib import Path

from arxpy import ArtifactKind, Compiler

compiler = Compiler()
parsed = compiler.parse_file("program.x")
checked = compiler.check(parsed)

ir = compiler.compile(checked, kind=ArtifactKind.LLVM_IR)
assert ir.llvm_ir is not None

binary = compiler.compile(
    checked,
    kind=ArtifactKind.EXECUTABLE,
    output=Path("build/program"),
)
result = compiler.run(binary, timeout=10)
print(result.exit_code, result.stdout, result.stderr)

Native output from in-memory source requires an explicit output path. File compilation defaults beside the source (.o for objects and no suffix for an executable). The API creates no implicit persistent temporary directory. Compiler operations are serialized across instances while the Arx frontend uses its process-wide input buffer; repeated calls use fresh lowering builders. run never invokes a shell, and a program's non-zero exit status is returned as data. Public annotations are enforced at runtime, including every collection item. The args input must be a non-string sequence of strings; scalar str and bytes values are rejected rather than expanded character by character.

Use the arx CLI for test discovery and CLI-oriented workflows that the facade does not yet model.

Documentation: https://arxlang.org/arxpy/

License: Apache-2.0.

Metadata

Release files for arxpy 1.25.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 arxpy 1.25.0
File Size Uploaded Provenance Actions
arxpy-1.25.0.tar.gz 14.7 kB Without provenance Details for arxpy-1.25.0.tar.gz

Built distribution (wheel)

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

Total release size: 30.6 kB

Release files / arxpy-1.25.0.tar.gz

Download URL arxpy-1.25.0.tar.gz
Size 14.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f7dfa6e26ec86acbefb132c5c57101ff495d68310efc5065e8ecf70d49f5913f
BLAKE2b-256 checksum
How to use checksums
624ec93ca63cb4888758c1cc410d6d1cc8bbf18ebd69a3b4e42c476d6076e518
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.2 CPython/3.10.22 Linux/6.17.0-1022-azure

Release files / arxpy-1.25.0-py3-none-any.whl

Download URL arxpy-1.25.0-py3-none-any.whl
Size 15.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fb6f5618d82052449d5093a1f0523129a2bc74ced031e32ef98514bc8dbefc15
BLAKE2b-256 checksum
How to use checksums
2bdb15603f83c82624fcb09dba90a6a0c156b6f44d735f677e8beb5fdbaab819
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.2 CPython/3.10.22 Linux/6.17.0-1022-azure

Security for arxpy 1.25.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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

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