diff --git a/README.md b/README.md index 0731e3a..90b0155 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ consumers. Surely, these platforms would benefit from having greater granularity purchase behaviour from knowing only the vendor & not the items. I wanted to make a proof-of-concept using Up Bank's well-documented API & one of, if not the largest Australian grocer: -Woolworths. In short, Woolworths Everyday Rewards API is closed-source & painful to look at. However, they do provide +Woolworths. In short, Woolworths' Everyday Rewards API is closed-source & painful to look at. However, they do provide customers with ✨e-receipts✨, which is more than I can say for their competitor, Coles' FlyBuy program. ## requirements @@ -57,7 +57,7 @@ WOOLIES_TOKEN=8h41... UP_TOKEN=up:yeah:1234abcd... ``` -4. Run `main.py`, look around & have some fun! +4. Run `src/up_woolies/main.py`, look around & have some fun! ``` $ python main.py @@ -96,6 +96,10 @@ suggest the feature through support chat in-app 🙏 * 👩‍💼 Talk to someone about Woolworths' API * I tried reaching out to Woolworths to talk about their API: EverdayRewards support, Quantium (the tech subsidiary managing the program), even cold-messaged people on LinkedIn associate with WooliesX. No luck. +* ⚡ Talk to someone about Up Bank's smart receipts + * A friend pointed out on [The Tree of Up](https://up.com.au/tree/) a leaf call _smart receipts_ & the existing + integration with AfterPay. It would be interesting to hear how it was implemented, & if this proof-of-concept + shares any similarities. * 👫 Support 2Up * Please read [help wanted](#help-wanted) on how you can help push for API support of 2Up. * ⚖ Interpret item weights diff --git a/src/up_woolies/up.py b/src/up_woolies/up.py index 8da40cb..0a2412c 100644 --- a/src/up_woolies/up.py +++ b/src/up_woolies/up.py @@ -12,7 +12,8 @@ from utils import parse_money # Get token from environment variables -load_dotenv(dotenv_path='../../.env') +for fp in ['../../.env', '.env']: + load_dotenv(dotenv_path=fp) # Define endpoint & headers endpoint = "https://api.up.com.au/api/v1/" diff --git a/src/up_woolies/woolies.py b/src/up_woolies/woolies.py index 6ca7d96..cad48ba 100644 --- a/src/up_woolies/woolies.py +++ b/src/up_woolies/woolies.py @@ -12,7 +12,8 @@ from utils import parse_money # Get token from environment variables -load_dotenv(dotenv_path='../../.env') +for fp in ['../../.env', '.env']: + load_dotenv(dotenv_path=fp) # Define endpoint & headers endpoint = "https://api.woolworthsrewards.com.au/wx/v1/" @@ -26,9 +27,6 @@ } -# TODO support for Woolies' partners e.g. BWS, BigW, etc - - class Purchase(BaseModel, extra=Extra.ignore): """ Dataclass of an unique purchased item """ description: str