A Python client for the Drift DEX
Project description
DriftPy
DriftPy is the Python client for the Drift protocol. It allows you to trade and fetch data from Drift using Python.
Installation
pip install driftpy
Note: requires Python >= 3.9.
Examples
Development
Development Setup
If you want to contribute to DriftPy, follow these steps to get set up:
- Install poetry
- Install dev dependencies:
poetry install
- Install nox-poetry (note: do not use Poetry to install this, see here)
- Activate the poetry shell:
poetry shell
Testing
- Run
make test
. - Run
make lint
.
Building the docs
Run mkdocs serve
to build the docs and serve them locally.
Updating the embedded IDLs
DriftPy ships with IDL files for the user's convenience. These live at src/driftpy/idl
if you need to update them.
Releasing a new version of the package
- 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.
Updating the drift-core
subtree
- This repo pulls in the main Drift repo using git subtree. Follow that linked tutorial if you want to see how it was done.
The short answer:
git subtree pull --prefix drift-core drift-protocol mainnet-beta --squash
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
driftpy-0.5.2.tar.gz
(25.9 kB
view details)
Built Distribution
driftpy-0.5.2-py3-none-any.whl
(29.0 kB
view details)
File details
Details for the file driftpy-0.5.2.tar.gz
.
File metadata
- Download URL: driftpy-0.5.2.tar.gz
- Upload date:
- Size: 25.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.10 CPython/3.9.12 Linux/5.13.0-1017-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51e0a55ba7f323709497b8e134df5c374a7a302ac3805a2c2f5c4efc5a06ff16 |
|
MD5 | f61c415736c4917f40bf9c8db9267262 |
|
BLAKE2b-256 | 066917dbe4ec235f0f465a478d48ab1d65459428ca0325a9c8fa4620f0d6196b |
File details
Details for the file driftpy-0.5.2-py3-none-any.whl
.
File metadata
- Download URL: driftpy-0.5.2-py3-none-any.whl
- Upload date:
- Size: 29.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.10 CPython/3.9.12 Linux/5.13.0-1017-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7a08d1ef6e38ba71813b2928d4720f8a5883ff7889868a7bff1dca08c2c412c |
|
MD5 | 6f9b3529f1e5f19d6e1805e83098c605 |
|
BLAKE2b-256 | 4b3c16267df15e3a040947ff29e70238ebba9036a664910e91d2e50a55b82b67 |