Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Integration with Ray

Ray runs your dataflows in parallel, e.g. downloading many products or a long date range at once.

pip install "pfeed[ray]"

Pass num_workers to the source, and each dataflow runs as a Ray task:

import pfeed as pe

bybit = pe.Bybit(pipeline_mode=True, num_workers=4)
feed = bybit.market_feed

for product in ["BTC_USDT_PERP", "ETH_USDT_PERP", "SOL_USDT_PERP"]:
    feed.download(
        product=product,
        resolution="1m",
        start_date="2026-01-01",
        end_date="2026-01-31",
        io=pe.ParquetIO(),
    )

result = feed.run()

Integration with Prefect

Prefect gives your dataflows a UI, logs and schedules. pfeed already handles correctness itself (e.g. retries of the source’s API), so Prefect is an optional ops layer on top.

pip install "pfeed[prefect]"

Run the feed with use_prefect=True, and each dataflow runs as a Prefect flow, with its extract, transform and load steps as tasks:

import pfeed as pe

feed = pe.Bybit(pipeline_mode=True).market_feed

result = (
    feed.download(
        product="BTC_USDT_PERP",
        resolution="1m",
        start_date="2026-01-01",
        end_date="2026-01-31",
        io=pe.ParquetIO(),
    ).run(use_prefect=True, retries=2)  # extra kwargs go to Prefect's @flow decorator
)