Skip to content

Commit

Permalink
Merge 74a047a into 0fd8eef
Browse files Browse the repository at this point in the history
  • Loading branch information
mberk committed Jan 13, 2023
2 parents 0fd8eef + 74a047a commit 911fccf
Show file tree
Hide file tree
Showing 5 changed files with 940 additions and 137 deletions.
34 changes: 34 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
# Release History

# 0.5.0 - 2023-01-13

### Added

* Functions for working with RaceResult objects:
* get_bsp_from_race_result
* get_winners_from_race_result
* Functions for extracting BSP from different sources:
* get_bsp_from_market_definition
* get_bsp_from_prices_file
* Functions for working with marketTime:
* get_market_time_as_datetime
* get_seconds_to_market_time
* Functions for working with race files:
* create_combined_market_book_and_race_change_generator
* get_win_market_id_from_race_file
* Functions for extracting information from the order book:
* calculate_order_book_imbalance
* get_price_size_by_depth
* get_second_best_price_size
* get_second_best_price
* Functions for extracting market books and race changes at times of interest:
* get_market_books_from_prices_file
* get_minimum_book_percentage_market_books_from_prices_file
* get_race_change_from_race_file
* Other Functions:
* get_publish_time_from_object
* get_winners_from_market_definition

### Changed

* Improved patching of open
* Arguments to prices_file_to_data_frame have changed to permit adding any desired marketDefinition field to the data frame

# 0.4.0 - 2022-11-07

### Added
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,24 @@ folds = pd.cut(
)
```

## Extract Market Books of Interest

`betfairutil` contains functions for efficiently extracting market books at times of interest rather than having to read
the entire sequence of market books into memory. This example also illustrates some functionality the package provides
for working with the Betfair race stream. First, we work out the exact time when the race enters the final furlong.
Then, we extract the market book at this moment in time

```python
import betfairutil

race_change = betfairutil.get_race_change_from_race_file(path_to_race_file, gate_name="1f")
publish_time = race_change["pt"]
market_book = betfairutil.get_market_books_from_prices_file(
path_to_prices_file,
publish_times=[publish_time]
)[publish_time]
```

# See Also

* There is some inevitable overlap between this package and [flumine's](https://github.com/liampauling/flumine) own
Expand Down

0 comments on commit 911fccf

Please sign in to comment.