bvanelli / actualpy

Python API implementation for Actual server - reference https://actualbudget.org/
20 stars 4 forks source link

feat: Add bank sync and implement it for the simplefin demo data. #27

Closed bvanelli closed 2 months ago

bvanelli commented 3 months ago

@latetedemelon @JaxOfDiamonds let me know what you think, I did not have time to test it since it took me way longer than I expected to write it.

I did not have any time to test it so it might be buggy.

I also could not validate the models with the responses from the API from gocardless, that I assume is similar. I'm not sure if they have a dev token just like simplefin has, if you guys know (or can provide an anonimized response) let me know.

Here is one example:

from actual import Actual

with Actual(base_url="http://localhost:5006", password="<your password>", file="<your file>") as actual:
    added = actual.run_bank_sync()
    print(f"Imported or updated {len(added)} transactions!")
    actual.commit()

This will only work once the first sync was already done, and I tested it by deleting the latest x transactions and importing again.

Closes https://github.com/bvanelli/actualpy/issues/25

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 96.68675% with 11 lines in your changes missing coverage. Please review.

Project coverage is 96.45%. Comparing base (5de4026) to head (65d9ea1).

Files Patch % Lines
actual/api/__init__.py 80.95% 4 Missing :warning:
actual/utils/title.py 89.18% 4 Missing :warning:
actual/queries.py 95.55% 2 Missing :warning:
actual/api/models.py 98.92% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #27 +/- ## ========================================== - Coverage 96.54% 96.45% -0.10% ========================================== Files 9 12 +3 Lines 1447 1691 +244 ========================================== + Hits 1397 1631 +234 - Misses 50 60 +10 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.