We will soon be publishing the library to a public repository on PyPI. For now, you can pull the code with github as sumbodule and install it locally. To do this, run the following commands:
git submodule add git@github.com:fireflyprotocol/pro-sdk.git submodules/pro-sdkNOTE: Due to a limitation you need to use python version 3.13 or older.
then using pip, install the SDK locally here is example pip requirements.txt contents:
./submodules/pro-sdk/python/sdk
Run pip install to install the SDK locally:
pip install -r requirements.txtExamples of usage are in the python/example directory. The example is a simple script that
Change into the sdk directory, and run the following commands to set up your
virtual environment and install the requirements, then the testing dev
requirements:
# Or use poetry from the directory `sdk`. Run the following commands to
# install poetry if needed.
pipx install poetry
# Set it to use python3.13 (making sure you have python 3.13 installed).
# If you don't have python 3.13 installed, you can use pyenv to install it:
# pyenv install 3.13
# From the `python` directory, run the following commands:
python3.13 -m venv .venv
source .venv/bin/activate
poetry installIf you are using IntelliJ, make sure to configure it to point to the virtual env
executable under .venv/bin/python created from previous commands. The example
directory contains a main method that fully runs the SDK functions.
Now you can run the example in the ./example dir by running python main.py.
poetry run pytest
The OpenAPI client code in the sdk/src directory is automatically generated using the OpenAPI Generator.
To regenerate the client code, run (from the sdk directory):
openapi-generator generate -i ../../resources/bluefin-api.yaml -c config.yaml -g python -o srcThis will:
- Use the OpenAPI spec from
../../resources/bluefin-api.yaml - Apply configuration from
config.yaml - Generate a Python client
- Output the generated code to the
srcdirectory