Metadata-Version: 2.4
Name: qf-data
Version: 0.1.0
Summary: Fast, minimal data utilities for trading: schemas, resampling, alignment, gaps, calendars.
Author-email: Your Name <you@example.com>
License: MIT
Keywords: trading,quant,data,resample,market data,crypto,finance
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 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Office/Business :: Financial :: Investment
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.24
Requires-Dist: pyarrow>=15.0.0
Requires-Dist: python-dateutil>=2.8.2
Provides-Extra: pandas
Requires-Dist: pandas>=2.1; extra == "pandas"
Provides-Extra: test
Requires-Dist: pytest>=7.4; extra == "test"
Requires-Dist: hypothesis>=6.88; extra == "test"
Provides-Extra: dev
Requires-Dist: pytest>=7.4; extra == "dev"
Requires-Dist: hypothesis>=6.88; extra == "dev"
Requires-Dist: ruff>=0.6.9; extra == "dev"
Requires-Dist: mypy>=1.11; extra == "dev"
Dynamic: license-file

# qf-data

Fast, minimal data utilities for trading. Asset-agnostic, crypto-friendly.

## Features
- Canonical Arrow schemas for trades, quotes, bars.
- UTC nanosecond time utilities.
- Trades→bars resampling. Bars→higher TF.
- Alignment and as-of joins.
- Missing-data handling and quality flags.
- Optional adapters for Pandas/Polars.

## Install
```bash
pip install qf-data
```

## Quick start
```python
import numpy as np
from qf_data import step_from_str, trades_to_bars

ts = np.array([0, 500_000_000, 1_100_000_000], dtype=np.int64)  # ns
px = np.array([100.0, 101.0, 99.5])
sz = np.array([0.4, 0.1, 0.2])

step = step_from_str("1s")
bars = trades_to_bars(ts, px, sz, step, start_ns=0, end_ns=2_000_000_000)
print(bars.keys())  # dict of arrays
```

## Design
- Pure Python + NumPy/Arrow. No pandas in core.
- Pure functions. No global state. UTC only.
- 24/7 by default. Calendars are pluggable.

## License
MIT
