Skip to main content

BAM-Lib

A python library that makes it easy to utilize the bank-account-microservice microservice.

bank-account-microservice on:
heroku
github

For now your best bet is just to copy/paste this functionality into a .py file to test it out... I'm working on fixing that.

git clone https://github.com/blarmon/BAM-Lib

Using this library:

Available functions

  • get_account()

    • Called with no parameters this function will return all accounts. Given an account id it will return only that account.

    CALL: print(get_account())
    OUTPUT:

 [{'id': 5, 'customer': 1, 'account_type': 'savings', 'balance': '1234.56', 'interest_rate': '2.76', 'account_opened': '2018-12-  29T17:50:20.862829Z'}, {'id': 6, 'customer': 1, 'account_type': 'savings', 'balance': '1234.56', 'interest_rate': '2.76', 'account_opened': '2018-12-29T17:57:35.778662Z'}, {'id': 7, 'customer': 1, 'account_type': 'savings', 'balance': '876543.21', 'interest_rate': '2.76', 'account_opened': '2018-12-29T17:58:06.781378Z'}, {'id': 8, 'customer': 1, 'account_type': 'savings', 'balance': '1234.56', 'interest_rate': '2.76', 'account_opened': '2018-12-29T17:50:20.862829Z'}, {'id': 4, 'customer': 1, 'account_type': 'money market', 'balance': '956.00', 'interest_rate': '5.00', 'account_opened': '2018-12-28T20:35:54.186979Z'}]  
  • get_user()

    • Called with no parameters this function will return all accounts. Given an account id it will return only that account.

    CALL: print(get_user())
    OUTPUT:

 [{'url': 'https://bank-account-microservice.herokuapp.com/api/users/4/', 'username': 'csiegel42', 'email': 'chris@chris.chris', 'accounts': []}, {'url': 'https://bank-account-microservice.herokuapp.com/api/users/3/', 'username': 'different_name', 'email': 'chris@chris.chris', 'accounts': []}, {'url': 'https://bank-account-microservice.herokuapp.com/api/users/1/', 'username': 'csiegel', 'email': 'christopher.siegel@dmu.edu', 'accounts': ['https://bank-account-microservice.herokuapp.com/api/accounts/4/', 'https://bank-account-microservice.herokuapp.com/api/accounts/5/', 'https://bank-account-microservice.herokuapp.com/api/accounts/6/', 'https://bank-account-microservice.herokuapp.com/api/accounts/7/', 'https://bank-account-microservice.herokuapp.com/api/accounts/8/']}]
  • delete_account()

    • Accepts an account id as a parameter and deletes that account.

    CALL: print(delete_account(5))
    OUTPUT:

 <Response [204]>
  • delete_user()

    • Accepts a user id as a parameter and deletes that user.

    CALL: print(delete_user(4))
    OUTPUT:

  <Response [204]>
  • create_account()

    • Creates a new account. 5 paramaters are accepted: customer_id (number), account_type (string), balance (number), interest_rate (number), and account_opened (datetime). All are required, except for account_opened, which will default to datetime.now().

    CALL: print(create_account(customer_id=1,account_type='savings', balance=4500, interest_rate=2.55))
    OUTPUT:

{'id': 10, 'customer': 1, 'account_type': 'savings', 'balance': '4500.00', 'interest_rate': '2.55', 'account_opened': '2018-12-31T09:58:54.183647Z'}
  • create_user()

    • Creates a new user. Parameters "username" and "email" are both strings, and are both required. The given username and email must pass all validation requirements for usernames and emails.

    CALL: print(create_user(username='sample_user', email='sample@user.net'))
    OUTPUT:

{'url': 'https://bank-account-microservice.herokuapp.com/api/users/6/', 'username': 'sample_user', 'email': 'sample@user.net', 'accounts': []}
  • modify_account()

    • Modifies an existing account. The first parameter given is the id of the account you wish to modify. All of the parameters given in create_account() are modifiable. If a new value is not specified in the parameter list then that value will not be modified.

    CALL: print(modify_account(10, account_type='checking', interest_rate=3.8))
    OUTPUT:

<Response [200]>
  • modify_user()

    • Modifies an existing user. The first parameter given is the id of the user you wish to modify. All of the parameters given in create_user() are modifiable. If a new value is not specified in the parameter list then that value will not be modified.

    CALL: print(modify_user(6, username='sample_user_modified', email='sample@user.modified'))
    OUTPUT:

 <Response [200]>  

Metadata

Release files for bamlib 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for bamlib 0.0.1
File Interpreter ABI Platform
bamlib-0.0.1-py3-none-any.whl Python 3 none any Details

Release files / bamlib-0.0.1-py3-none-any.whl

Download URL bamlib-0.0.1-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f51217d37ae2773c93d6f188858e0d2cdc45463e932e4f6120826fce9792c7d7
BLAKE2b-256 checksum
How to use checksums
8e0b51b6d54b0241949d6862467569179f422ad9d1fbb0dd635ba8de8b1d184e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page