What is stable in 0.2.0¶
This page says which parts of ob-analytics you can build on, and which parts may still change. It sorts the public surface into three groups: promised, provisional and internal.
The rules¶
Before 1.0 the package keeps no aliases for old names. When a name changes, code that uses the old name stops working in that release. The changelog's "Moving from" section maps each old name to its new name.
- Promised. We do not plan to change it before 1.0. If it must change, the change comes in a minor release (0.3.0, not 0.2.1) and the changelog lists it.
- Provisional. It is public and documented, but it may change in any minor release while it settles. The changelog lists each change.
- Internal. It may change in any release, and the changelog may not list
it. A module or name that starts with
_is internal. So is a name that is not in its module's__all__, even when its name has no_.
A patch release (0.2.1, 0.2.2) changes nothing public. It fixes bugs and documentation only.
Promised¶
Data and files
- The four tables of a run (
events,trades,depth,depth_summary) and the other tables with a contract inob_analytics.schemas.TABLES: their column names, dtypes and units. The schema page lists them. - Prices are whole numbers of ticks and sizes whole numbers of lots. Every timestamp is tz-aware UTC, in nanoseconds.
- The Parquet folder that
save_datawrites, with its schema version (currently 4.0) and its key-value metadata.load_dataandload_resultkeep reading the folders an earlier 0.2 release wrote. - The capture folder that
ob-analytics capturewrites, with its format version (capture_formatinmeta.json). The readers keep reading every earlier version.
Functions and classes
- Public functions take and return pandas DataFrames.
PipelineResult.to_arrow()andPipelineResult.to_polars()are a convenience over the same tables, not a second supported frame type. Pipeline,PipelineConfigandPipelineResult, with their public methods.save_data,load_data,load_resultandlist_writers.- The analysis functions the package root exports, such as
order_book,vpin,kyle_lambda,trade_imbalance,bars,featuresandtransaction_costs, and the result types they return (BookSnapshot,VpinResult,KyleLambdaResult,CostSummary). - The rule for arguments: input tables are positional, and every setting
after them is keyword-only. A parameter is named
quoteswhen the function reads only the touch, anddepth_summarywhen it reads the depth bins too. display_resultandPipelineResult.display().plot,plot_result,PipelineResult.plotandavailable_concepts, the plot concept names, and the levels each concept is drawn at.ObAnalyticsErrorand its subclassesConfigErrorandUnknownNameError.- The names of the built-in sources (
bitstamp,lobster,databento,depth_csvand the others thatob-analytics sourceslists).
Command line
- The subcommands (
process,audit,gallery,capture,sourcesand the two demos) and the flags the CLI flag reference lists.
Provisional¶
ob_analytics.scan. New in 0.2. Its four functions may change as they are joined to the rest of the package, for example so that a plot or a metric can read a scanned table.- The
preparefunctions' arguments and payloads. Eachpreparefunction has the name of its plot concept, and that name is promised with the concept. Its arguments, and the keys and values of the payload it returns, may change as the plots change. A renderer of your own that reads a payload may need changes in a minor release. - The plug-in protocols.
Source,OfflineSource,LiveSource,EventLoader,DepthLoader,TradeReader,DataWriter,Metric,FeatureandBarRule, theregister_*functions, the plot backend registry, and the entry-point groups (ob_analytics.sources,ob_analytics.writers,ob_analytics.metrics,ob_analytics.features,ob_analytics.bar_rules,ob_analytics.plot_backends). A plug-in may need changes in a minor release. - The gallery.
generate_gallery,build_gallery_model,PlotSpec,GalleryModeland the*_cardfunctions. - The order-book engine (
ob_analytics.engine). - Live capture (
ob_analytics.live): the source and settings classes andrun_capture. The capture folder they write is promised (see above). - The backtester export (
ob_analytics.interop). It follows the formats of hftbacktest and NautilusTrader, which can change. - Themes and palettes (
PlotThemeand its fields).
Internal¶
- Every module and name that starts with
_. - Every name that is not in its module's
__all__. Some such names have no_, because another module of the package imports them. For example,ob_analytics.data.canonical_frameandob_analytics.data.saved_configare shared withob_analytics.scan. WindowedLoaderandLoadedWindowinob_analytics.protocols.Pipeline.run_windowsand the built-in loaders use them, but they are not yet a contract for a plug-in source.Pipeline.run_windowsitself is promised.
Before 1.0¶
1.0 comes when the provisional parts above are either promised or made
internal, and one minor release has gone by with no change to a promised name.
From 1.0 the package follows semantic versioning. A promised name that must go
then gives a DeprecationWarning for at least one minor release before it is
removed.