Skip to article frontmatterSkip to article content

Integration with Delta Lake

Please refer to Delta Lake if you don’t know what Delta Lake is.

import pfeed as pe

feed = pe.Bybit(use_deltalake=True)
# prepare data definition
product = 'BTC_USDT_PERP'
date = '2025-02-01'
resolution = '1tick'
to_storage = 'local'

Download dataΒΆ

feed.download(
    product,
    start_date=date,
    end_date=date,
    resolution=resolution,
    to_storage=to_storage,
)

Create storage object to get the file pathΒΆ

storage = feed.create_storage(to_storage, product, resolution, date)

Read the Delta TableΒΆ

from deltalake import DeltaTable

dt = DeltaTable(storage.file_path)
print(f"Version: {dt.version()}")
print(f"Files: {dt.files()}")
dt.history()