GithubHelp home page GithubHelp logo

obp-cli's Introduction

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
pip install obp-python # If you are using a python 3 virtual environment

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
  importatms              ๐Ÿšœ Import atms 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

Create Bulk Users for load testing

obp bulkcreateusers --name-prefix=magniaffaffel --number-users=3 --number-transactions=3 --bank-id=rbs --seed-account-id=26fa77a2-028f-4022-b47d-26caa8db359b --seed-bank-id=rbs --seed-account-currency=GBP

Will create Users up to --number-users, username will be --name-prefix + usernumber (iterated per user starting from 1 till --number-users) with 5 Accounts with each having --number-transactions transactions. Needs a seed account to make the transactions from.

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

obp-cli's People

Contributors

chrisjsimpson avatar constantine2nd avatar hongwei1 avatar simonredfern avatar tawoe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

obp-cli's Issues

Import Users from spreadsheet template

For demos, banks and fin-techs often provide spreadsheets of example data they want to show for an app demo or online banking with a small dataset. This includes bank accounts.

Scenario: Import Users from spreadsheet
Ability to import Users based on a standard template.

We already provide this facility for importing branches and accounts , so long as the user provides a valid Users template, we can import them via obp cli.

Import Loans from spreadsheet template

For demos, banks and fin-techs often provide spreadsheets of example data they want to show for an app demo or online banking with a small dataset. This includes bank accounts.

Scenario: Import Loans from spreadsheet
Ability to import Loans based on a standard template.

We already provide this facility for importing branches and accounts , so long as the user provides a valid Loans template, we can import them via obp cli.

  • Blocked by #40

Allow importing of bank data via templated spreadsheets

Background:
Often banks and fintechs want to present a demo scenario to their stakeholders showing them an app or website running with some small sample data they have prepared especially for a demo. The motivation for this issue is to allow non technical users to provide the data they want to demo, in a structured form so that it may easily be imported into Open Bank Project via the CLI.

Scenario: Importing banking related data for the purposes of demos

When I have some sample bank data, then I expect to be able to locate a spreadsheet template for this data.
When I submit this template filled in correctly , then I expect the OBP CLI tool to be able to import this data for me into my Open Bank Project sandbox.

Import Customers from spreadsheet template

For demos, banks and fin-techs often provide spreadsheets of example data they want to show for an app demo or online banking with a small dataset. This includes bank accounts.

Scenario: Import customers from spreadsheet
Ability to import customers based on a standard template.

We already provide this facility for importing branches and accounts , so long as the user provides a valid customer template, we can import them via obp cli.

Import Transactions from spreadsheet template

For demos, banks and fin-techs often provide spreadsheets of example data they want to show for an app demo or online banking with a small dataset. This includes bank accounts.

Scenario: Import Transactions from spreadsheet
Ability to import Transactions based on a standard template.

We already provide this facility for importing branches and accounts , so long as the user provides a valid Transaction template, we can import them via obp cli.

implement getconsent status cli

curl -X GET \
  http://127.0.0.1:8080/berlin-group/v1.3/consents/CONSENTID/status \
  -H 'Authorization: DirectLogin token=eyJhbGciOiJIUzI1NiJ9.eyIiOiIifQ.xflStTeAfTvHJNkKhZsajHJ2yhbLVOgG5dJmuhjTcLQ' \
  -H 'Cache-Control: no-cache' \
  -H 'PSD2-CERT: -----BEGIN CERTIFICATE-----...-----END CERTIFICATE-----' \

Import historical transactions with date

Ability to import transactions with date set

Using api call: /obp/v3.1.0/management/historical/transactions

curl -X POST \
  http://127.0.0.1:8080/obp/v3.1.0/management/historical/transactions \
  -H 'Accept: */*' \
  -H 'Authorization: DirectLogintoken="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyIiOiIifQ.plUgi_AdZnSt97hTQLdpdg_eGYISNjyODh5n8nC1EeE"' \
  
  -d '{
    "from": {
        "bank_id": "gh.29.uk",
        "account_id": "1"
    },
    "to": {
        "bank_id": "gh.29.uk",
        "account_id": "8ca8a7e4-6d02-48e3-a029-0b2bf89de9f0"
    },
    "value": {
        "currency": "EUR",
        "amount": "10"
    },
    "description": "this is for work2",
    "posted": "2010-09-19T02:11:29Z",
    "completed": "2016-09-19T02:31:28Z",
    "transaction_request_type": "SANDBOX_TAN",
    "charge_policy": "SHARED"
}'

Add new exchange rates rates to OBP

When importing transactions, exchange rates need to be present for all of the currencies being imported in order to support conversion.

otherwise we see:

OBP-10006: Invalid Currency Value. The requested currency conversion (EUR to XYZ) is not supported."} during import

Import bank accounts from spreadsheet template

For demos, banks and fin-techs often provide spreadsheets of example data they want to show for an app demo or online banking with a small dataset. This includes bank accounts.

Scenario: Import bank accounts from spreadsheet
Ability to import accounts based on a standard template.

We already provide this facility for importing branches , so long as the user provides a valid branches template, then can import via obp importbranches.
This issue is to add the same for accounts.

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.