Skip to main content

Beta Open Bank Project Python Utilities

Project description

Open Bank Project CLI

A command line utility (CLI) to work with the Open Bank Project sandbox called obp.

With the obp cli you can:

  • Initiate an api connection to the sandbox
    • note you still need to sign-up from the sandbox homepage first to create your username & password
  • Get your DirectLogin token
  • Get your user information
  • Get your user id
  • Get banks
  • Get (your) accounts held at the bank

Also, depending on your account access you may:

  • Create a bank account
  • Add roles to a user
  • Import/Delete branches
  • Import dummy bank data

Install

pip install --user obp-python # Requires at least python 3

Warning: If your operating system defaults to python 2, your pip command might be:

pip3 install --user obp-python
#or 
pip3.6 install --user obp-python

Usage

Usage: obp [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  addaccount              ๐Ÿ“ Add a bank account
  addbank                 ๐Ÿฆ Add a bank
  addcustomer             ๐Ÿง™ Add a customer
  addfx                   ๐Ÿ“‰ Add exchange rate (FX)
  addrole                 ๐Ÿšง Add a role for current user
  adduser                 ๐Ÿ“ Add a user
  addview                 ๐Ÿง Add a view
  answerconsent           ๐Ÿšง Answer consent
  createconsent           ๐Ÿšง Add a consent
  deletebranches          โš ๏ธ ๐Ÿฆ Delete all branches
  deletecardbyid          โš ๏ธ ๐Ÿ’ณ Delete card by id
  getaccountbyid          ๐Ÿ“ Get account by id (includes balance)
  getaccountsheld         ๐Ÿ“ Get list of accounts held
  getaccounttransactions  ๐Ÿ“ Get transactions for an account
  getauth                 ๐Ÿ”‘ Get your DirectLogin token
  getbanks                ๐Ÿฆ Get list of banks
  getcardbyid             ๐Ÿ’ณ Get card by id
  getcardbynumber         ๐Ÿ’ณ Get card by card number
  getcards                ๐Ÿ’ณ Get list of cards at bank
  getconsents             ๐Ÿšง Get consents
  getconsentstatus        ๐Ÿšง Get consent status- with certificate
  getcustomers            ๐Ÿ‘ฅ Get list of customers
  getuser                 ๐Ÿ˜ƒ Get your user info
  getuserid               ๐Ÿ“‹ Get your user id
  getuseridbyusername     ๐Ÿ“‹ Get user id by username
  getusers                ๐Ÿ˜ƒ Get all users
  importaccounts          ๐Ÿšœ Import accounts from spreadsheet template
  importbranches          ๐Ÿšœ Import branches from spreadsheet template
  importcardattribues     ๐Ÿšœ Import card attributes from spreadsheet template
  importcards             ๐Ÿšœ Import cards from spreadsheet template
  importcustomers         ๐Ÿšœ Import customers from spreadsheet template
  importfx                ๐Ÿšœ ๐Ÿ“‰ Load all foreign exchange rates (FX) to all...
  importtransactions      ๐Ÿšœ Import transactions from spreadsheet template
  importusers             ๐Ÿšœ Import users from spreadsheet template
  init                    ๐Ÿ’ก Initalize connection to your Open Bank Project...
  linkusertocustomer      ๐Ÿ”— Link user to a customer
  revokeconsent           ๐Ÿšง Revoke consent
  sandboximport           ๐Ÿšœ Bulk import sandbox data from json input

Examples

You must initalize the obp cli once, by doing:

obp init

Generate Direct Login Token

obp init 
Please enter your API_HOST: api.example.com
Please enter your username:
Please enter your password: : 
Repeat for confirmation: 
... generating direct login token
Please enter your OBP_CONSUMER_KEY: # Go to api.example.com, then "Get API Key" to generate consumer key.
obp getauth # Displays your DirectLogin token

Contributing

Note You can ignore this is your just using the utlity. This is just for developing the utlity.

To work on this utility as a developer:

Building
# Setup python3 environment
virtualenv -p python3 venv
. venv/bin/activate
git clone <this-repo>
# Building wheels etc
python setup.py sdist bdist_wheel
# Installing your edits locally:
pip install -e <path-to-this-repo> # -e means Install  a  project  in editable mode (i.e.  setuptools "developmode")
# Work on utility..submit pull request 

Update history
  • 0.19 Added sandboximport utility obp sandboximport --example
  • 0.0.9 Switch to use OBP_API_HOST instead of OBP_ENDPOINT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

obp_python-0.206.tar.gz (32.3 kB view details)

Uploaded Source

Built Distribution

obp_python-0.206-py3-none-any.whl (69.4 kB view details)

Uploaded Python 3

File details

Details for the file obp_python-0.206.tar.gz.

File metadata

  • Download URL: obp_python-0.206.tar.gz
  • Upload date:
  • Size: 32.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.5.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7

File hashes

Hashes for obp_python-0.206.tar.gz
Algorithm Hash digest
SHA256 7f23cd84257c6046831a456aea3c23c3cc1163b5bb822db11f4eaa5c0ba82db2
MD5 1916ab1b6737415355fa18df54e70fee
BLAKE2b-256 218f014f11647796c5a00c0d18e73625a481a957c34f09a93188cdc3249e004f

See more details on using hashes here.

File details

Details for the file obp_python-0.206-py3-none-any.whl.

File metadata

  • Download URL: obp_python-0.206-py3-none-any.whl
  • Upload date:
  • Size: 69.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.5.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7

File hashes

Hashes for obp_python-0.206-py3-none-any.whl
Algorithm Hash digest
SHA256 729f721313b6f815f43da69a9a77cd99995a04d4bcf636a2347881c648a0050e
MD5 23722d2629124de46ab40b4a0596a959
BLAKE2b-256 b62cdb09e18ac0b3b0974aa2ee82f05a63f82b2737ade684e718c481862b95f6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page