Skip to main content

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 with pip install maturin)
  • Optional: use virtualenv or pyenv for isolation

🔧 Setup for Local Development

  1. Clone the repo and enter the directory:

    git clone https://github.com/dvreed77/feature-synth.git
    cd feature-synth
    
  2. Create a virtual environment (recommended):

    python -m venv .venv
    source .venv/bin/activate
    
  3. Install dependencies & build the native extension:

    pip install maturin
    maturin develop
    
  4. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

feature_synth-0.1.0.tar.gz (34.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

feature_synth-0.1.0-cp312-cp312-macosx_11_0_arm64.whl (4.5 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

feature_synth-0.1.0-cp311-cp311-macosx_11_0_arm64.whl (4.5 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

feature_synth-0.1.0-cp310-cp310-macosx_11_0_arm64.whl (4.5 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

feature_synth-0.1.0-cp39-cp39-macosx_11_0_arm64.whl (4.5 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

feature_synth-0.1.0-cp38-cp38-macosx_11_0_arm64.whl (4.5 MB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

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

Hashes for feature_synth-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1b6655bf6999e12259411101a869847c443ce95148c6937060bf6b3aa72cff0c
MD5 6a924e2c8e20efb6bcef0a07656d8e2a
BLAKE2b-256 d1e8815c3739af64314a467ae3b571e871b6d901764908e57d080c0a6a68f7ce

See more details on using hashes here.

File details

Details for the file feature_synth-0.1.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for feature_synth-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cf816644e8bb4125bc8b513e93b1826b6714e0bd18debed0aaae9ee6803997ec
MD5 55f7a11300dd45850923dee619be88bb
BLAKE2b-256 9ab113e244d430a148ee169ab51d8f7b45c3d9450450affad96ec68e86643256

See more details on using hashes here.

File details

Details for the file feature_synth-0.1.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for feature_synth-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5b3c93b5cc1f46e3a8575b5fa851379f4640e20b4e16a09c7518d5c3eda35a74
MD5 67aca34454f093f46b8d6462929c8001
BLAKE2b-256 38183a95737490fd85c413f8837c09c59d266e239bf0c4b446180fd949eff930

See more details on using hashes here.

File details

Details for the file feature_synth-0.1.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for feature_synth-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cdad1a55a74f79c406f9d7789a0d41fef1b8f80d4404984c4ece82b5757aef9d
MD5 9b9b0eb264ec01646f1b8782e4ae3f71
BLAKE2b-256 04f8cee228c8d2d6f0ec6859394d6825ca932a6dd4f5c01eacde9799d6b7da81

See more details on using hashes here.

File details

Details for the file feature_synth-0.1.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for feature_synth-0.1.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b1064e9b05e52e719f7ae86033bada494e1f28c90d2d2d7ef367e67913a0006a
MD5 834609182b773198a815deba90234210
BLAKE2b-256 da036fc0205cbcb9d15d74de9f375d2eb9f8df7f365719eaf1c60b63844ab2bf

See more details on using hashes here.

File details

Details for the file feature_synth-0.1.0-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for feature_synth-0.1.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b3baec7b925c5cdc5058938cfbf86722efc1b1c9a1656fbc30179b4eee05d8b2
MD5 ea7ff4869ec051e438099ba7c207214a
BLAKE2b-256 082604c151418c2cc74aacd2a1efe2030acca22d3644afcbc65b29b93c51c4aa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page