From bd047d378e8839d3e89be396fcdbced44d2f3e69 Mon Sep 17 00:00:00 2001 From: Jonxslays <51417989+Jonxslays@users.noreply.github.com> Date: Tue, 7 Nov 2023 07:18:51 -0700 Subject: [PATCH] Add rank property to snapshot timeline entry (#34) * Add rank property to snapshot timeline entry * Bump project version * Update changelog --- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- wom/__init__.py | 2 +- wom/models/players/models.py | 7 ++++++- wom/serializer.py | 2 +- 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc068eb..6d738ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# v0.8.1 (Nov 2023) + +## Additions + +- Add `rank` property to `SnapshotTimelineEntry`. + +--- + # v0.8.0 (Oct 2023) ## Additions diff --git a/pyproject.toml b/pyproject.toml index 1ab8c37..8edf9be 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "wom.py" -version = "0.8.0" +version = "0.8.1" description = "An asynchronous wrapper for the Wise Old Man API." authors = ["Jonxslays"] license = "MIT" diff --git a/wom/__init__.py b/wom/__init__.py index ecaf7b5..9033534 100644 --- a/wom/__init__.py +++ b/wom/__init__.py @@ -32,7 +32,7 @@ from typing import Final __packagename__: Final[str] = "wom.py" -__version__: Final[str] = "0.8.0" +__version__: Final[str] = "0.8.1" __author__: Final[str] = "Jonxslays" __copyright__: Final[str] = "2023-present Jonxslays" __description__: Final[str] = "An asynchronous wrapper for the Wise Old Man API." diff --git a/wom/models/players/models.py b/wom/models/players/models.py index 69112cb..10490d2 100644 --- a/wom/models/players/models.py +++ b/wom/models/players/models.py @@ -470,7 +470,12 @@ class SnapshotTimelineEntry(BaseModel): """An entry representing a point in time of a players gains.""" value: int - """The total xp gained since the last timeline entry.""" + """The players value for a specific metric, at a specific point in + time.""" + + rank: int + """The players rank for a specific metric, at a specific point in + time.""" date: datetime """The date this timeline entry was recorded.""" diff --git a/wom/serializer.py b/wom/serializer.py index 705cd53..8531e8e 100644 --- a/wom/serializer.py +++ b/wom/serializer.py @@ -1125,7 +1125,7 @@ def deserialize_snapshot_timeline_entry(self, data: DictT) -> models.SnapshotTim """ entry = models.SnapshotTimelineEntry() entry.date = self._dt_from_iso(data["date"]) - entry.value = data["value"] + self._set_attrs(entry, data, "value", "rank") return entry @serializer_guard