Registry / devops / clvm-tools-rs

clvm-tools-rs

JSON →
library0.4.0pypypi✓ verified 86d ago

clvm-tools-rs provides a Rust implementation of tools for working with the Chialisp language, including a compiler and REPL, with Python and WebAssembly (WASM) bindings. It is a port of the original clvm_tools to Rust, aiming for improved performance and better alignment with the underlying clvm_rs Rust implementation. The library is actively developed, with its core Rust components seeing frequent updates.

pip install clvm-tools-rs
INSTALL
IMPORT
SIG · CLVM-TOOLS-RS
C
clvm-tools-rs
devopspythonv0.4.0
Install
1.8s avg
Import
Disk
19MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.4.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 21.3MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 1.8s · import 0.000s · 22MB
19MB installed
● package 19MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

compile_clvm
from clvm_tools_rs import compile_clvm

This quickstart demonstrates how to use `compile_clvm` from `clvm_tools_rs` to compile a Chialisp source file into its CLVM hexadecimal representation. It creates a simple Chialisp program, compiles it, and prints the result.

import os from pathlib import Path from clvm_tools_rs import compile_clvm # Create a dummy Chialisp file chialisp_code = """ (mod (A B) (+ A B) ) """ # Ensure a temporary directory exists for the output output_dir = Path("temp_chialisp_output") output_dir.mkdir(exist_ok=True) chialisp_file_path = output_dir / "my_program.clsp" compiled_file_path = output_dir / "my_program.clvm.hex" with open(chialisp_file_path, "w") as f: f.write(chialisp_code) # Compile the Chialisp code # The compile_clvm function expects strings for paths compile_result = compile_clvm(str(chialisp_file_path), str(compiled_file_path), [], False) print(f"Compiled successfully: {compile_result['success']}") if compile_result['success']: print(f"Output CLVM hex written to: {compiled_file_path}") with open(compiled_file_path, "r") as f: print(f"Compiled CLVM (hex): {f.read().strip()}") else: print(f"Compilation error: {compile_result['error']}") # Clean up temporary files (optional) # os.remove(chialisp_file_path) # os.remove(compiled_file_path) # os.rmdir(output_dir)
clvm_tools --version
Debug
Known issues
gotchaThe `pip install clvm-tools-rs` command installs Python bindings that provide a subset of the command-line tools available when installing via `cargo install clvm_tools_rs`. Specifically, `pip` provides `brun`, `run`, `opc`, and `opd` functionality through Python imports, but other Rust-specific CLI tools might not be exposed this way.
fix
If you require all Rust-based command-line tools, consider installing `clvm-tools-rs` via `cargo install clvm_tools_rs` from the source repository. For Python-centric development, `pip install` is sufficient, and the core `compile_clvm` function will be available.
affects: 0.4.0 and earlier
gotchaThere are several related packages: `clvm-tools` (older Python implementation), `clvm-tools-rs` (Rust port with Python bindings), and `clvm_rs` (the underlying Rust CLVM implementation). Ensure you are importing from `clvm_tools_rs` for the Rust-backed Python bindings, as `clvm-tools` is a distinct, older package and `clvm_rs` is the Rust crate name, not the Python package import path.
fix
Always use `from clvm_tools_rs import ...` for the Python bindings of the Rust port. Avoid `import clvm_tools` unless you specifically intend to use the legacy Python-only version.
affects: All versions
gotchaUsers on M1 Macs attempting to build `clvm-tools-rs` from source might encounter build issues. The underlying Rust project sometimes requires specific build flags for M1 architecture.
fix
If encountering build errors on M1 Macs, refer to the official `clvm-tools-rs` GitHub repository for specific build instructions, which may include using `cargo build --no-default-features`.
affects: Potentially all versions when building from source on M1 Macs.
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'clvm_tools_rs'
The `clvm_tools_rs` Python package is not installed in the active Python environment or is not correctly added to the Python path.
fix
Ensure you have the package installed using pip: `pip install clvm-tools-rs`
ERROR: Could not find a version that satisfies the requirement clvm-rs
This error occurs during installation when `pip` cannot find a pre-built wheel for `clvm-rs` (a core dependency) compatible with your operating system and Python version, or it fails to compile `clvm-rs` from source.
fix
Install the Rust toolchain (`curl https://sh.rustup.rs -sSf | sh`) and `maturin` (`pip install maturin`), then try installing again. If issues persist, refer to the official repository for platform-specific build instructions, especially for ARM-based systems like M1 Macs (`cargo build --no-default-features`).
error[E0308]: mismatched types
This is a generic Rust compilation error, usually encountered when building `clvm-tools-rs` from source (e.g., via `maturin develop` or `cargo build`), indicating that a value of an unexpected type was found in the Rust code.
fix
Ensure your Rust toolchain is up to date (`rustup update` and `rustup default stable`), clean your build artifacts (`cargo clean`), and then attempt to rebuild. If you have made modifications, ensure type compatibility. For specific platform issues (like M1 Macs), follow the instructions to build with `cargo build --no-default-features`.
Upgrade
Version history
0.4.0latest on PyPI · released Jul 31, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources
clvm-tools-rs — pip install clvm-tools-rs · libregistry