aboutsummaryrefslogtreecommitdiff
path: root/cli/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'cli/main.py')
-rw-r--r--cli/main.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/cli/main.py b/cli/main.py
new file mode 100644
index 0000000..5ac94db
--- /dev/null
+++ b/cli/main.py
@@ -0,0 +1,28 @@
+import requests
+import os
+
+if os.getenv("BUDGET_USERNAME", None):
+ username = os.getenv("BUDGET_USERNAME")
+else:
+ username = input("Username: ")
+if os.getenv("BUDGET_PASS", None):
+ password = os.getenv("BUDGET_PASS")
+else:
+ password = input("Password: ")
+
+payload = {
+ "username": username,
+ "password": password,
+}
+
+with requests.Session() as s:
+ p = s.post("https://budget.marks.kitchen/login", data=payload)
+ payload = {
+ "when": "",
+ "where": input("Where: "),
+ "amount": input("Amount: "),
+ "category": input("Category: "),
+ "subcategory": input("Subcategory: "),
+ }
+ p = s.post("https://budget.marks.kitchen/transaction", data=payload)
+ print(p.status_code)