Skip to main content

logifos-python

logifos connects Python to the Logifos engine. The wheel carries a compiled PyO3 extension over the engine's transport — the Python counterpart of logifos-ruby's magnus extension — so a plain install negotiates, parses and renders without any external library. A ctypes tier over the C ABI remains for an explicitly selected logifos_ffi cdylib.

Tiers

  1. The extension (default). logifos._logifos_native is built with maturin from native/, delegating to logifos-ffi's python feature at a pinned engine revision. It carries the transport queries and the v1 request; request semantics stay in the engine's facade.
  2. The cdylib (explicit). NativeContext(library_path=...), or LOGIFOS_LIBRARY_PATH, selects an external logifos_ffi shared library through ctypes; without either, the system loader is searched.
import logifos

engine = logifos.NativeContext()          # the extension tier
assert engine.tier == "extension"
capabilities = logifos.negotiate(context=engine)
assert {"parse", "render"} <= set(capabilities["implemented_operations"])

parsed = engine.request({"abi_version": 1, "schema_version": 1, "op": "parse",
                         "format": "mathml", "source": "<math><ms>x</ms></math>"})
svg = engine.render(parsed["model"], formula_contract=parsed["formula_contract"],
                    options={"fonts": [logifos.font_resource("main", font_bytes)],
                             "fallback_order": ["main"]})

Construction checks ABI version 1, schema version 1, an engine version and the buffer-v1/JSON-v1 feature bits before transport use, on either tier. Unknown feature bits are ignored; the package version is independent of ABI and schema versions. An explicit library_path selects that exact file, including relative file names, and never falls back to the extension. Loading or compatibility failure raises NativeLibraryError without searching elsewhere.

Each context retains its transport (the extension, or the library and its matching allocator). Contexts can coexist, and constructing one does not change another. Every response is copied into Python-owned bytes and released exactly once before JSON decoding. No native response pointer escapes the call.

Requests, resources and refusals

engine.request(message) accepts a dictionary or exact bytes, bytearray or memoryview. It returns the decoded result or raises an EngineError subclass with code, message, path and stage. Dictionary requests use UTF-8 without Unicode normalization; byte requests preserve their exact length, including embedded NULs, for native decoding. engine.request_bytes(data) is the low-level transport: it returns the complete JSON envelope as owned bytes, including refusal envelopes. It raises for transport or buffer failures.

engine.render(formula, fmt="svg", formula_contract=identity, options=options) forwards the caller's model and immutable external contract descriptor to the engine's layout and SVG emitter. The model and contract come from a parse of the same engine, so caller and artifact always agree. PNG requests raise UnsupportedOutputError; omitting the identity sends null and receives the core's InvalidRequestError. Negotiation supplies no qualified formula identity, so the runtime never invents one.

Options are per call and use the native envelope keys: font_size_px, display, color, limits, fonts and fallback_order. The binding does not mutate them or retain resources between calls. Create a wire font resource from caller bytes with logifos.font_resource(resource_id, data, face_index=0). It computes SHA-256 and padded base64; put the returned dictionary in options["fonts"] and list its ID in options["fallback_order"]. No fonts are bundled, discovered or fetched; a render without fonts refuses FontError (MISSING_FONT).

Other native refusals map to InvalidRequestError, ResourceLimitError, FontError, ContractError or the base EngineError. Transport failures raise TransportError with numeric status and symbolic code; malformed native responses raise ProtocolError.

The module functions logifos.negotiate and logifos.render accept either context=engine or library_path=.... Without either they construct a context using the selection rules above. There is no mutable process-wide context.

Installed-package checks

CI builds the engine cdylib at the revision native/Cargo.toml pins and sets LOGIFOS_TEST_LIBRARY to it, so the ctypes tier's integration checks run against the same engine as the compiled tier. Without it they are skipped, and the compiled-tier and fixed-response checks still run. With the package installed (editable or from a wheel), from the checkout:

LOGIFOS_TEST_LIBRARY=/path/to/liblogifos_ffi.so python -m pytest tests -q

A built wheel is qualified from outside the source checkout: install it into a separate virtual environment, name it with LOGIFOS_TEST_WHEEL, and run the same suite from another directory, or use the standalone form with isolated imports:

python -m pip install dist/*.whl pytest
cd "$(mktemp -d)"
LOGIFOS_TEST_WHEEL=/path/to/logifos-0.1.0-*.whl \
LOGIFOS_TEST_LIBRARY=/path/to/liblogifos_ffi.so \
  python -m pytest -p no:cacheprovider "$checkout/tests" -q
python -I "$checkout/tests/test_distribution.py" /path/to/logifos-0.1.0-*.whl

Here checkout names the source checkout. The distribution checks compare the wheel and the installed distribution with this checkout's pyproject.toml; without LOGIFOS_TEST_WHEEL they are skipped. The fixed responses test Python encoding and ownership only. Native tests establish negotiation, UTF-8 byte limits, typed refusals, per-call options, independent contexts and repeated cleanup.

Metadata

Release files for logifos 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for logifos 0.1.0
File Actions
logifos-0.1.0-cp39-abi3-win_arm64.whl CPython 3.9 abi3 Windows ARM64 Details for logifos-0.1.0-cp39-abi3-win_arm64.whl
logifos-0.1.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for logifos-0.1.0-cp39-abi3-win_amd64.whl
logifos-0.1.0-cp39-abi3-win32.whl CPython 3.9 abi3 Windows x86-32 Details for logifos-0.1.0-cp39-abi3-win32.whl
logifos-0.1.0-cp39-abi3-musllinux_1_2_riscv64.whl CPython 3.9 abi3 Linux musl 1.2+ RISC-V 64 Details for logifos-0.1.0-cp39-abi3-musllinux_1_2_riscv64.whl
logifos-0.1.0-cp39-abi3-musllinux_1_2_armv7l.whl CPython 3.9 abi3 Linux musl 1.2+ ARMv7l Details for logifos-0.1.0-cp39-abi3-musllinux_1_2_armv7l.whl
logifos-0.1.0-cp39-abi3-musllinux_1_2_aarch64.whl CPython 3.9 abi3 Linux musl 1.2+ ARM64 Details for logifos-0.1.0-cp39-abi3-musllinux_1_2_aarch64.whl
logifos-0.1.0-cp39-abi3-manylinux_2_28_s390x.whl CPython 3.9 abi3 Linux glibc 2.28+ IBM System/390x Details for logifos-0.1.0-cp39-abi3-manylinux_2_28_s390x.whl
logifos-0.1.0-cp39-abi3-manylinux_2_28_ppc64le.whl CPython 3.9 abi3 Linux glibc 2.28+ PowerPC 64-le Details for logifos-0.1.0-cp39-abi3-manylinux_2_28_ppc64le.whl
logifos-0.1.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for logifos-0.1.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
logifos-0.1.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for logifos-0.1.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
logifos-0.1.0-cp39-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64, macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64 Details for logifos-0.1.0-cp39-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl

Total release size: 10.9 MB

Release files / logifos-0.1.0-cp39-abi3-win_arm64.whl

Download URL logifos-0.1.0-cp39-abi3-win_arm64.whl
Size 774.3 kB
Tags CPython 3.9 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
ec10f9719dc67133223d65391114d75b8fb206110eb53c404caa16892ce832e4
BLAKE2b-256 checksum
How to use checksums
381cc9b0b98928f0be26e5113725e479d8a2b6ee7d546ca8a9d93c5bb9fd39ff
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 Dec 5, 2026.

Transparency log

Release files / logifos-0.1.0-cp39-abi3-win_amd64.whl

Download URL logifos-0.1.0-cp39-abi3-win_amd64.whl
Size 827.1 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
cf0d22b55bf812f092d96db0ca1f8aa6244e4d713c1244f4df8445ca17916d8c
BLAKE2b-256 checksum
How to use checksums
a9991aa3bca34208fb60ec8216c2f659878278b0790b49cb6083063f4004c072
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 Dec 5, 2026.

Transparency log

Release files / logifos-0.1.0-cp39-abi3-win32.whl

Download URL logifos-0.1.0-cp39-abi3-win32.whl
Size 753.7 kB
Tags CPython 3.9 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
42b82d4f3ed52ada2c3c849a9244eb0f0e7555493d9dbac92b429013a6c0b824
BLAKE2b-256 checksum
How to use checksums
bfd61cccd58594a20ab3903805101c43b92dbc07b479527c2a6b63ae70a40080
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 Dec 5, 2026.

Transparency log

Release files / logifos-0.1.0-cp39-abi3-musllinux_1_2_riscv64.whl

Download URL logifos-0.1.0-cp39-abi3-musllinux_1_2_riscv64.whl
Size 992.7 kB
Tags CPython 3.9 Linux musl 1.2+ RISC-V 64 abi3
SHA-256 checksum
How to use checksums
310a1f471955e72afe43cf454318c89433eaf67efe2ecb561e7dc6052a83cc2e
BLAKE2b-256 checksum
How to use checksums
5ef83e6bc08772b45b45d8e1cefdfa9bd71b691900b80bcae4afbff68a8759b5
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 Dec 5, 2026.

Transparency log

Release files / logifos-0.1.0-cp39-abi3-musllinux_1_2_armv7l.whl

Download URL logifos-0.1.0-cp39-abi3-musllinux_1_2_armv7l.whl
Size 853.0 kB
Tags CPython 3.9 Linux musl 1.2+ ARMv7l abi3
SHA-256 checksum
How to use checksums
3ed092bb66ee97c7e4b0e963fb7e2375afbea9448260a6bd84e13aca21865ade
BLAKE2b-256 checksum
How to use checksums
09f63419da5b1ae33dbd705207a4cdb91cef36c94770239b786e3a213506e2c5
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 Dec 5, 2026.

Transparency log

Release files / logifos-0.1.0-cp39-abi3-musllinux_1_2_aarch64.whl

Download URL logifos-0.1.0-cp39-abi3-musllinux_1_2_aarch64.whl
Size 1.1 MB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
fbfbc2d45339bcbe4219c189ec477aea88f36227b11d2d9a644e98c32d9dacda
BLAKE2b-256 checksum
How to use checksums
0175623f2617adec53dd77b935942af137f3efdd77eea14a3db1b68660195516
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 Dec 5, 2026.

Transparency log

Release files / logifos-0.1.0-cp39-abi3-manylinux_2_28_s390x.whl

Download URL logifos-0.1.0-cp39-abi3-manylinux_2_28_s390x.whl
Size 1.0 MB
Tags CPython 3.9 Linux glibc 2.28+ IBM System/390x abi3
SHA-256 checksum
How to use checksums
3e7eb066955db8f6edb8cbcfe68f322debff6f2ff018f3d8ead5ab6384317454
BLAKE2b-256 checksum
How to use checksums
d24f40468ca48b5f6b7138f63147cae4f2be9639f964e0a9beab50e184d818d7
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 Dec 5, 2026.

Transparency log

Release files / logifos-0.1.0-cp39-abi3-manylinux_2_28_ppc64le.whl

Download URL logifos-0.1.0-cp39-abi3-manylinux_2_28_ppc64le.whl
Size 1.0 MB
Tags CPython 3.9 Linux glibc 2.28+ PowerPC 64-le abi3
SHA-256 checksum
How to use checksums
91cee59d5b5af457c362a5d02dd3f1b24a6fabc958064ed8e1800cda24545024
BLAKE2b-256 checksum
How to use checksums
969c96971ee701f60d72a78e5924338067324638514eccd9f7858555c8d6068a
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 Dec 5, 2026.

Transparency log

Release files / logifos-0.1.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL logifos-0.1.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 935.1 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
c69ea9965b83720f3cbc4d20c1f7dba8bf9b1ac4a93e547ed171c31efe8e14d6
BLAKE2b-256 checksum
How to use checksums
bac466fbb5ac4a501e3f956a063c1250807fd4ca88171734fe84f062c99b5eed
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 Dec 5, 2026.

Transparency log

Release files / logifos-0.1.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL logifos-0.1.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 935.3 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
6672dd96ef38c4f17fcec12c41d66ff61ce3513a246cad8f939b669d440fdfbd
BLAKE2b-256 checksum
How to use checksums
24ec940a0d7743c6effc88aac9ecfdd9de5ca1ad5c7ce2c02e373158350c5ada
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 Dec 5, 2026.

Transparency log

Release files / logifos-0.1.0-cp39-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl

Download URL logifos-0.1.0-cp39-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl
Size 1.7 MB
Tags CPython 3.9 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
fc79a7e9998c0bd9105713aac00ac64aab948caa2a57eed82509d8cdd67a29c8
BLAKE2b-256 checksum
How to use checksums
dc967b4395cbb3c6aa5b5480808d585cf79508a2e2aec94019f32363fb3f838c
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 Dec 5, 2026.

Transparency log

Security for logifos 0.1.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 11 files in this release have been uploaded with provenance metadata.

Select from 11 files

Attestation for logifos-0.1.0-cp39-abi3-win_arm64.whl

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 Dec 5, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

11 release files Full provenance

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