Skip to content

Commit

Permalink
DataBento -> Databento
Browse files Browse the repository at this point in the history
Only affects docs and comments

Signed-off-by: Evan Wies <[email protected]>
  • Loading branch information
neomantra committed Jan 14, 2025
1 parent 7d25577 commit 82afc65
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ release:

brews:
- homepage: https://github.com/NimbleMarkets/dbn-go
description: "Golang tooling for DataBento's APIs and DBN format"
description: "Golang tooling for Databento's APIs and DBN format"
directory: Formula
repository:
owner: NimbleMarkets
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<a href="https://github.com/NimbleMarkets/dbn-go/blob/main/CODE_OF_CONDUCT.md"><img src="https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg" alt="Code Of Conduct"></a>
</p>

**Golang tooling for DataBento's APIs and DBN format**
**Golang tooling for Databento's APIs and DBN format**

This repository contains Golang bindings to [Databento's](https://databento.com) file format [Databento Binary Encoding (DBN)](https://databento.com/docs/knowledge-base/new-users/dbn-encoding), [Historical API](#historical-api), and [Live API](#live-api). It also includes [tools](./cmd/README.md) to interact with these services.

Expand All @@ -33,7 +33,7 @@ import (
)
```

Most `dbn-go` [types](./structs.go) and [enums](./consts.go) parallel DataBento's libraries. Available messages types are:
Most `dbn-go` [types](./structs.go) and [enums](./consts.go) parallel Databento's libraries. Available messages types are:

* [`Mbp0Msg`](https://pkg.go.dev/github.com/NimbleMarkets/dbn-go#Mbp0Msg)
* [`MboMsg`](https://pkg.go.dev/github.com/NimbleMarkets/dbn-go#MboMsg)
Expand Down
26 changes: 13 additions & 13 deletions cmd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,32 @@ It includes:

```
$ dbn-go-hist --help
dbn-go-hist queries the DataBento Historical API.
dbn-go-hist queries the Databento Historical API.
Usage:
dbn-go-hist [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
cost Queries DataBento Hist for the cost and size of a GetRange query
dataset-condition Queries DataBento Hist for condition of a dataset
dataset-range Queries DataBento Hist for date range of a dataset
datasets Queries DataBento Hist for datasets and prints them
fields Queries DataBento Hist for fields of a schema/encoding and prints them
files Lists files for the given DataBento Hist JobID
cost Queries Databento Hist for the cost and size of a GetRange query
dataset-condition Queries Databento Hist for condition of a dataset
dataset-range Queries Databento Hist for date range of a dataset
datasets Queries Databento Hist for datasets and prints them
fields Queries Databento Hist for fields of a schema/encoding and prints them
files Lists files for the given Databento Hist JobID
get-range Download a range of data from the Hist API
help Help about any command
jobs Lists DataBento Hist jobs
publishers Queries DataBento Hist for publishers and prints them
jobs Lists Databento Hist jobs
publishers Queries Databento Hist for publishers and prints them
resolve Resolve symbols via the Databento Symbology API
schemas Queries DataBento Hist for publishers and prints them
schemas Queries Databento Hist for publishers and prints them
submit-job Submit a data request job to the Hist API
tui dbn-go-hist TUI
unit-prices Queries DataBento Hist for unit prices of a dataset
unit-prices Queries Databento Hist for unit prices of a dataset
Flags:
-h, --help help for dbn-go-hist
-k, --key string DataBento API key (or use DATABENT_API_KEY envvar)
-k, --key string Databento API key (or use DATABENT_API_KEY envvar)
Use "dbn-go-hist [command] --help" for more information about a command.
```
Expand All @@ -61,7 +61,7 @@ XNAS.ITCH

## `dbn-go-live`

`dbn-go-live` is a command-line tool to subscribe to a Live DataBento stream and write it to a file. It requires your [Databento API Key](https://databento.com/portal/keys) to be set with `--key` or preferably via the `DATABENTO_API_KEY` environment variable.
`dbn-go-live` is a command-line tool to subscribe to a Live Databento stream and write it to a file. It requires your [Databento API Key](https://databento.com/portal/keys) to be set with `--key` or preferably via the `DATABENTO_API_KEY` environment variable.

*CAUTION: This program incurs billing!*

Expand Down
26 changes: 13 additions & 13 deletions cmd/dbn-go-hist/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func main() {

cobra.OnInitialize()

rootCmd.PersistentFlags().StringVarP(&databentoApiKey, "key", "k", "", "DataBento API key (or use DATABENT_API_KEY envvar)")
rootCmd.PersistentFlags().StringVarP(&databentoApiKey, "key", "k", "", "Databento API key (or use DATABENT_API_KEY envvar)")

rootCmd.AddCommand(listDatasetsCmd)
listDatasetsCmd.Flags().VarP(&startYMD, "start", "t", "Start date as YYYYMMDD")
Expand Down Expand Up @@ -311,14 +311,14 @@ func main() {

var rootCmd = &cobra.Command{
Use: "dbn-go-hist",
Short: "dbn-go-hist queries the DataBento Historical API.",
Long: "dbn-go-hist queries the DataBento Historical API.",
Short: "dbn-go-hist queries the Databento Historical API.",
Long: "dbn-go-hist queries the Databento Historical API.",
}

var listDatasetsCmd = &cobra.Command{
Use: "datasets",
Aliases: []string{"d"},
Short: "Queries DataBento Hist for datasets and prints them",
Short: "Queries Databento Hist for datasets and prints them",
Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
apiKey := requireDatabentoApiKey()
Expand All @@ -340,7 +340,7 @@ var listDatasetsCmd = &cobra.Command{
var listPublishersCmd = &cobra.Command{
Use: "publishers",
Aliases: []string{"p"},
Short: "Queries DataBento Hist for publishers and prints them",
Short: "Queries Databento Hist for publishers and prints them",
Run: func(cmd *cobra.Command, args []string) {
apiKey := requireDatabentoApiKey()
publishers, err := dbn_hist.ListPublishers(apiKey)
Expand All @@ -364,7 +364,7 @@ var listPublishersCmd = &cobra.Command{
var listSchemasCmd = &cobra.Command{
Use: "schemas",
Aliases: []string{"s"},
Short: "Queries DataBento Hist for publishers and prints them",
Short: "Queries Databento Hist for publishers and prints them",
Run: func(cmd *cobra.Command, args []string) {
apiKey := requireDatabentoApiKey()
schemas, err := dbn_hist.ListSchemas(apiKey, dataset)
Expand All @@ -383,7 +383,7 @@ var listSchemasCmd = &cobra.Command{
var listFieldsCmd = &cobra.Command{
Use: "fields",
Aliases: []string{"f"},
Short: "Queries DataBento Hist for fields of a schema/encoding and prints them",
Short: "Queries Databento Hist for fields of a schema/encoding and prints them",
Run: func(cmd *cobra.Command, args []string) {
apiKey := requireDatabentoApiKey()
schema, err := dbn.SchemaFromString(schemaStr)
Expand All @@ -405,7 +405,7 @@ var listFieldsCmd = &cobra.Command{
var listUnitPricesCmd = &cobra.Command{
Use: "unit-prices",
Aliases: []string{"u", "up"},
Short: "Queries DataBento Hist for unit prices of a dataset",
Short: "Queries Databento Hist for unit prices of a dataset",
Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
apiKey := requireDatabentoApiKey()
Expand All @@ -428,7 +428,7 @@ var listUnitPricesCmd = &cobra.Command{
var getDatasetConditionCmd = &cobra.Command{
Use: "dataset-condition",
Aliases: []string{"dc"},
Short: "Queries DataBento Hist for condition of a dataset",
Short: "Queries Databento Hist for condition of a dataset",
Args: cobra.ArbitraryArgs,
Run: func(cmd *cobra.Command, args []string) {
apiKey := requireDatabentoApiKey()
Expand All @@ -448,7 +448,7 @@ var getDatasetConditionCmd = &cobra.Command{
var getDatasetRangeCmd = &cobra.Command{
Use: "dataset-range",
Aliases: []string{"dr"},
Short: "Queries DataBento Hist for date range of a dataset",
Short: "Queries Databento Hist for date range of a dataset",
Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
apiKey := requireDatabentoApiKey()
Expand All @@ -466,7 +466,7 @@ var getDatasetRangeCmd = &cobra.Command{
var getCostCmd = &cobra.Command{
Use: "cost",
Aliases: []string{"c"},
Short: "Queries DataBento Hist for the cost and size of a GetRange query",
Short: "Queries Databento Hist for the cost and size of a GetRange query",
Args: cobra.ArbitraryArgs,
Run: func(cmd *cobra.Command, args []string) {
apiKey := requireDatabentoApiKey()
Expand Down Expand Up @@ -497,7 +497,7 @@ var getCostCmd = &cobra.Command{
var listJobsCmd = &cobra.Command{
Use: "jobs",
Aliases: []string{"lj", "j"},
Short: "Lists DataBento Hist jobs",
Short: "Lists Databento Hist jobs",
Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
apiKey := requireDatabentoApiKey()
Expand All @@ -520,7 +520,7 @@ var listJobsCmd = &cobra.Command{
var listFilesCmd = &cobra.Command{
Use: "files",
Aliases: []string{"lf", "f"},
Short: "Lists files for the given DataBento Hist JobID",
Short: "Lists files for the given Databento Hist JobID",
Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
apiKey := requireDatabentoApiKey()
Expand Down
2 changes: 1 addition & 1 deletion cmd/dbn-go-live/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func main() {

if config.ApiKey == "" {
config.ApiKey = os.Getenv("DATABENTO_API_KEY")
requireValOrExit(config.ApiKey, "missing DataBento API key, use --key or set DATABENTO_API_KEY envvar\n")
requireValOrExit(config.ApiKey, "missing Databento API key, use --key or set DATABENTO_API_KEY envvar\n")
}

if len(config.Schemas) == 0 {
Expand Down
2 changes: 1 addition & 1 deletion cmd/dbn-go-tui/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func main() {
if config.DatabentoApiKey == "" {
config.DatabentoApiKey = os.Getenv("DATABENTO_API_KEY")
if config.DatabentoApiKey == "" {
fmt.Fprintf(os.Stderr, "missing DataBento API key, use --key or set DATABENTO_API_KEY envvar\n")
fmt.Fprintf(os.Stderr, "missing Databento API key, use --key or set DATABENTO_API_KEY envvar\n")
os.Exit(1)
}
}
Expand Down
2 changes: 1 addition & 1 deletion consts.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) 2024 Neomantra Corp
//
// Adapted from DataBento's DBN:
// Adapted from Databento's DBN:
// https://github.com/databento/dbn/blob/main/rust/dbn/src/enums.rs
//

Expand Down
2 changes: 1 addition & 1 deletion hist/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
dbn "github.com/NimbleMarkets/dbn-go"
)

// DataBento Batch API:
// Databento Batch API:
// https://databento.com/docs/api-reference-historical/batch/batch-list-files/returns?historical=http&live=python

///////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion hist/timeseries.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net/url"
)

// DataBento Time Series API:
// Databento Time Series API:
// https://databento.com/docs/api-reference-historical/timeseries/timeseries-get-range?historical=http&live=python

///////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion live/live.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ type LiveConfig struct {
}

// SetFromEnv fills in the LiveConfig from environment variables.
// `DATABENTO_API_KEY` holds the DataBento API key.
// `DATABENTO_API_KEY` holds the Databento API key.
// `DATABENTO_CLIENT` holds the Client name.
func (c *LiveConfig) SetFromEnv() error {
databentoApiKey := os.Getenv(DATABENTO_API_ENV_KEY)
Expand Down
20 changes: 10 additions & 10 deletions structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Schemas:
// https://databento.com/docs/knowledge-base/new-users/fields-by-schema/
//
// Adapted from DataBento's DBN:
// Adapted from Databento's DBN:
// https://github.com/databento/dbn/blob/194d9006155c684e172f71fd8e66ddeb6eae092e/rust/dbn/src/record.rs
//
// DBN encoding is little-endian.
Expand Down Expand Up @@ -72,7 +72,7 @@ func (rtype RType) IsCandle() bool {

///////////////////////////////////////////////////////////////////////////////

// DataBento Normalized Record Header
// Databento Normalized Record Header
// {"ts_event":"1704186000403918695","rtype":0,"publisher_id":2,"instrument_id":15144}
type RHeader struct {
Length uint8 `json:"len,omitempty"` // The length of the record in 32-bit words.
Expand Down Expand Up @@ -181,7 +181,7 @@ func (p *ConsolidatedBidAskPair) Fill_Json(val *fastjson.Value) error {

///////////////////////////////////////////////////////////////////////////////

// DataBento Normalized Mbp0 message (Market-by-order)
// Databento Normalized Mbp0 message (Market-by-order)
// {"ts_recv":"1704186000404085841","hd":{"ts_event":"1704186000403918695","rtype":0,"publisher_id":2,"instrument_id":15144},"action":"T","side":"B","depth":0,"price":"476370000000","size":40,"flags":130,"ts_in_delta":167146,"sequence":277449,"symbol":"SPY"}
type Mbp0Msg struct {
Header RHeader `json:"hd" csv:"hd"` // The record header.
Expand Down Expand Up @@ -243,7 +243,7 @@ func (r *Mbp0Msg) Fill_Json(val *fastjson.Value, header *RHeader) error {

///////////////////////////////////////////////////////////////////////////////

// DataBento Normalized market-by-order (MBO) tick message.
// Databento Normalized market-by-order (MBO) tick message.
// The record of the [`Mbo`](crate::enums::Schema::Mbo) schema.
type MboMsg struct {
Header RHeader `json:"hd" csv:"hd"` // The record header.
Expand Down Expand Up @@ -308,7 +308,7 @@ func (r *MboMsg) Fill_Json(val *fastjson.Value, header *RHeader) error {

///////////////////////////////////////////////////////////////////////////////

// DataBento Normalized market-by-price (MBP) implementation with a known book depth of 1. The record of the [`Mbp1`](crate::enums::Schema::Mbp1) schema.
// Databento Normalized market-by-price (MBP) implementation with a known book depth of 1. The record of the [`Mbp1`](crate::enums::Schema::Mbp1) schema.
type Mbp1Msg struct {
Header RHeader `json:"hd" csv:"hd"` // The record header.
Price int64 `json:"price" csv:"price"` // The order price expressed as a signed integer where every 1 unit corresponds to 1e-9, i.e. 1/1,000,000,000 or 0.000000001.
Expand Down Expand Up @@ -442,7 +442,7 @@ func (r *CbboMsg) Fill_Json(val *fastjson.Value, header *RHeader) error {

///////////////////////////////////////////////////////////////////////////////

// DataBento Normalized market-by-price implementation with a known book depth of 10. The record of the [`Mbp10`](crate::enums::Schema::Mbp10) schema.
// Databento Normalized market-by-price implementation with a known book depth of 10. The record of the [`Mbp10`](crate::enums::Schema::Mbp10) schema.
type Mbp10Msg struct {
Header RHeader `json:"hd" csv:"hd"` // The record header.
Price int64 `json:"price" csv:"price"` // The order price expressed as a signed integer where every 1 unit corresponds to 1e-9, i.e. 1/1,000,000,000 or 0.000000001.
Expand Down Expand Up @@ -515,7 +515,7 @@ func (r *Mbp10Msg) Fill_Json(val *fastjson.Value, header *RHeader) error {

///////////////////////////////////////////////////////////////////////////////

// DataBento Normalized Ohlcv Message (OHLC candlestick, bar)
// Databento Normalized Ohlcv Message (OHLC candlestick, bar)
// {"hd":{"ts_event":"1702987922000000000","rtype":32,"publisher_id":40,"instrument_id":15144},"open":"472600000000","high":"472600000000","low":"472600000000","close":"472600000000","volume":"300"}
type OhlcvMsg struct {
Header RHeader `json:"hd" csv:"hd"` // The record header.
Expand Down Expand Up @@ -566,7 +566,7 @@ func (r *OhlcvMsg) Fill_Json(val *fastjson.Value, header *RHeader) error {

///////////////////////////////////////////////////////////////////////////////

// DataBento Normalized Imbalance Message
// Databento Normalized Imbalance Message
// {"ts_recv":"1711027500000942123","hd":{"ts_event":"1711027500000776211","rtype":20,"publisher_id":2,"instrument_id":17598},"ref_price":"0","auction_time":"0","cont_book_clr_price":"0","auct_interest_clr_price":"0","ssr_filling_price":"0","ind_match_price":"0","upper_collar":"0","lower_collar":"0","paired_qty":0,"total_imbalance_qty":0,"market_imbalance_qty":0,"unpaired_qty":0,"auction_type":"O","side":"N","auction_status":0,"freeze_status":0,"num_extensions":0,"unpaired_side":"N","significant_imbalance":"~"}
type ImbalanceMsg struct {
Header RHeader `json:"hd" csv:"hd"` // The record header.
Expand Down Expand Up @@ -664,7 +664,7 @@ func (r *ImbalanceMsg) Fill_Json(val *fastjson.Value, header *RHeader) error {

///////////////////////////////////////////////////////////////////////////////

// DataBento Symbol Mapping Message
// Databento Symbol Mapping Message
// This is not a strict byte-layout because StypeInSymbol and StypeOutSymbol have dynamic lengths
// that depend on metadata's SymbolCstrLen.
type SymbolMappingMsg struct {
Expand Down Expand Up @@ -888,7 +888,7 @@ func (r *StatMsg) Fill_Json(val *fastjson.Value, header *RHeader) error {

///////////////////////////////////////////////////////////////////////////////

// DataBento normalized Trading Status Update message.
// Databento normalized Trading Status Update message.
type StatusMsg struct {
Header RHeader `json:"hd" csv:"hd"` // The record header.
TsRecv uint64 `json:"ts_recv" csv:"ts_recv"` // The capture-server-received timestamp expressed as number of nanoseconds since the UNIX epoch.
Expand Down
2 changes: 1 addition & 1 deletion tests/data/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# go-dbn test data

These test data files were taken from DataBento's test corpus:
These test data files were taken from Databento's test corpus:

* https://github.com/databento/dbn/tree/main/tests/data

Expand Down

0 comments on commit 82afc65

Please sign in to comment.