A python wrapper to the Bullish Exchange API. Documentation for the API can be found here
To install the library during development run the command:
pip install -e .
To install the library using a virtual enviornment run:
mkdir -p ~/envs
python3 -m venv ~/envs/test
source ~/envs/test/bin/activate
pip install git+https://github.com/bullish-exchange/py-bullish.git@develop
Note git ssh keys must be setup
A directory of example scripts. All of the scripts use a config.py module that requires the following lines:
To run the tests do the following:
- Create a bullish_config.py file in the tests directory
- Ensure
tox
andpython3.9
are installed on the system - Run the tests
tox
# truncated output
tests/login/test_login.py .. [100%]
========================================================== 2 passed in 3.22s ===========================================================
_______________________________________________________________ summary ________________________________________________________________
py39: commands succeeded
congratulations :)
Both the tests and scripts require that certain environment variables be set. Below is an example environment file.
# .env
# private api key
export BULLISH_KEY="PVT_R1_L...."
# metadata string generated at addition of API key
export BULLISH_METADATA="eyJwdWJsaWNLZXkiOi..."
# hostname of api
export BULLISH_HOSTNAME="https://api.uat.vdevel.net"
Environment file must be sourced to add to the environment
source .env
The bullish
library uses the logging library for logging output. It can be turned on using the following code:
logging.basicConfig()
bullish_log = logging.getLogger("bullish.bullish")
bullish_log.setLevel(logging.DEBUG)