Metadata-Version: 2.4
Name: feature_synth
Version: 0.1.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Rust
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: polars>=1.31.0
Requires-Dist: pyarrow>=20.0.0
Summary: Python bindings for the Rust-based feature synthesizer
Keywords: data,mock,generation,polars,rust
Author-email: Dave Reed <david.reed.c@gmail.com>
License: MIT
Requires-Python: >=3.8
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

# Feature Synth

Python bindings for the Rust-based feature synthesizer from the Data Pilot project.

## Installation

```bash
pip install feature_synth
```

## Usage

```python
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](https://pyo3.rs/) and [maturin](https://github.com/PyO3/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:

   ```bash
   git clone https://github.com/dvreed77/feature-synth.git
   cd feature-synth
   ```

2. **Create a virtual environment** (recommended):

   ```bash
   python -m venv .venv
   source .venv/bin/activate
   ```

3. **Install dependencies & build the native extension**:

   ```bash
   pip install maturin
   maturin develop
   ```

4. **Test in Python**:

   ```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:

```bash
maturin develop
```

In your Python REPL, restart or use:

```python
import importlib
import feature_synth
importlib.reload(feature_synth)
```

---

## 🐍 Packaging & Publishing

To build a wheel:

```bash
maturin build
```

To publish to PyPI:

```bash
maturin publish --username __token__ --password pypi-<your-token>
```

---

## 🧪 Testing

You can test your Rust code as usual with:

```bash
cargo test
```

Or test Python usage by writing Python unit tests in a separate test script.

---

## 📄 License

MIT

