Git Product home page Git Product logo

pynab_monzo's Introduction

pynab_monzo

CI License: MIT

pynab_monzo is a Flask application for automatically importing Monzo transactions into You Need a Budget (YNAB) budgets.

Environment Variables

  • YNAB_PAT: YNAB API token - used to make requests to YNAB.
  • MONZO_TOKEN: Monzo API token - used to make requests to Monzo.
  • MONZO_ACCOUNT: Monzo account ID - used in registering a webhook.
  • MONZO_ACCOUNT_NAME: Name of Monzo account within YNAB - used in choosing which YNAB account to create the transaction in.
  • REDIS_URL: URL of a Redis server - used to prevent duplicate requests creating multiple identical transactions.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Pull requests without tests will be declined.

pynab_monzo's People

Contributors

mbrighty avatar

Watchers

 avatar

pynab_monzo's Issues

New YNAB account type causes an exception to be thrown when enumerating accounts in YNAB

The lack of an update to the YNAB OpenAPI wrapper library since YNAB added loanaccounts causes an exception to be thrown when the otherDebt account type is returned from the YNAB API.

2022-01-29T15:33:20.126260+00:00 app[web.1]: Traceback (most recent call last):
2022-01-29T15:33:20.126261+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
2022-01-29T15:33:20.126261+00:00 app[web.1]:     response = self.full_dispatch_request()
2022-01-29T15:33:20.126262+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
2022-01-29T15:33:20.126263+00:00 app[web.1]:     rv = self.handle_user_exception(e)
2022-01-29T15:33:20.126263+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
2022-01-29T15:33:20.126263+00:00 app[web.1]:     reraise(exc_type, exc_value, tb)
2022-01-29T15:33:20.126264+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
2022-01-29T15:33:20.126265+00:00 app[web.1]:     raise value
2022-01-29T15:33:20.126265+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
2022-01-29T15:33:20.126265+00:00 app[web.1]:     rv = self.dispatch_request()
2022-01-29T15:33:20.126265+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
2022-01-29T15:33:20.126266+00:00 app[web.1]:     return self.view_functions[rule.endpoint](**req.view_args)
2022-01-29T15:33:20.126266+00:00 app[web.1]:   File "/app/pynab_monzo/app.py", line 24, in monzo_hook
2022-01-29T15:33:20.126267+00:00 app[web.1]:     status_code = webhook.handle_incoming_transaction(request.json)
2022-01-29T15:33:20.126267+00:00 app[web.1]:   File "/app/pynab_monzo/controllers/webhook.py", line 59, in handle_incoming_transaction
2022-01-29T15:33:20.126267+00:00 app[web.1]:     outgoing_json = translate_monzo_to_ynab(json)
2022-01-29T15:33:20.126267+00:00 app[web.1]:   File "/app/pynab_monzo/controllers/webhook.py", line 13, in translate_monzo_to_ynab
2022-01-29T15:33:20.126268+00:00 app[web.1]:     account_id = client.find_monzo_id()
2022-01-29T15:33:20.126268+00:00 app[web.1]:   File "/app/pynab_monzo/ynab.py", line 31, in find_monzo_id
2022-01-29T15:33:20.126268+00:00 app[web.1]:     res = accounts.get_accounts(self._LAST_USED)
2022-01-29T15:33:20.126268+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/ynab/api/accounts_api.py", line 179, in get_accounts
2022-01-29T15:33:20.126268+00:00 app[web.1]:     return self.get_accounts_with_http_info(budget_id, **kwargs)  # noqa: E501
2022-01-29T15:33:20.126269+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/ynab/api/accounts_api.py", line 251, in get_accounts_with_http_info
2022-01-29T15:33:20.126270+00:00 app[web.1]:     return self.api_client.call_api(
2022-01-29T15:33:20.126270+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/ynab/api_client.py", line 348, in call_api
2022-01-29T15:33:20.126270+00:00 app[web.1]:     return self.__call_api(resource_path, method,
2022-01-29T15:33:20.126270+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/ynab/api_client.py", line 192, in __call_api
2022-01-29T15:33:20.126270+00:00 app[web.1]:     return_data = self.deserialize(response_data, response_type)
2022-01-29T15:33:20.126271+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/ynab/api_client.py", line 264, in deserialize
2022-01-29T15:33:20.126271+00:00 app[web.1]:     return self.__deserialize(data, response_type)
2022-01-29T15:33:20.126271+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/ynab/api_client.py", line 303, in __deserialize
2022-01-29T15:33:20.126271+00:00 app[web.1]:     return self.__deserialize_model(data, klass)
2022-01-29T15:33:20.126271+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/ynab/api_client.py", line 639, in __deserialize_model
2022-01-29T15:33:20.126271+00:00 app[web.1]:     kwargs[attr] = self.__deserialize(value, attr_type)
2022-01-29T15:33:20.126272+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/ynab/api_client.py", line 303, in __deserialize
2022-01-29T15:33:20.126272+00:00 app[web.1]:     return self.__deserialize_model(data, klass)
2022-01-29T15:33:20.126272+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/ynab/api_client.py", line 639, in __deserialize_model
2022-01-29T15:33:20.126272+00:00 app[web.1]:     kwargs[attr] = self.__deserialize(value, attr_type)
2022-01-29T15:33:20.126272+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/ynab/api_client.py", line 280, in __deserialize
2022-01-29T15:33:20.126272+00:00 app[web.1]:     return [self.__deserialize(sub_data, sub_kls)
2022-01-29T15:33:20.126272+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/ynab/api_client.py", line 280, in <listcomp>
2022-01-29T15:33:20.126272+00:00 app[web.1]:     return [self.__deserialize(sub_data, sub_kls)
2022-01-29T15:33:20.126273+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/ynab/api_client.py", line 303, in __deserialize
2022-01-29T15:33:20.126273+00:00 app[web.1]:     return self.__deserialize_model(data, klass)
2022-01-29T15:33:20.126273+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/ynab/api_client.py", line 641, in __deserialize_model
2022-01-29T15:33:20.126273+00:00 app[web.1]:     instance = klass(**kwargs)
2022-01-29T15:33:20.126274+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/ynab/models/account.py", line 84, in __init__
2022-01-29T15:33:20.126274+00:00 app[web.1]:     self.type = type
2022-01-29T15:33:20.126274+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/ynab/models/account.py", line 165, in type
2022-01-29T15:33:20.126274+00:00 app[web.1]:     raise ValueError(
2022-01-29T15:33:20.126275+00:00 app[web.1]: ValueError: Invalid value for `type` (otherDebt), must be one of ['checking', 'savings', 'cash', 'creditCard', 'lineOfCredit', 'otherAsset', 'otherLiability', 'payPal', 'merchantAccount', 'investmentAccount', 'mortgage']```

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.