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:
30
actual_bank_sync.py
Normal file
30
actual_bank_sync.py
Normal 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()
|
||||
Reference in New Issue
Block a user