Skip to main content

The blazing-fast data toolkit for quantitative workflows

Project description

BlazeStore

🚀 blazestore —— The blazing-fast data toolkit for quantitative workflows 专注于本地量化数据的高效管理与读写,具备以下特点:

  • 极致本地性能:借助 polars(Rust 实现),大幅优于 pandas,单机内存/多核利用率高,I/O 高效,支持宽表大数据量(TB 级别)分析。
  • 分区与列式存储:自动按日期等分区,底层 Parquet 格式,适合全频段(tick/分钟/日线)数据。
  • 支持本地高效的数据读写、SQL 查询、分区管理,并方便与主流数据库(MySQL、ClickHouse)集成。
  • 内置任务调度与批量更新(DataUpdater),适合日常行情和因子数据自动维护。
  • 支持因子工程,便于复用、管理、批量计算和依赖关系控制,适合复杂因子体系的量化研究。

Installation

pip install -U blazestore

QuickStart

import blazestore as bs

# 获取配置
bs.get_settings()

# 假设有一个polars.DataFrame df, 内容为分钟频数据
kline_df = ... # date | time | asset | open | high | low | close | volume

# 持久化, 存放在表格 market_data/kline_minute, 按照日期分区
tb_name = "market_data/kline_minute"
bs.put(kline_df, tb_name=tb_name, partitions=["date", ],)
print((bs.DB_PATH/tb_name).exists()) # True

# read local data
query = f"select * from {tb_name} where date = '2025-05-06';"

read_df = bs.sql(query)

Examples

1.update data

import blazestore as bs
from blazestore import DataUpdater

# implement update function
def update_kline_daily():
    # 读取 clickhouse中的 行情数据落到本地
    query = ...
    kline_minute = bs.read_ck(query, db_conf="databases.ck")
    bs.put(kline_minute, tb_name="market_data/kline_minute", partitions=["date", ])

# create data updater
updater = DataUpdater(name="行情数据更新器")
updater.add_task(task_name="分钟行情", update_fn=update_kline_daily)
updater.do()

2.customize data

from blazestore import Factor

# 日频因子
def my_day_factor(date):
    """实现当天的因子计算逻辑"""
    ...
fac_myday = Factor(fn=my_day_factor)

# 分钟频因子, 增加形参 `end_time`
def my_minute_factor(date, end_time):
    """实现在end_time时的因子计算逻辑"""
    ...

fac_myminute = Factor(fn=my_minute_factor)

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

blazestore-0.1.3.tar.gz (26.0 kB view details)

Uploaded Source

Built Distribution

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

blazestore-0.1.3-py3-none-any.whl (30.3 kB view details)

Uploaded Python 3

File details

Details for the file blazestore-0.1.3.tar.gz.

File metadata

  • Download URL: blazestore-0.1.3.tar.gz
  • Upload date:
  • Size: 26.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.8

File hashes

Hashes for blazestore-0.1.3.tar.gz
Algorithm Hash digest
SHA256 44e51fa16630d2e0fe015184c606b6f5b5539a62f843e418a4e3949741cfe2f3
MD5 90f502605b5bf170c326346252fa2432
BLAKE2b-256 4dff13b4af7492f2822a9856a8c376538b510d1354e263c52539eb8284422699

See more details on using hashes here.

File details

Details for the file blazestore-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: blazestore-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 30.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.8

File hashes

Hashes for blazestore-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 49338cf3740954a6596663cbe418a331a344a57dd323c0d89797c84f861ce819
MD5 cbe5459e83662d4900daa80bc8e6d265
BLAKE2b-256 f36891864c8280caa6b4e7f9e2af8647bde56178187b963472772d31284dc9b8

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