Skip to main content

packvium-native

Optional native backend selector for Packvium. It uses the compiled Rust wheel when available and otherwise delegates to the pure Python package.

Full documentation, the constraint reference and benchmarks live at packvium.com.

Install

pip install 'packvium-native[native]' packvium

The native extra installs the platform wheel. To use only the fallback, install packvium-native together with packvium.

packvium-native is not on PyPI yet. Until the native wheels ship, install it from source:

pip install git+https://github.com/packvium/packvium-python-adapter packvium

Quick start

from packvium_native import backend, pack

result = pack({
    "items": [{
        "id": "book", "quantity": 4,
        "dimensions": {"length": "210", "width": "140", "height": "30"},
    }],
    "containers": [{
        "id": "carton",
        "inner_dimensions": {"length": "400", "width": "300", "height": "250"},
    }],
})

print(backend())          # "rust" or "python"
print(result["status"])  # "feasible"

The adapter does not replace the packvium import. It is useful when an application wants one stable call site with a native fast path and a pure-Python fallback.

pack_json takes and returns the same JSON string every other Packvium binding speaks — useful when the request is already serialized, or being forwarded as-is:

from packvium_native import pack_json

response = pack_json('{"items":[...],"containers":[...]}')

Examples

Runnable, in examples/. Each one is a single file you can read top to bottom and execute without a project around it.

File What it shows
basic.py Pack through the adapter and report which backend answered.
shapes.py Items that are not their box: complementary wedges sharing one crate as convex_hull, two copies of one wedge that need the signed rotation -L-W+H, a cushion that compresses under load until the crush limit refuses it, and a gusseted bag that holds a layer more than a flat one — the same numbers whichever backend answered.
python3 examples/basic.py

Platforms

Native wheels support Linux x86_64/aarch64, macOS Apple Silicon/Intel and Windows. The wheel uses Python's stable ABI, so one wheel supports Python 3.9 and later on its platform.

The Packvium family

One request and result contract, implemented independently in four engines (Rust, Python, PHP, JavaScript) and checked against each other on a shared fixture set. Python and PHP are held to byte-identical canonical results; Rust and the JavaScript fallback are held to independent validity and a per-fixture objective floor. Pick the package for your stack; mixing them in one system is safe.

Documentation, the constraint reference and the benchmarks are at packvium.com.

Package Install Source
Python — packvium pip install packvium packvium-python
PHP — packvium/packvium composer require packvium/packvium packvium-php
Rust — packvium packvium = "1.11" packvium-rust
Node.js — @packvium/engine npm install @packvium/engine packvium-node
Browser / WebAssembly — @packvium/browser npm install @packvium/browser packvium-wasm
PHP FFI bridge — packvium/native-bridge composer require packvium/native-bridge packvium-php-bridge
Python native selector — packvium-native from source until the native wheels ship packvium-python-adapter

Citation

If Packvium supports your research, cite it as software. GitHub's Cite this repository button reads CITATION.cff, and codemeta.json carries the same record in CodeMeta form.

@software{packvium_python_adapter,
  author  = {{Packvium contributors}},
  title   = {Packvium native backend selector for Python},
  version = {1.11.0},
  license = {MIT},
  url     = {https://packvium.com}
}

License

MIT. See LICENSE.

Metadata

Release files for packvium-native 1.11.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 packvium-native 1.11.0
File Size Uploaded Provenance Actions
packvium_native-1.11.0.tar.gz 8.3 kB With provenance Details for packvium_native-1.11.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for packvium-native 1.11.0
File Interpreter ABI Platform Actions
packvium_native-1.11.0-py3-none-any.whl Python 3 none any Details for packvium_native-1.11.0-py3-none-any.whl

Total release size: 14.1 kB

Release files / packvium_native-1.11.0.tar.gz

Download URL packvium_native-1.11.0.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9f17eebc1a915483ce129e2ed4cdb1bff737a37a4fccf89547ccfbee21096e78
BLAKE2b-256 checksum
How to use checksums
381181ff87b26ee194d05f89ef5227910a1d68773963671c7e925b540f3de723
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 16, 2026.

Transparency log

Release files / packvium_native-1.11.0-py3-none-any.whl

Download URL packvium_native-1.11.0-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c72c11c72e38fbbd678f91ce3613cb4f0f2a7fc4daf3d865f5f8aabff02a8c01
BLAKE2b-256 checksum
How to use checksums
2528c0c252cf905b35e90473a6516252e676f9ff732c8d1daa2508315eb021dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 16, 2026.

Transparency log

Security for packvium-native 1.11.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for packvium_native-1.11.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 16, 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

1.11.0 This release

2 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