semvec/pypi-packages huggingface dataset:
feature-synth 0.1.0
Python bindings for the Rust-based feature synthesizer
License: MIT
Requires Python: >=3.8
Keywords: data, mock, generation, polars, rust

# 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
django-hawk 1.2.5
Authenticate Django Views with HAWK
License: MIT
Requires Python: <4.0,>=3.8
Keywords: django

# Django Hawk

This package can be used to help create HAWK Authenticated views.

## Installation

```
pip install django-hawk
```

Add the following to your Django Settings:

```python
DJANGO_HAWK = {
    "HAWK_INCOMING_ACCESS_KEY": "xxx",
    "HAWK_INCOMING_SECRET_KEY": "xxx",
}
```

## Example Usage

To use the HAWK Authentication, we need to do 2 things:

1. Make sure the `HawkResponseMiddleware` runs
2. Check the authentication

Add the `HawkResponseMiddleware` to the `MIDDLEWARE` setting in your project like so:

```
MIDDLEWARE = [
    ...
    "django_hawk.middleware.HawkResponseMiddleware",
    ...
]
```

To check the authentication you can call `django_hawk.utils.authenticate_request`, if an exception isn't raised then you know that the request is authenticated, see below for examples.

```python
from django.http import HttpResponse

from django_hawk.utils import DjangoHawkAuthenticationFailed, authenticate_request

def simple_view(request):
    # Try to authenticate with HAWK
    try:
        authenticate_request(request=request)
    except DjangoHawkAuthenticationFailed as e:
        return HttpResponse(status=401)

    # Continue with normal View code...
    return HttpResponse("This is a simple view")
```

## Testing

Tests belong in the `/django_hawk/tests/` directory. You can run the tests by installing the requirements like so:

```
make setup
```

Now you can run the tests using the following command:

```
poetry run python manage.py test
```

### Tox tests

We use [tox](https://pypi.org/project/tox/) to test compatibility across different Django versions.

To run these tests with tox, just run the following:

```
make tox
```

## Pushing to PyPI

- [PyPI Package](https://pypi.org/project/django-hawk/)
- [Test PyPI Package](https://test.pypi.org/project/django-hawk/)

Running `make build-package` will build the package into the `dist/` directory.

Running `make push-pypi-test` will push the built package to Test PyPI.

Running `make push-pypi` will push the built package to PyPI.

### Setting up poetry for pushing to PyPI

First you will need to add the test pypy repository to your poetry config:

```
poetry config repositories.test-pypi https://test.pypi.org/legacy/
```

Then go to https://test.pypi.org/manage/account/token/ and generate a token.

Then add it to your poetry config:

```
poetry config pypi-token.test-pypi XXXXXXXX
```

Then you also need to go to https://pypi.org/manage/account/token/ to generate a token for the real PyPI.

Then add it to your poetry config:

```
poetry config pypi-token.pypi XXXXXXXX
```

Now the make commands should work as expected.