Installation¶
Note
tarzi supports only Linux and macOS. Windows is not supported.
tarzi is available as both a Python package and a Rust crate, with optional CLI tools. Choose the installation method that best fits your use case.
Python Installation¶
PyPI (Recommended)¶
The easiest way to install tarzi for Python is via pip:
pip install tarzi
This will install the pre-compiled Python wheel with all necessary dependencies.
From Source¶
If you need to build from source or want the latest development version:
# Clone the repository
git clone https://github.com/mirasurf/tarzi.rs.git
cd tarzi.rs
# Install Rust if not already installed
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env
# Install maturin for building Python wheels
pip install maturin
# Build and install in development mode
maturin develop --release
Virtual Environment (Recommended)¶
It’s recommended to use a virtual environment:
# Using venv
python -m venv tarzi-env
source tarzi-env/bin/activate # On Windows: tarzi-env\Scripts\activate
pip install tarzi
# Using conda
conda create -n tarzi-env python=3.11
conda activate tarzi-env
pip install tarzi
Python Requirements¶
Python 3.10 or higher
Operating system: Linux, macOS
Optional dependencies for development:
# Install with development dependencies
pip install tarzi[dev]
# Install with test dependencies
pip install tarzi[test]
Rust Installation¶
As a Rust Crate¶
Add tarzi to your Cargo.toml:
[dependencies]
tarzi = "0.0.11"
tokio = { version = "1.0", features = ["full"] }
Or add it using cargo:
cargo add tarzi
CLI Installation¶
Install the command-line interface:
cargo install tarzi
This will install the tarzi binary to your cargo bin directory.
From Source¶
# Clone the repository
git clone https://github.com/mirasurf/tarzi.rs.git
cd tarzi.rs
# Build the project
cargo build --release
# Install the CLI (optional)
cargo install --path .
Rust Requirements¶
Rust 1.70 or higher
Cargo package manager
System Dependencies¶
Browser Dependencies (Optional)¶
For browser-based fetching, you’ll need a WebDriver:
Firefox (Recommended):
# Ubuntu/Debian
sudo apt-get install firefox
# Download GeckoDriver
wget https://github.com/mozilla/geckodriver/releases/latest/download/geckodriver-linux64.tar.gz
tar -xzf geckodriver-linux64.tar.gz
sudo mv geckodriver /usr/local/bin/
# Using Homebrew
brew install firefox
brew install geckodriver
Chrome/Chromium (Alternative):
# Ubuntu/Debian
sudo apt-get update
sudo apt-get install -y chromium-browser
# Download ChromeDriver
wget https://chromedriver.storage.googleapis.com/LATEST_RELEASE_114/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
sudo mv chromedriver /usr/local/bin/
# Using Homebrew
brew install chromium
brew install chromedriver
Verification¶
After installation, verify that tarzi is working correctly:
Python¶
import tarzi
print(tarzi.__version__)
# Test basic functionality
html = "<h1>Test</h1>"
result = tarzi.convert_html(html, "markdown")
print(result)
Rust¶
use tarzi::Converter;
#[tokio::main]
async fn main() {
let converter = Converter::new();
let html = "<h1>Test</h1>";
match converter.convert(html, tarzi::Format::Markdown).await {
Ok(result) => println!("{}", result),
Err(e) => eprintln!("Error: {}", e),
}
}
CLI¶
tarzi --version
tarzi convert --input "<h1>Test</h1>" --format markdown
Getting Help¶
If you encounter issues:
Search existing GitHub issues
Create a new issue with detailed error information
Join our community discussions
Next Steps¶
Now that you have tarzi installed, check out the Quick Start Guide guide to learn the basic usage patterns and start building your first application.