Conversion — API Reference
Store
DatabentoAPI.DBNStore — Type
DBNStore{T}(metadata, records::Vector{T})A bundle of decoded DBN data: the file's Metadata plus the parsed records. Returned by get_range. Iterates over records.
When the schema is type-pure (the common case), T is the concrete record struct (e.g. DBN.TradeMsg) and the records vector is type-stable. For mixed-record streams or when get_range is called with typed=false, T falls back to the DBN.DBNRecord Union.
Conversions
DatabentoAPI.to_dataframe — Function
to_dataframe(store)Convert a DBNStore to a DataFrame via DBN.jl's records_to_dataframe.
DatabentoAPI.to_csv — Function
to_csv(store, path)Write the records in store to a CSV file at path. Round-trips the records through a temporary DBN file because DBN.jl's CSV converter operates on file paths; for large stores prefer running DBN.dbn_to_csv directly on a captured .dbn[.zst] file from stream_to_file.
store = get_range(client; dataset = "XNAS.ITCH", schema = Schema.TRADES,
symbols = ["AAPL"], start = DateTime(2024,1,2,14,30),
end_ = DateTime(2024,1,2,14,31), stype_in = SType.RAW_SYMBOL)
to_csv(store, "trades.csv")DatabentoAPI.to_json — Function
to_json(store, path)Write the records in store to a newline-delimited JSON file at path. One record per line; same temp-DBN bounce as to_csv.
DatabentoAPI.to_parquet — Function
to_parquet(store, path)Write the records in store to a Parquet file at path. Same temp-DBN bounce as to_csv; the column schema comes from DBN.jl's dbn_to_parquet.
DatabentoAPI.to_file — Function
to_file(store, path)Write the store's records back out as a DBN file using DBN.jl's write_dbn. The output is compressed when path ends in .zst.