There are mainly 4 ways to interact with data in pfeed:
get_historical_data()
gets historical data from local storage (if exists) or remote data sources and returns a cleaned DataFrame/LazyFrame.
import pfeed as pe
feed = pe.BybitFeed(data_tool='pandas')
df = feed.get_historical_data('BTC_USDT_PERP', rollback_period='1w', resolution='1d')
download_historical_data()
ordownload()
loads the downloaded data into your local machine, local data lake MinIO, or the cloud.
pe.download('bybit', products=['BTC_USDT_PERP'], dtypes=['minute'], start_date='2024-01-01', end_date='2024-01-03', use_ray=True, use_minio=False)
- π§
get_realtime_data()
gets real-time data by calling the broker/exchangeβs API.
data: dict = feed.get_realtime_data(...)
- π§
stream_realtime_data()
orstream()
listens to real-time data via websocket and optionally stores it .
pe.stream(...)