DriftPy is the Python client for the Drift protocol. It allows you to trade and fetch data from Drift using Python.
pip install driftpy
Note: requires Python >= 3.9.
git submodule init/update
- cd protocol-v2 && yarn
- cd sdk && yarn && yarn build && cd ..
- anchor build
- update anchor IDL for v2 protocol on new re-builds (copy new idls to src/driftpy/idl/...json)
- run python tests:
pytest -v -s -x v2tests/test.py
If you want to contribute to DriftPy, follow these steps to get set up:
- Install poetry
- Install dev dependencies (in local env):
poetry install
bash test.sh v2tests/test.py
Run mkdocs serve
to build the docs and serve them locally.
- Make sure CHANGELOG.md is updated.
- Run
bumpversion major|minor|patch
to update the version number locally and create a tagged commit. - Run
git push origin <version_number>
to push the tag to GitHub. - After merging your PR on GitHub, create a new release at https://github.com/drift-labs/driftpy/releases. The CI process will upload a new version of the package to PyPI.