From 05201fbc95769d28f5e13ef12af95ee014090df8 Mon Sep 17 00:00:00 2001 From: Michael Bianco Date: Tue, 26 Dec 2023 20:09:22 -0700 Subject: [PATCH] minor fixes & documentation (#4) --- .gitignore | 4 ++++ README.md | 13 ++++++++++++- venmo_auto_cashout/cli.py | 4 ++-- venmo_auto_cashout/lunchmoney.py | 3 +++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index e7d93cc..d1dc43c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,6 @@ .pdm.toml __pypackages__ +.pdm-python +.envrc +.env +*.db diff --git a/README.md b/README.md index 04188ab..6037f0f 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ You will need to specify additional flags when running the script to do this. It is also highly recommended that the script run on as a cron job in this case. ``` -$ venmo-auto-cashout --token=XXX --lunchmoney-token=XXX --lunchmoney-group=z-venmo +$ venmo-auto-cashout --token=XXX --lunchmoney-token=XXX --lunchmoney-category=z-venmo Your balance is $0.00 Waiting 5 seconds before querying transactions... There are 0 income transactions to cash-out @@ -81,3 +81,14 @@ Successfully logged in. Note your token and device-id access_token: xxxx device-id: xxxx ``` + +### ENV Variables + +You can also set the following ENV variables instead of passing them as flags: + +``` +export VENMO_API_TOKEN= +export TRANSACTION_DB= +export LUNCHMONEY_TOKEN= +export LUNCHMONEY_CATEGORY= +``` \ No newline at end of file diff --git a/venmo_auto_cashout/cli.py b/venmo_auto_cashout/cli.py index 8577c89..33f2e79 100644 --- a/venmo_auto_cashout/cli.py +++ b/venmo_auto_cashout/cli.py @@ -56,7 +56,7 @@ def run_cli(): parser.error("--transaction-db must be specified to use the LM integration") if len([x for x in (args.lunchmoney_token, args.lunchmoney_category) if x is not None]) == 1: - parser.error("--lunchmoney-{token,categry} are both required for LM integration") + parser.error("--lunchmoney-{token,category} are both required for LM integration") db_path: Union[str, None] = args.transaction_db db = None @@ -235,4 +235,4 @@ def output(msg: str): output, ) - output("\nAll money transfered out!") + output("\nAll money transferred out!") diff --git a/venmo_auto_cashout/lunchmoney.py b/venmo_auto_cashout/lunchmoney.py index d30e0b3..4c14856 100644 --- a/venmo_auto_cashout/lunchmoney.py +++ b/venmo_auto_cashout/lunchmoney.py @@ -30,6 +30,9 @@ def update_lunchmoney_transactions( that have not already had a lunchmoney_transaction_id associated to them in the database. """ + + output("Updating Lunch Money transactions") + lunch = LunchMoney(access_token=token) try: