Python bindings for the Rust-based feature synthesizer
Project description
Feature Synth
Python bindings for the Rust-based feature synthesizer from the Data Pilot project.
Installation
pip install feature_synth
Usage
from feature_synth import PyColumnSchema, PyDataType, PyLogicalType, make_custom_df
# Define schema
schema = [
PyColumnSchema(
id="0",
name="age",
dtype=PyDataType.Int32,
logical_type=PyLogicalType.Number
),
PyColumnSchema(
id="1",
name="active",
dtype=PyDataType.Boolean,
logical_type=PyLogicalType.Boolean
),
]
# Generate DataFrame
df = make_custom_df(schema, rows=100)
print(df)
Features
- Type-safe data generation with Rust performance
- Polars integration for efficient data manipulation
- Full type hints for IDE support
- Multiple data types including numbers, booleans, dates, strings
- Logical types for semantic data generation
This package uses PyO3 and maturin to expose Rust code to Python via a native extension.
🚀 Quick Start (Developers)
🧱 Prerequisites
- Python 3.8+
- Rust toolchain (
cargo,rustc, etc.) maturin(install withpip install maturin)- Optional: use
virtualenvorpyenvfor isolation
🔧 Setup for Local Development
-
Clone the repo and enter the directory:
git clone https://github.com/dvreed77/feature-synth.git cd feature-synth
-
Create a virtual environment (recommended):
python -m venv .venv source .venv/bin/activate
-
Install dependencies & build the native extension:
pip install maturin maturin develop
-
Test in Python:
import feature_synth print(feature_synth.add(2, 3)) # should output 5
🛠 Project Structure
feature_synth/
├── Cargo.toml # Rust crate configuration
├── pyproject.toml # Python metadata (PEP 621)
├── src/
│ └── lib.rs # Rust code exposed to Python
└── README.md # You are here
🔄 Rebuilding after Rust Code Changes
Just re-run:
maturin develop
In your Python REPL, restart or use:
import importlib
import feature_synth
importlib.reload(feature_synth)
🐍 Packaging & Publishing
To build a wheel:
maturin build
To publish to PyPI:
maturin publish --username __token__ --password pypi-<your-token>
🧪 Testing
You can test your Rust code as usual with:
cargo test
Or test Python usage by writing Python unit tests in a separate test script.
📄 License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file feature_synth-0.1.0.tar.gz.
File metadata
- Download URL: feature_synth-0.1.0.tar.gz
- Upload date:
- Size: 34.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b6655bf6999e12259411101a869847c443ce95148c6937060bf6b3aa72cff0c
|
|
| MD5 |
6a924e2c8e20efb6bcef0a07656d8e2a
|
|
| BLAKE2b-256 |
d1e8815c3739af64314a467ae3b571e871b6d901764908e57d080c0a6a68f7ce
|
File details
Details for the file feature_synth-0.1.0-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: feature_synth-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 4.5 MB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf816644e8bb4125bc8b513e93b1826b6714e0bd18debed0aaae9ee6803997ec
|
|
| MD5 |
55f7a11300dd45850923dee619be88bb
|
|
| BLAKE2b-256 |
9ab113e244d430a148ee169ab51d8f7b45c3d9450450affad96ec68e86643256
|
File details
Details for the file feature_synth-0.1.0-cp311-cp311-macosx_11_0_arm64.whl.
File metadata
- Download URL: feature_synth-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 4.5 MB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b3c93b5cc1f46e3a8575b5fa851379f4640e20b4e16a09c7518d5c3eda35a74
|
|
| MD5 |
67aca34454f093f46b8d6462929c8001
|
|
| BLAKE2b-256 |
38183a95737490fd85c413f8837c09c59d266e239bf0c4b446180fd949eff930
|
File details
Details for the file feature_synth-0.1.0-cp310-cp310-macosx_11_0_arm64.whl.
File metadata
- Download URL: feature_synth-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 4.5 MB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cdad1a55a74f79c406f9d7789a0d41fef1b8f80d4404984c4ece82b5757aef9d
|
|
| MD5 |
9b9b0eb264ec01646f1b8782e4ae3f71
|
|
| BLAKE2b-256 |
04f8cee228c8d2d6f0ec6859394d6825ca932a6dd4f5c01eacde9799d6b7da81
|
File details
Details for the file feature_synth-0.1.0-cp39-cp39-macosx_11_0_arm64.whl.
File metadata
- Download URL: feature_synth-0.1.0-cp39-cp39-macosx_11_0_arm64.whl
- Upload date:
- Size: 4.5 MB
- Tags: CPython 3.9, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1064e9b05e52e719f7ae86033bada494e1f28c90d2d2d7ef367e67913a0006a
|
|
| MD5 |
834609182b773198a815deba90234210
|
|
| BLAKE2b-256 |
da036fc0205cbcb9d15d74de9f375d2eb9f8df7f365719eaf1c60b63844ab2bf
|
File details
Details for the file feature_synth-0.1.0-cp38-cp38-macosx_11_0_arm64.whl.
File metadata
- Download URL: feature_synth-0.1.0-cp38-cp38-macosx_11_0_arm64.whl
- Upload date:
- Size: 4.5 MB
- Tags: CPython 3.8, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3baec7b925c5cdc5058938cfbf86722efc1b1c9a1656fbc30179b4eee05d8b2
|
|
| MD5 |
ea7ff4869ec051e438099ba7c207214a
|
|
| BLAKE2b-256 |
082604c151418c2cc74aacd2a1efe2030acca22d3644afcbc65b29b93c51c4aa
|