CSVDatasetBlockDataStore
Documentation for eth_defi.event_reader.csv_block_data_store.CSVDatasetBlockDataStore Python class.
- class CSVDatasetBlockDataStore
Bases:
eth_defi.event_reader.block_data_store.BlockDataStoreStore block data as CSV file.
- Parameters
path – Path to the CSV file
Methods summary
__init__(path)- param path
floor_block_number_to_partition_start(n)Has this store any stored data.
load([since_block_number])Load data from CSV file
Return the last block number stored on the disk.
save(df[, since_block_number, ...])Save all data to CSV file.
save_incremental(df)Write all partitions we are missing from the data.
- __init__(path)
- Parameters
path (pathlib.Path) – Path to the CSV file
- is_virgin()
Has this store any stored data.
- Returns
There is data to load.
- Return type
- load(since_block_number=0)
Load data from CSV file
- Parameters
since_block_number (int) – Ignored
- Return type
- save(df, since_block_number=0, check_contains_all_blocks=True)
Save all data to CSV file.
- Parameters
since_block_number (int) – Ignored. Does not support incremental writing.
check_contains_all_blocks – Check that we have at least one data record for every block. Note that trades might not happen on every block.
df (pandas.DataFrame) –
- save_incremental(df)
Write all partitions we are missing from the data.
- Parameters
df (pandas.DataFrame) –
- Return type