-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: support changes to woolies & for 2Up
- Loading branch information
Showing
8 changed files
with
140 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
WOOLIES_CLIENT_ID= | ||
WOOLIES_TOKEN= | ||
UP_TOKEN= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
## v1.1.0 - 20/02/2022 | ||
|
||
- Added changelog 📑 | ||
- ~~Added Woolworth's email:password login via env. vars. or CLI~~ | ||
- Nevermind, the woolies' login endpoint shared via [#1](https://github.com/MattTimms/up_woolies/issues/1) has begun | ||
rejecting requests & instead returns 403 forbbiden | ||
- Added use of Up API's category-filter for off-loading some filtering compute to them | ||
- Added python rich library for prettier print-outs | ||
- Added scaffolding for accessing 2Up data | ||
- Updated README | ||
- Fixed missing/new requirement for `User-Agent` header for Woolworth's API | ||
- Fixed default Up spending account name from `Up Account` to `Spending` as per | ||
💕 [2Up Support](https://github.com/up-banking/api/issues/31#issuecomment-1008441619) update | ||
- Fixed indefinite requests with default timeout adapter on request sessions | ||
- Fixed missing dependency versions | ||
|
||
## v1.0.0 - 24/07/2021 | ||
|
||
- ⚡ initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
python-dotenv | ||
requests | ||
prance[osv] | ||
pydantic | ||
python-dotenv==0.17.1 | ||
requests==2.25.1 | ||
rich==11.2.0 | ||
prance[osv]==0.21.2 | ||
pydantic==1.8.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
from decimal import Decimal | ||
from re import sub | ||
|
||
from requests.adapters import HTTPAdapter | ||
from requests import PreparedRequest, Response | ||
|
||
|
||
def parse_money(money_str: str) -> Decimal: | ||
return Decimal(sub(r'[^\d.]', '', money_str)) | ||
|
||
|
||
class DefaultTimeoutAdapter(HTTPAdapter): | ||
def __init__(self, *args, timeout: float, **kwargs): | ||
self.timeout = timeout | ||
super().__init__(*args, **kwargs) | ||
|
||
def send(self, request: PreparedRequest, **kwargs) -> Response: | ||
kwargs['timeout'] = kwargs.get('timeout') or self.timeout | ||
return super().send(request, **kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters