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.28.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.28.0
File Size Uploaded Provenance Actions
arxpy-1.28.0.tar.gz 14.6 kB Without provenance Details for arxpy-1.28.0.tar.gz

Built distribution (wheel)

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

Total release size: 30.5 kB

Release files / arxpy-1.28.0.tar.gz

Download URL arxpy-1.28.0.tar.gz
Size 14.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6f96189642be3eb3efabb74a5f7da3e5fe6a7148902859e80bd130bfbd6c46f3
BLAKE2b-256 checksum
How to use checksums
2a7a6695594ed59a6e99a560398d2c36cf084ae29fd78371ddd439b18b81fcac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.11.18 Linux/7.0.0-1019-azure

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

Download URL arxpy-1.28.0-py3-none-any.whl
Size 15.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
46cc68bf104ff49cf25285e29bafffad5e76ff9e4d647ef51a41388865df93b8
BLAKE2b-256 checksum
How to use checksums
2381c6048dd4a01a2bf92bed39b8702b4fa24c3ce8a4778e50e46f5e9213c065
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.11.18 Linux/7.0.0-1019-azure

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