All these are using DirectLogin
-
Create a virtual environment:
virtualenv --python=python3 venv
-
Then activate it:
source venv/bin/activate
-
Now install requests in the virtualenv:
pip install -r requirements.txt
-
Copy
settings.py.example
tosettings.py
and edit to suit your needs. -
For future runs, you need to activate the virtualenv again, but do not need to recreate it or install the requirements.
-
When you are done,
deactivate
the virtualenv
- In directory
example_input
you will find CSV/JSON files which should explain the format the scripts expect the input data to be.
Python scripts to import data into the API
./import_banks.py <csv file>
./import_branches.py <csv file> <bank id>
./import_products.py <csv file> <bank id>
./import_atms.py <csv file> <bank id>
You probably have to edit the importer classes (method get_data
) to match your input data as this changes with every dataset.
./print_account_data.py <json file>
This is a bit different as it does not use the API, but talks directly to the database used by the API. You need to configure the settings accordingly. Run it on the database server with ./generate_stats.py
the webdriver of firefox or chrome need to be installed for selenium.
Please make sure that OBP-API server and API-Tester server is running
Create and edit settings.py
, this setting file is used mainly for oauth1.0 login(both users and admin):
#Consumer key + secret to authenticate the _app_ against the API
OAUTH_CONSUMER_KEY = '<key>'
OAUTH_CONSUMER_SECRET = '<secret>'
# API hostname, e.g. https://api.openbankproject.com
API_HOST = '<hostname>'
# API_VERSION Used in project
API_VERSION = '3.1.0'
# API Tester hostname, e.g. https://apitester.openbankproject.com
REDIRECT_URL = 'http://127.0.0.1:9090'
OAUTH_TOKEN_PATH = '/oauth/initiate'
OAUTH_AUTHORIZATION_PATH = '/oauth/authorize'
OAUTH_ACCESS_TOKEN_PATH = '/oauth/token'
# Admin username and password
ADMIN_USERNAME = '<username>'
ADMIN_PASSWORD = '<password>'
FILE_ROOT = '<path>'
$ python run\PostCounterpartyScript.py
make sure your admin account have the roles below: CanCreateCustomer or CanCreateCustomerAtAnyBank CanCreateCustomer and CanCreateUserCustomerLink CanCreateCustomerAtAnyBank and CanCreateUserCustomerLinkAtAnyBank CanGetAnyUser
$ python run\PostCustomerScript.py