Metewand Python package
Define Metewand benchmarks with ordinary Python functions for data generation, methods, and independent evaluation. The package handles worker communication and standard result files. It requires Python 3.11 or later and has no runtime dependencies. Running benchmarks also requires a POSIX system and the separate Metewand CLI, built with Rust 1.98.0 or later. Installing this Python package does not install the CLI.
Install and run
Once the first PyPI release is published, install the package into the Python environment that will run your workers:
python3 -m venv .venv
. .venv/bin/activate
python3 -m pip install metewand
Install the CLI from the matching release tag, then create and run a benchmark:
metewand_version=$(python3 -c 'import metewand; print(metewand.__version__)')
cargo install --locked --git https://github.com/jolars/metewand \
--tag "metewand-v${metewand_version}" metewand-cli
metewand init my-benchmark
cd my-benchmark
metewand check --workers
metewand run --output-dir run
metewand status --output-dir run
Keep the Python environment active so workers use its interpreter and installed
dependencies. The CLI creates metewand.yaml and benchmark.py, with data
generation, two methods, and independent evaluation. Choose a new output
directory for each run, or explicitly resume with --resume.
Before the first release, or when developing from a checkout, install both components from the same revision instead:
git clone https://github.com/jolars/metewand.git
cd metewand
cargo install --locked --path crates/metewand-cli
python3 -m venv .venv
. .venv/bin/activate
python3 -m pip install ./packages/python
This is an experimental package. Use matching CLI and Python package versions, and pin the version or source revision for retained benchmarks. Authoring syntax and profile APIs may change before the MVP. Package versions are separate from the versioned worker protocol and persisted record formats.
Author benchmarks
The package implements Metewand's version-1 worker protocol, including one-shot execution, fresh sequences, and buffered profiles. It serializes messages, dispatches callbacks, reports structured errors, and measures the implementation callback. The CLI owns source acquisition, seeds, scheduling, worker lifecycle, artifact validation, and durable publication. The package does not set random generators or infer scientific semantics. Install scientific dependencies into the worker environment yourself.
For a simple benchmark, use metewand init and ordinary functions selected in
YAML with function: benchmark.py:solve. The package supplies the context, JSON data,
and artifact envelopes. Evaluators can return plain metrics when no scientific
rules are declared; completion is then not_required. See the
least-squares example
for incremental validation.
For lifecycle adapters, subclass OneShotImplementation and return scientific data
from execute. Evaluators return Evaluation(metrics, verdict). The package writes
standard envelopes; custom result and metrics writers remain supported.
See the authoring guide, callback interfaces, and the runnable Python package example. Run the package tests from a repository checkout with:
PYTHONPATH=packages/python/src python3 -m unittest discover -s packages/python/tests -v
The normal Rust workspace tests also run this suite and exercise all three Python roles through the Rust transport and output validator.
Configuration-dependent support
Declare capabilities: [one_shot, applicability] and override
check_applicability to exclude configurations your implementation cannot
support intrinsically:
def check_applicability(self, dataset_instance, dataset_manifest,
problem_contract, problem_parameters,
implementation_parameters):
supported = not problem_parameters["intercept"]
return {
"outcome": "applicable" if supported else "not_applicable",
"code": "supported" if supported else "unsupported_intercept",
"reason": "Supported configuration." if supported else "Requires a zero intercept.",
}
Both dataset arguments are Path objects. The callback runs in a separate
worker before measured preparation, may inspect the immutable dataset and its
manifest, and must return nonempty code and reason strings. Optional
details must be a dictionary. Exclusions produce no attempts; callback
exceptions fail resolution. plan records unchecked until the dataset and
worker are resolved. explain and export retain checked inputs and reasons.
Metadata
Release files for metewand 0.2.0
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 |
|---|---|---|---|---|
| metewand-0.2.0.tar.gz | 31.9 kB | With provenance | Details for metewand-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| metewand-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for metewand-0.2.0-py3-none-any.whl |
Total release size: 55.2 kB
Release files / metewand-0.2.0.tar.gz
| Download URL | metewand-0.2.0.tar.gz |
|---|---|
| Size | 31.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c46a4f499f7685e8c2cc7d9246900f8e9e9736968133946667784032e01a971e
|
|
BLAKE2b-256 checksum How to use checksums |
0116c934919fb7e97fb803748c8f6cb9b2acc05c8e42ca223805778c4aa71c02
|
| 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 Oct 27, 2026.
Transparency logRelease files / metewand-0.2.0-py3-none-any.whl
| Download URL | metewand-0.2.0-py3-none-any.whl |
|---|---|
| Size | 23.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
96194a5c0e87ebca620d5cdfb280a65605c0212fda0f0b279893f1758911d4d7
|
|
BLAKE2b-256 checksum How to use checksums |
fb649755e6422ea95c349435eecb5f6ad2bd0a6dbad1cbd01d98825b00ad022b
|
| 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 Oct 27, 2026.
Transparency logSecurity for metewand 0.2.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.
Attestation for metewand-0.2.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 Oct 27, 2026.
Transparency logA 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.