nautilus_adapters::databento::loader

Struct DatabentoDataLoader

source
pub struct DatabentoDataLoader { /* private fields */ }
Expand description

A Nautilus data loader for Databento Binary Encoding (DBN) format data.

§Supported schemas:

  • MBO -> OrderBookDelta
  • MBP_1 -> (QuoteTick, Option<TradeTick>)
  • MBP_10 -> OrderBookDepth10
  • TBBO -> (QuoteTick, TradeTick)
  • TRADES -> TradeTick
  • OHLCV_1S -> Bar
  • OHLCV_1M -> Bar
  • OHLCV_1H -> Bar
  • OHLCV_1D -> Bar
  • DEFINITION -> Instrument
  • IMBALANCE -> DatabentoImbalance
  • STATISTICS -> DatabentoStatistics
  • STATUS -> InstrumentStatus

§References

https://databento.com/docs/knowledge-base/new-users/dbn-encoding

Implementations§

source§

impl DatabentoDataLoader

source

pub fn new(path: Option<PathBuf>) -> Result<Self>

Creates a new DatabentoDataLoader instance.

source

pub fn load_publishers(&mut self, path: PathBuf) -> Result<()>

Load the publishers data from the file at the given path.

source

pub const fn get_publishers(&self) -> &IndexMap<u16, DatabentoPublisher>

Return the internal Databento publishers currently held by the loader.

source

pub fn get_dataset_for_venue(&self, venue: &Venue) -> Option<&Dataset>

source

pub fn get_venue_for_publisher( &self, publisher_id: PublisherId, ) -> Option<&Venue>

source

pub fn schema_from_file(&self, path: PathBuf) -> Result<Option<String>>

source

pub fn read_definition_records( &mut self, path: PathBuf, ) -> Result<impl Iterator<Item = Result<InstrumentAny>> + '_>

source

pub fn read_records<T>( &self, path: PathBuf, instrument_id: Option<InstrumentId>, include_trades: bool, ) -> Result<impl Iterator<Item = Result<(Option<Data>, Option<Data>)>> + '_>
where T: Record + HasRType + 'static,

source

pub fn read_status_records<T>( &self, path: PathBuf, instrument_id: Option<InstrumentId>, ) -> Result<impl Iterator<Item = Result<InstrumentStatus>> + '_>
where T: Record + HasRType + 'static,

source

pub fn read_imbalance_records<T>( &self, path: PathBuf, instrument_id: Option<InstrumentId>, ) -> Result<impl Iterator<Item = Result<DatabentoImbalance>> + '_>
where T: Record + HasRType + 'static,

source

pub fn read_statistics_records<T>( &self, path: PathBuf, instrument_id: Option<InstrumentId>, ) -> Result<impl Iterator<Item = Result<DatabentoStatistics>> + '_>
where T: Record + HasRType + 'static,

Trait Implementations§

source§

impl HasPyGilRef for DatabentoDataLoader

source§

type AsRefTarget = PyCell<DatabentoDataLoader>

Utility type to make Py::as_ref work.
source§

impl IntoPy<Py<PyAny>> for DatabentoDataLoader

source§

fn into_py(self, py: Python<'_>) -> PyObject

Performs the conversion.
source§

impl PyClass for DatabentoDataLoader

source§

type Frozen = False

Whether the pyclass is frozen. Read more
source§

impl PyClassImpl for DatabentoDataLoader

source§

const IS_BASETYPE: bool = false

#[pyclass(subclass)]
source§

const IS_SUBCLASS: bool = false

#[pyclass(extends=…)]
source§

const IS_MAPPING: bool = false

#[pyclass(mapping)]
source§

const IS_SEQUENCE: bool = false

#[pyclass(sequence)]
source§

type BaseType = PyAny

Base class
source§

type ThreadChecker = SendablePyClass<DatabentoDataLoader>

This handles following two situations: Read more
source§

type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild

Immutable or mutable
source§

type Dict = PyClassDummySlot

Specify this class has #[pyclass(dict)] or not.
source§

type WeakRef = PyClassDummySlot

Specify this class has #[pyclass(weakref)] or not.
source§

type BaseNativeType = PyAny

The closest native ancestor. This is PyAny by default, and when you declare #[pyclass(extends=PyDict)], it’s PyDict.
source§

fn items_iter() -> PyClassItemsIter

source§

fn doc(py: Python<'_>) -> PyResult<&'static CStr>

Rendered class doc
source§

fn lazy_type_object() -> &'static LazyTypeObject<Self>

§

fn dict_offset() -> Option<isize>

§

fn weaklist_offset() -> Option<isize>

source§

impl PyClassNewTextSignature<DatabentoDataLoader> for PyClassImplCollector<DatabentoDataLoader>

source§

fn new_text_signature(self) -> Option<&'static str>

source§

impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a DatabentoDataLoader

source§

type Holder = Option<PyRef<'py, DatabentoDataLoader>>

source§

fn extract( obj: &'a Bound<'py, PyAny>, holder: &'a mut Self::Holder, ) -> PyResult<Self>

source§

impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut DatabentoDataLoader

source§

type Holder = Option<PyRefMut<'py, DatabentoDataLoader>>

source§

fn extract( obj: &'a Bound<'py, PyAny>, holder: &'a mut Self::Holder, ) -> PyResult<Self>

source§

impl PyMethods<DatabentoDataLoader> for PyClassImplCollector<DatabentoDataLoader>

source§

fn py_methods(self) -> &'static PyClassItems

source§

impl PyTypeInfo for DatabentoDataLoader

source§

const NAME: &'static str = "DatabentoDataLoader"

Class name.
source§

const MODULE: Option<&'static str> = _

Module name, if any.
source§

fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject

Returns the PyTypeObject instance for this type.
§

fn type_object(py: Python<'_>) -> &PyType

👎Deprecated since 0.21.0: PyTypeInfo::type_object will be replaced by PyTypeInfo::type_object_bound in a future PyO3 version
Returns the safe abstraction over the type object.
§

fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>

Returns the safe abstraction over the type object.
§

fn is_type_of(object: &PyAny) -> bool

👎Deprecated since 0.21.0: PyTypeInfo::is_type_of will be replaced by PyTypeInfo::is_type_of_bound in a future PyO3 version
Checks if object is an instance of this type or a subclass of this type.
§

fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool

Checks if object is an instance of this type or a subclass of this type.
§

fn is_exact_type_of(object: &PyAny) -> bool

👎Deprecated since 0.21.0: PyTypeInfo::is_exact_type_of will be replaced by PyTypeInfo::is_exact_type_of_bound in a future PyO3 version
Checks if object is an instance of this type.
§

fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool

Checks if object is an instance of this type.
source§

impl DerefToPyAny for DatabentoDataLoader

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> PyErrArguments for T
where T: IntoPy<Py<PyAny>> + Send + Sync,

§

fn arguments(self, py: Python<'_>) -> Py<PyAny>

Arguments for exception
§

impl<T> PyTypeCheck for T
where T: PyTypeInfo,

§

const NAME: &'static str = <T as PyTypeInfo>::NAME

Name of self. This is used in error messages, for example.
§

fn type_check(object: &Bound<'_, PyAny>) -> bool

Checks if object is an instance of Self, which may include a subtype. Read more
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> Ungil for T
where T: Send,