Skip to content
This repository was archived by the owner on Oct 29, 2023. It is now read-only.

Added many missing API methods#14

Merged
femueller merged 1 commit intofemueller:masterfrom
markusressel:feature/spaces
Mar 9, 2019
Merged

Added many missing API methods#14
femueller merged 1 commit intofemueller:masterfrom
markusressel:feature/spaces

Conversation

@markusressel
Copy link
Copy Markdown
Collaborator

@markusressel markusressel commented Mar 7, 2019

Added methods to query the following things:

  • Spaces
  • Standing Orders
  • Savings
  • Statistics
  • Invitations
  • Available categories

I also added some parameters to the transactions API method.
To do this and make it easier for future requests I also did some refactoring to remove all the copy&paste code - I hope this is in your interest too.

Because I ran into strange json errors when the server wasn't responding as expected I also added a
result.raise_for_status() call so http response codes other than 200 will be raised as an exception before trying to parse the result as a json.

I saw that @sdabbo created a PR for spaces support that also adds some code to the cli.
I dit not add any code for the cli because I don't need it. It might be useful to merge his PR and then let me fix any merge conflicts and merge this PR after that.

I used this very helpful (inofficial) API description from this repo:
https://github.com/Rots/n26-api
Some of the methods there didn't work so I didn't add them.
I also didn't try every single thing listed there, just the stuff I found generally interesting.

Comment thread setup.py
Comment thread tests/test_api.py
Comment thread tests/test_config.py
@femueller
Copy link
Copy Markdown
Owner

Thanks for your contribution!

The only thing I would propose before merging is to roll back the formatting by PyCharm in the test files because it seems a little off.

Comment thread tests/test_config.py Outdated
@markusressel
Copy link
Copy Markdown
Collaborator Author

@femueller It's just formatted according to specification, line breaks could be added though. I will revert this (in a couple of hours).

added api method to query available categories
added api method to query invitations
added api method to query statistics for a given timeframe
added api method to query standing orders
added api method to query savings
added query parameters to get_transactions method
deprecated get_transactions_limited (now uses get_transactions with parameter)
added url parameter handling to _do_request
raise exception for http result codes other than 200
refactoring to reduce copy&paste code
added missing test dependencies to setup.py
@femueller femueller merged commit 2405efe into femueller:master Mar 9, 2019
@markusressel markusressel deleted the feature/spaces branch March 9, 2019 15:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants