Initial commit. Lots of messy functions but eventually each file will do different things for apple shortcuts to then send me a text.

This commit is contained in:
norm
2025-11-05 14:43:11 -05:00
commit b1d6aab9e3
5 changed files with 548 additions and 0 deletions

30
actual_bank_sync.py Normal file
View File

@ -0,0 +1,30 @@
from actual import Actual
import os
from dotenv import load_dotenv
load_dotenv()
def main():
synced_accounts = os.getenv('SYNCED_ACCOUNTS')
with Actual(
base_url=os.getenv('BASEURL'),
password=os.getenv('PASSWORD'),
encryption_password=None, # Optional: Password for the file encryption. Will not use it if set to None.
file=os.getenv('FILE'),
cert=False
) as actual:
for account in synced_accounts:
try:
sync_test = actual.run_bank_sync(account=account, run_rules=True)
except Exception as e:
print("**************")
print(f"An exception occurred! \n {e}")
print("**************")
else:
for transaction in sync_test:
print(f"Added of modified {transaction}")
finally:
actual.commit()
if __name__ == "__main__":
main()