Skip to main content

Fast, minimal data utilities for trading: schemas, resampling, alignment, gaps, calendars.

Project description

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

pip install qf-data

Quick start

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

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

qf_data-0.1.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

qf_data-0.1.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file qf_data-0.1.0.tar.gz.

File metadata

  • Download URL: qf_data-0.1.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for qf_data-0.1.0.tar.gz
Algorithm Hash digest
SHA256 52a761e45715b5c353bf3a680151bf7d65582ea1de336e619a2381b81c6f1bbb
MD5 3c26fbe5392f902da0f0724e762b780f
BLAKE2b-256 b52586698b740c466eaad8ef337c9b63d0a7e1c11e22cb5a4ae17a69a6b1dca8

See more details on using hashes here.

File details

Details for the file qf_data-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: qf_data-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for qf_data-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 89a0e263618156fe8924b2d1e030dbfbcb2abb3b46ccfcb65d7bb239e304c6c0
MD5 0de48d73c5ad5bf1b05fd9036a3f3c22
BLAKE2b-256 2c3cfe2a6324495e823effe062f83ac2e9e2f2662e5dceee664ad345596ead2e

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