Skip to content

Commit

Permalink
Merge b10cf47 into 5c9d982
Browse files Browse the repository at this point in the history
  • Loading branch information
mberk committed Jun 6, 2023
2 parents 5c9d982 + b10cf47 commit 7b27cba
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
10 changes: 10 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
# Release History

# 0.6.1 - 2023-06-06

### Changed

* Handle None in publish_time_to_datetime

# 0.6.0 - 2023-05-31

### Added

* Order book related functions:
* calculate_available_volume (@jorgegarcia7)
* get_mid_price
* Prices files related functions:
* get_inplay_publish_time_from_prices_file
* get_last_pre_event_market_book_from_prices_file
* get_total_volume_traded_from_prices_file
* Race stream related functions:
* calculate_haversine_distance_between_runners
* get_number_of_jumps_remaining
* get_race_leaders
* Race card related functions:
* get_is_jump_from_race_card

### Changed

* Made get_final_market_definition_from_prices_file more efficient
* Race card extraction functions now work on both dictionaries and paths to files

Expand Down
6 changes: 5 additions & 1 deletion betfairutil/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2745,7 +2745,11 @@ def g():
return df


def publish_time_to_datetime(publish_time: int) -> datetime.datetime:
def publish_time_to_datetime(
publish_time: Optional[int],
) -> Optional[datetime.datetime]:
if publish_time is None:
return
return datetime.datetime.utcfromtimestamp(publish_time / 1000).replace(
tzinfo=datetime.timezone.utc
)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name="betfairutil",
version="0.6.0",
version="0.6.1",
description="Utility functions for working with Betfair data",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
4 changes: 4 additions & 0 deletions tests/test_non_prices.py
Original file line number Diff line number Diff line change
Expand Up @@ -1301,3 +1301,7 @@ def test_get_total_volume_traded_from_prices_file(
f.write("\n")
total_volume_traded = get_total_volume_traded_from_prices_file(path_to_prices_file)
assert total_volume_traded is None


def test_publish_time_to_datetime():
assert publish_time_to_datetime(None) is None

0 comments on commit 7b27cba

Please sign in to comment.