Skip to main content

GBM Plus API Python Library

Project description

GBM Plus API Python Library

The GBM Plus API Python library aims to provide all current API calls to interface with the GBM Plus/Homebroker platform.

Setup

  1. Get the CLIENT_ID from the GBM Plus login dashboard where to find client id screenshot

  2. Keep your USER_EMAIL, USER_PASSWORD and CLIENT_ID safe and secure. You can use environment variables for development.

  3. Install the latest version of Python 3

  4. Clone this repository

git clone https://github.com/markzuckerbergas/gbmplus-api-python
  1. Install requirements
pip install -r requirements.txt

Usage

  1. Export your USER_EMAIL, USER_PASSWORD and CLIENT_ID as environment variables, for example:

    Linux

    export USER_EMAIL="xxxxxx@xxxxx.com"
    export USER_PASSWORD="shabadabadashabadabadaenelcentrodelplaneta"
    export CLIENT_ID="xxxxxxxxxxxxxxxxxxx"
    

    Windows Powershell

    $env:USER_EMAIL="xxxxxx@xxxxx.com"
    $env:USER_PASSWORD="shabadabadashabadabadaolvidadoenlabanqueta"
    $env:CLIENT_ID="xxxxxxxxxxxxxxxxxxx"
    
  2. Alternatively, define your USER_EMAIL, USER_PASSWORD and CLIENT_ID as variables in your source code; this method is not recommended due to its inherent insecurity.

  3. Create a new Python file inside the cloned directory (for example, main.py). Single line of code to import and use the library goes at the top of your script:

    import gbmplus
    
  4. Instantiate the client (API consumer class), optionally specifying any of the parameters available to set:

    trader_object = gbmplus.GBMPlusAPI(output_log=False)
    
  5. Make API calls in your source code, using the format client.scope.operation, where client is the name you defined in the previous step (trader_object above), scope is the corresponding scope that represents a module, and operation is the operation of the API endpoint. For example, to make a call to get the list of Accounts (or Strategies), use this function call:

    accounts = trader_object.accounts.getAccounts()
    print(accounts)
    

Examples

You can find working example scripts in the examples folder.

Script Purpose
transfer.py Transfer from the Smart Cash strategy to a target strategy

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

gbmplus-0.1.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gbmplus-0.1-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file gbmplus-0.1.tar.gz.

File metadata

  • Download URL: gbmplus-0.1.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for gbmplus-0.1.tar.gz
Algorithm Hash digest
SHA256 9052ea1942b5ed2d08fd6e2e26ed84cbb7863e872960ef0d6a04a86de178e43f
MD5 fbdf6c9832767026e58ac46aee9bf745
BLAKE2b-256 1e3569501a964585079196f7cb1f6ae0f428bb40539c74cb61a17910dd5363e6

See more details on using hashes here.

File details

Details for the file gbmplus-0.1-py3-none-any.whl.

File metadata

  • Download URL: gbmplus-0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for gbmplus-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7a5c7820491694894aba48bc51f76701d17169010cda90928dacbad4b78aa166
MD5 e2b45d0b65c09e1e4244927ba2fc1a99
BLAKE2b-256 ea16fa2677fe8d936f46092c1986affb86f72a9a9cfb3c96a59607a4ff406bfa

See more details on using hashes here.

Supported by

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