Skip to content

programmersd21/grinder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”₯ Grinder

Grinder is the Great Rust Binder β€” a savage CLI that automatically generates PyO3 bindings for any Rust crate (local or crates.io). Zero boilerplate. Zero pain. You get .pyi type hints and Python wheels like magic. πŸͺ„


πŸš€ Features

🧠 Automatically binds functions, structs, enums, constants β€” recursively

πŸ“¦ Works with local crates and crates.io crates

🧾 Generates .pyi files for full Python type hints

πŸ›ž Builds Python wheels (.whl) and can auto-install them

🧩 Default module name: py_ (customizable)

⏩ Forward compatibility enabled by default

πŸ€– Fully automated β€” no manual wrappers needed

πŸ“ Custom output folders for generated wheels


🧰 Installation

1️⃣ Build & install Grinder

After building with Hatch:

.\build.ps1

2️⃣ Install cargo-download (for online crates)

cargo install cargo-download


πŸ•ΉοΈ Usage

πŸ“‚ Local crate

grinder path/to/local/crate

Generates py_<crate_name>/ with a wheel

Generates <crate_name>.pyi in the crate root


🌐 Crate from crates.io

grinder regex -i

Downloads the crate from crates.io

Generates PyO3 bindings

Generates .pyi file

Builds a wheel

-i auto-installs the wheel πŸš€


βš™οΈ Options

Option Description

-i Auto-install the generated wheel --module-name Override default py_ module name -fc Enable forward compatibility (default) --out Specify output folder for wheel Local path or crate name


πŸ§ͺ Output Example

py_regex/ β”œβ”€β”€ init.py β”œβ”€β”€ regex.pyi └── py_regex-0.1.0-cp311-cp311-win_amd64.whl


🧠 Philosophy

Rust crate β†’ Python module

No glue code. No tears. Just Grinder doing unholy levels of automation. 😈


🧯 Warning

This tool is powerful. If your crate is cursed, Grinder will still bind it. Use responsibly.


πŸ”₯ Grind Rust. Ship Python. Repeat.

Releases

No releases published

Packages

 
 
 

Contributors