2  Installation

2.1 Quick Install

Install additory from PyPI using pip:

pip install additory

2.2 Requirements

2.2.1 Python Version

  • Python 3.9 or higher

2.2.2 Required Dependencies

  • polars >= 0.19.0 (required for internal operations)
  • pyarrow >= 10.0.0 (required for DataFrame conversions)

2.2.3 Optional Dependencies

  • pandas >= 1.5.0 (optional, for pandas DataFrame support)

2.3 Installation Options

2.3.1 Standard Installation

For Polars-only usage:

pip install additory

2.3.2 With Pandas Support

To use additory with pandas DataFrames:

pip install additory[pandas]

2.3.3 With All Optional Dependencies

pip install additory[all]

2.3.4 Development Installation

For development with testing tools:

pip install additory[dev]

2.4 Building from Source

If you want to build additory from source:

2.4.1 Prerequisites

  1. Rust - Install from https://rustup.rs/
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  1. Maturin - Python/Rust build tool
pip install maturin

2.4.2 Build Steps

# Clone the repository
git clone https://github.com/sekarkrishna/additory.git
cd additory

# Build the package
export PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1
maturin build --release

# Install locally
pip install target/wheels/*.whl

2.5 Verification

Verify your installation:

import additory as add
print(add.__version__)

Expected output:

0.1.3a10

2.6 Quick Test

Run a quick test to ensure everything works:

import additory as add
import polars as pl

# Test add.to()
df1 = pl.DataFrame({'id': [1, 2], 'value': [10, 20]})
df2 = pl.DataFrame({'id': [1, 2], 'name': ['A', 'B']})
result = add.to(df1, bring_from=df2, bring=['name'], against='id')
print("add.to() works:", result.shape)

# Test add.transform()
result = add.transform('@calc', df1, strategy={'doubled': 'value * 2'})
print("add.transform() works:", result.shape)

# Test add.synthetic()
result = add.synthetic('@new', n=10, strategy={'x': 'normal(0, 1)'})
print("add.synthetic() works:", result.shape)

# Test add.scan()
result = add.scan('@analyze', df1)
print("add.scan() works")

2.7 Troubleshooting

2.7.1 Python 3.13 Support

If you’re using Python 3.13, you may need to set an environment variable:

export PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1
pip install additory

2.7.2 Import Errors

If you encounter import errors:

  1. Ensure polars and pyarrow are installed:
pip install polars pyarrow
  1. For pandas support:
pip install pandas

2.7.3 Build Errors

If building from source fails:

  1. Ensure Rust is properly installed:
rustc --version
cargo --version
  1. Update maturin:
pip install --upgrade maturin
  1. Check for platform-specific issues in the GitHub Issues

2.8 Platform Support

Additory is tested on:

  • Linux (x86_64, aarch64)
  • macOS (x86_64, Apple Silicon)
  • Windows (x86_64)

2.9 Next Steps

Now that you have additory installed, explore the examples:

  • add.to() - Learn about data lookups and joins
  • add.transform() - Discover data transformation modes
  • add.synthetic() - Generate synthetic data
  • add.scan() - Analyze and inspect DataFrames