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.27.1
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 |
|---|---|---|---|---|
| arxpy-1.27.1.tar.gz | 14.6 kB | Without provenance | Details for arxpy-1.27.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| arxpy-1.27.1-py3-none-any.whl | Python 3 | none | any | Details for arxpy-1.27.1-py3-none-any.whl |
Total release size: 30.5 kB
Release files / arxpy-1.27.1.tar.gz
| Download URL | arxpy-1.27.1.tar.gz |
|---|---|
| Size | 14.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9d0a5410e23357adb1135a807645e7646a7ec3dd64cc284209e0b77d7a9e9810
|
|
BLAKE2b-256 checksum How to use checksums |
6f8af39fb3e65abbb779df95cd1bd09e487f74b64044711d5ba408a49e07add1
|
| 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.27.1-py3-none-any.whl
| Download URL | arxpy-1.27.1-py3-none-any.whl |
|---|---|
| Size | 15.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cb8b110f5a1a5b8a474b5dd0829c882434458960615c4911d21f88f5a2b6e7b8
|
|
BLAKE2b-256 checksum How to use checksums |
3f458afc19ba3f49ffa64deec8f246a65d1b1b94dda946a51d13b24f7bc8e437
|
| 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.27.1
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.