Skip to content

Commit 58080e0

Browse files
authored
VER: Release 0.9.1
2 parents 5a1b7ad + 15e7041 commit 58080e0

23 files changed

+350
-188
lines changed

.github/workflows/build.yaml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ name: build
44

55
on:
66
push:
7-
branches: [main, dev]
87

98
jobs:
109
ubuntu:
@@ -20,9 +19,20 @@ jobs:
2019
- name: Checkout repository
2120
uses: actions/checkout@v3
2221
- name: Install dependencies
22+
# pcre is a dependency of cppcheck
2323
run: |
2424
sudo apt-get update
25-
sudo apt-get install libzstd-dev ninja-build
25+
sudo apt-get install libpcre3 libpcre3-dev libzstd-dev ninja-build
26+
- name: Install cppcheck
27+
run: |
28+
git clone https://github.com/danmar/cppcheck.git
29+
cd cppcheck
30+
cmake -S. -B build \
31+
-DCMAKE_BUILD_TYPE=Release \
32+
-DUSE_MATCHCOMPILER=1 \
33+
-DHAVE_RULES=1
34+
cmake --build build --config Release
35+
sudo cmake --install build --prefix /usr
2636
- name: Install gtest
2737
uses: MarkusJx/googletest-installer@v1.1
2838
- name: CMake configure
@@ -33,6 +43,7 @@ jobs:
3343
-DDATABENTO_ENABLE_UNIT_TESTING=1 \
3444
-DDATABENTO_ENABLE_EXAMPLES=1 \
3545
-DDATABENTO_ENABLE_CLANG_TIDY=1 \
46+
-DDATABENTO_ENABLE_CPPCHECK=1 \
3647
-DDATABENTO_ENABLE_ASAN=1 \
3748
-DDATABENTO_ENABLE_UBSAN=1
3849
- name: CMake build
@@ -48,16 +59,16 @@ jobs:
4859
- name: Checkout repository
4960
uses: actions/checkout@v3
5061
- name: Install dependencies
51-
run: brew install cmake googletest openssl@3 ninja zstd
62+
run: brew install cmake cppcheck googletest openssl@3 ninja zstd
5263
# Don't enable clang-tidy on macOS because it's incredibly slow
5364
- name: CMake configure
5465
run: |
5566
cmake -S . -B build \
5667
-GNinja \
5768
-DDATABENTO_ENABLE_UNIT_TESTING=1 \
5869
-DDATABENTO_ENABLE_EXAMPLES=1 \
59-
-DDATABENTO_ENABLE_ASAN=1 \
60-
-DDATABENTO_ENABLE_UBSAN=1 \
70+
-DDATABENTO_ENABLE_CPPCHECK=1 \
71+
-DDATABENTO_ENABLE_TSAN=1 \
6172
-DOPENSSL_ROOT_DIR=$(brew --prefix openssl@3)
6273
- name: CMake build
6374
run: cmake --build build

.github/workflows/release.yaml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,17 @@ jobs:
3232
- name: Set output
3333
id: vars
3434
run: |
35-
echo "name=tag_name::v$(scripts/get_version.sh)" >> $GITHUB_OUTPUT
36-
echo "name=release_name::$(scripts/get_version.sh)" >> $GITHUB_OUTPUT
35+
echo "TAG_NAME=v$(scripts/get_version.sh)" >> $GITHUB_ENV
36+
echo "RELEASE_NAME=$(scripts/get_version.sh)" >> $GITHUB_ENV
37+
echo "## Release notes" > NOTES.md
38+
sed -n '/^## /{n; :a; /^## /q; p; n; ba}' CHANGELOG.md >> NOTES.md
3739
3840
# Create GitHub release
3941
- name: Create release
4042
id: create-release
41-
uses: actions/create-release@v1
42-
env:
43-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44-
TAG_NAME: ${{ steps.vars.outputs.tag_name }}
45-
RELEASE_NAME: ${{ steps.vars.outputs.release_name }}
43+
uses: softprops/action-gh-release@v1
4644
with:
45+
name: ${{ env.RELEASE_NAME }}
4746
tag_name: ${{ env.TAG_NAME }}
48-
release_name: ${{ env.RELEASE_NAME }}
49-
draft: false
50-
prerelease: false
47+
append_body: true
48+
body_path: ./NOTES.md

CHANGELOG.md

Lines changed: 83 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,158 @@
11
# Changelog
22

3+
## 0.9.1 - 2023-07-11
4+
5+
#### Enhancements
6+
- Added constants for dataset codes for Databento Equity Basic and OPRA Pillar
7+
- Added `const char*` getters to records for fixed-length `char` arrays
8+
- Added `RType` getter to `Record`
9+
10+
#### Bug fixes
11+
- Batch live subscriptions to avoid hitting max message length
12+
- Fix bug in Zstd decompression
13+
- Fix `Historical::BatchDownload` truncating file before writing each chunk
14+
315
## 0.9.0 - 2023-06-13
16+
17+
#### Enhancements
418
- Added `Reconnect` methods to `LiveBlocking` and `LiveThreaded`
519
- Added optional `exception_callback` argument to `LiveThreaded::Start` to improve
620
error handling options
721
- Added batch download support data files (`condition.json` and `symbology.json`)
822
- Added support for logging warnings from Historical API
23+
- Relaxed 10 minute minimum request time range restriction
24+
25+
#### Breaking changes
926
- Changed `use_ts_out` default to `false`
27+
28+
#### Bug fixes
1029
- Fixed missing definition for `operator==` for `ImbalanceMsg`
11-
- Removed 10 minute minimum request time range restriction
1230

1331
## 0.8.0 - 2023-05-16
32+
33+
#### Enhancements
1434
- Changed `end` and `end_date` to optional to support new forward-fill behaviour
35+
36+
#### Breaking changes
1537
- Renamed `booklevel` MBP field to `levels` for brevity and consistent naming
1638
- Removed `open_interest_qty` and `cleared_volume` fields from definitions schema
1739
that were always unset
1840

1941
## 0.7.0 - 2023-04-28
42+
43+
#### Enhancements
2044
- Added initial support for live data with `LiveBlocking` and `LiveThreaded` clients
2145
- Added support for statistics schema
2246
- Added `SystemMsg` and `ErrorMsg` records for use in live data
2347
- Added `strike_price`, `strike_price_currency`, and `instrument_class` to `InstrumentDefMsg`
24-
- Renamed `BatchJob.cost` to `cost_usd` and value now expressed as US dollars
2548
- Added `FixedPx` helper class for formatting fixed prices
2649
- Added configurable log receiver `ILogReceiver`
2750
- Added `instrument_class`, `strike_price`, and `strike_price_currency` to definition schema
2851
- Added additional `condition` variants for `DatasetConditionDetail` (degraded, pending, missing)
2952
- Added additional member `last_modified_date` to `DatasetConditionDetail` Added `has_mixed_schema`, `has_mixed_stype_in`, and `ts_out` to `Metadata` to support live data
53+
- Added optional `compression` parameter to `BatchSubmitJob`
54+
55+
#### Breaking changes
3056
- Removed `related` and `related_security_id` from `InstrumentDefMsg`
57+
- Renamed `BatchJob.cost` to `cost_usd` and value now expressed as US dollars
3158
- Renamed `SType::ProductId` to `SType::InstrumentId` and `SType::Native` to `SType::RawSymbol`
3259
- Renamed `RecordHeader::product_id` to `instrument_id`
3360
- Renamed `InstrumentDefMsg::symbol` to `raw_symbol`
3461
- Renamed `SymbolMapping::native_symbol` to `raw_symbol`
35-
- Deprecated `SType::Smart` to split into `SType::Parent` and `SType::Continuous`
3662
- Changed `expiration` and `action` type to `UnixNanos`
3763
- Changed some fields to enums in `InstrumentDefMsg`
38-
- Added optional `compression` parameter to `BatchSubmitJob`
64+
65+
#### Deprecations
66+
- Deprecated `SType::Smart` to split into `SType::Parent` and `SType::Continuous`
67+
68+
#### Bug fixes
3969
- Fixed parsing of `BatchSubmitJob` response
4070
- Fixed invalid read in `DbnDecoder`
4171
- Fixed memory leak in `TryCreateDir`
4272

4373
## 0.6.1 - 2023-03-28
44-
- Fixed Zstd decoding of files with multiple frames
74+
75+
#### Breaking changes
4576
- Removed usage of unreliable `std::ifstream::readsome`
4677

78+
#### Bug fixes
79+
- Fixed Zstd decoding of files with multiple frames
80+
4781
## 0.6.0 - 2023-03-24
82+
83+
#### Enhancements
4884
- Added support for imbalance schema
4985
- Added support for decoding `ts_out` field
86+
- Added flags `kSnapshot` and `kMaybeBadBook`
87+
88+
#### Breaking changes
5089
- Removed `record_count` from `Metadata`
5190
- Changed `Historical::BatchDownload` to return the paths of the downloaded files
52-
- Added flags `kSnapshot` and `kMaybeBadBook`
5391

5492
## 0.5.0 - 2023-03-13
93+
94+
#### Enhancements
5595
- Added `Historical::MetadataGetDatasetRange`
96+
97+
#### Breaking changes
5698
- Changed `MetadataGetDatasetCondition` to return `vector<DatasetConditionDetail>`
5799
- Removed `MetadataListCompressions` (redundant with docs)
58100
- Removed `MetadataListEncodings` (redundant with docs)
59101
- Removed optional `start` and `end` params from `MetadataListSchemas` (redundant)
60102
- Renamed `FileBento` to `DbnFileStore`
61103

62104
## 0.4.0 - 2023-03-02
63-
- Renamed DBZ to DBN
64-
- Renamed `DbzParser` to `DbnDecoder`
65-
- Renamed `TimeseriesStream` to `TimeseriesGetRange`
66-
- Refactored rtypes
67-
- Introduced separate rtypes for each OHLCV schema
105+
106+
#### Enhancements
107+
68108
- Added live gateway resolution
69109
- Added `SymbolMappingMsg` and `ErrorMsg` records
70-
- Improved API for `flags` record fields
71110
- Added `Action` and `Side` enums
72-
- Changed `kAllSymbols` representation
73-
- Fixed usage of as a system library
74-
- Removed `is_full_universe` and `is_example` fields from `BatchJob`
75-
- Disabled unit testing by default
76-
- Added `PKGBUILD` to demonstrate installation
77-
- Made `start_date` and `end_date` optional for
78-
`Historical::MetadataGetDatasetCondition`
79111
- Added `available_start_date` and `available_end_date` to
80112
`DatasetConditionInfo`
113+
- Made `start_date` and `end_date` optional for
114+
`Historical::MetadataGetDatasetCondition`
115+
- Improved API for `flags` record fields
116+
- Added `PKGBUILD` to demonstrate installation
117+
- Disabled unit testing by default
118+
119+
#### Breaking changes
120+
- Removed `is_full_universe` and `is_example` fields from `BatchJob`
121+
- Refactored rtypes
122+
- Introduced separate rtypes for each OHLCV schema
123+
- Renamed DBZ to DBN
124+
- Renamed `DbzParser` to `DbnDecoder`
125+
- Renamed `TimeseriesStream` to `TimeseriesGetRange`
126+
- Changed `kAllSymbols` representation
127+
128+
#### Bug fixes
129+
- Fixed usage of as a system library
81130

82131
## 0.3.0 - 2023-01-06
132+
133+
#### Enhancements
83134
- Added support for definition schema
84-
- Fixed cancellation in `Historical::TimeseriesStream`
85-
- Fixed race condition in `Historical::TimeseriesStream` exception handling
86-
- Fixed gtest linker error on macOS
87135
- Added option for CMake to download gtest
88-
- Renamed `TickMsg` to `MboMsg`
89-
- Changed `flags` fields to unsigned
90136
- Updated `Flag` enum
137+
138+
#### Breaking changes
91139
- Standardized getter method names to pascal case
92140
- Renamed `is_full_book` to `is_full_universe`
141+
- Renamed `TickMsg` to `MboMsg`
142+
- Changed `flags` fields to unsigned
143+
144+
#### Bug fixes
145+
- Fixed cancellation in `Historical::TimeseriesStream`
146+
- Fixed race condition in `Historical::TimeseriesStream` exception handling
147+
- Fixed gtest linker error on macOS
93148

94149
## 0.2.0 - 2022-12-01
150+
151+
#### Enhancements
95152
- Added `Historical::MetadataGetDatasetCondition`
96153
- Improved Zstd CMake integration
154+
155+
#### Bug fixes
97156
- Fixed requesting all symbols for a dataset
98157

99158
## 0.1.0 - 2022-11-07

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.14)
44
# Project details
55
#
66

7-
project("databento" VERSION 0.9.0 LANGUAGES CXX)
7+
project("databento" VERSION 0.9.1 LANGUAGES CXX)
88
string(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPERCASE)
99

1010
#
@@ -135,6 +135,8 @@ else()
135135
)
136136
endif()
137137
FetchContent_MakeAvailable(json)
138+
# Ignore compiler warnings in headers
139+
add_system_include_property(nlohmann_json)
138140
endif()
139141
# cpp-httplib
140142
set(httplib_version 0.11.4)

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![test](https://github.com/databento/databento-cpp/actions/workflows/build.yaml/badge.svg?branch=main)](https://github.com/databento/databento-cpp/actions/workflows/build.yaml)
44
[![license](https://img.shields.io/github/license/databento/databento-cpp?color=blue)](./LICENSE)
5+
[![Slack](https://img.shields.io/badge/join_Slack-community-darkblue.svg?logo=slack)](https://join.slack.com/t/databento-hq/shared_invite/zt-1xk498wxs-9fUs_xhz5ypaGD~mhI_hVQ)
56

67
The official C++ client library for [Databento](https://databento.com).
78
The client supports both streaming real-time and historical market data through similar interfaces.

cmake/StaticAnalyzers.cmake

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,13 @@ if(${PROJECT_NAME_UPPERCASE}_ENABLE_CPPCHECK)
1717
set(
1818
CMAKE_CXX_CPPCHECK ${CPPCHECK}
1919
--enable=all
20-
--suppress=missingIncludeSystem
20+
--suppress=missingIncludeSystem # False positives
2121
--suppress=preprocessorErrorDirective
22-
--suppress=unusedFunction
23-
--suppress=unmatchedSuppression
22+
--suppress=unusedFunction # False positives
23+
--suppress=unmatchedSuppression # Support different cppcheck versions
2424
--inline-suppr
2525
--relative-paths=${CMAKE_SOURCE_DIR}
2626
--quiet
27-
-I${CMAKE_SOURCE_DIR}/include
28-
-I${CMAKE_SOURCE_DIR}/src
29-
# Ignore tests
30-
-i${CMAKE_SOURCE_DIR}/test
31-
# Ignore third-party dependencies
32-
-i${CMAKE_BINARY_DIR}
3327
)
3428
message(STATUS "Cppcheck finished setting up.")
3529
else()

include/databento/constants.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@ static constexpr auto kUndefOrderSize =
1818
// This is not necessarily a comprehensive list of available datasets. Please
1919
// use `Historical.MetadataListDatasets` to retrieve an up-to-date list.
2020
namespace dataset {
21+
// The dataset code for Databento Equity Basic.
22+
static constexpr auto kDbeqBasic = "DBEQ.BASIC";
23+
// The dataset code for CME Globex MDP 3.0.
2124
static constexpr auto kGlbxMdp3 = "GLBX.MDP3";
25+
// The dataset code for OPRA.PILLAR.
26+
static constexpr auto kOpraPillar = "OPRA.PILLAR";
27+
// The dataset code for Nasdaq TotalView ITCH.
2228
static constexpr auto kXnasItch = "XNAS.ITCH";
2329
} // namespace dataset
2430
} // namespace databento

include/databento/historical.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ class Historical {
237237
using HttplibParams = std::multimap<std::string, std::string>;
238238

239239
BatchJob BatchSubmitJob(const HttplibParams& params);
240+
void StreamToFile(const std::string& url_path, const HttplibParams& params,
241+
const std::string& file_path);
240242
void DownloadFile(const std::string& url, const std::string& output_path);
241243
std::vector<BatchJob> BatchListJobs(const HttplibParams& params);
242244
std::vector<DatasetConditionDetail> MetadataGetDatasetCondition(

include/databento/record.hpp

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class Record {
3636
explicit Record(RecordHeader* record) : record_{record} {}
3737

3838
const RecordHeader& Header() const { return *record_; }
39+
::databento::RType RType() const { return record_->rtype; }
3940

4041
template <typename T>
4142
bool Holds() const {
@@ -53,7 +54,7 @@ class Record {
5354

5455
std::size_t Size() const;
5556
static std::size_t SizeOfSchema(Schema schema);
56-
static RType RTypeFromSchema(Schema schema);
57+
static ::databento::RType RTypeFromSchema(Schema schema);
5758

5859
private:
5960
RecordHeader* record_;
@@ -168,6 +169,21 @@ static_assert(sizeof(OhlcvMsg) == 56, "OhlcvMsg size must match C");
168169
struct InstrumentDefMsg {
169170
static bool HasRType(RType rtype) { return rtype == RType::InstrumentDef; }
170171

172+
const char* Currency() const { return currency.data(); }
173+
const char* SettlCurrency() const { return settl_currency.data(); }
174+
const char* SecSubType() const { return secsubtype.data(); }
175+
const char* RawSymbol() const { return raw_symbol.data(); }
176+
const char* Group() const { return group.data(); }
177+
const char* Exchange() const { return exchange.data(); }
178+
const char* Asset() const { return asset.data(); }
179+
const char* Cfi() const { return cfi.data(); }
180+
const char* SecurityType() const { return security_type.data(); }
181+
const char* UnitOfMeasure() const { return unit_of_measure.data(); }
182+
const char* Underlying() const { return underlying.data(); }
183+
const char* StrikePriceCurrency() const {
184+
return strike_price_currency.data();
185+
}
186+
171187
RecordHeader hd;
172188
UnixNanos ts_recv;
173189
std::int64_t min_price_increment;
@@ -308,6 +324,9 @@ struct ErrorMsg {
308324
struct SymbolMappingMsg {
309325
static bool HasRType(RType rtype) { return rtype == RType::SymbolMapping; }
310326

327+
const char* STypeInSymbol() const { return stype_in_symbol.data(); }
328+
const char* STypeOutSymbol() const { return stype_out_symbol.data(); }
329+
311330
RecordHeader hd;
312331
std::array<char, 22> stype_in_symbol;
313332
std::array<char, 22> stype_out_symbol;

0 commit comments

Comments
 (0)