Skip to main content

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.

Read The Documentation

Installation

pip install driftpy

Note: requires Python >= 3.9.

Development

Development Setup

If you want to contribute to DriftPy, follow these steps to get set up:

  1. Install poetry
  2. Install dev dependencies:
poetry install
  1. Install nox-poetry (note: do not use Poetry to install this, see here)
  2. Activate the poetry shell:
poetry shell

Testing

  1. Run make test.
  2. 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

  1. Make sure CHANGELOG.md is updated.
  2. Run bumpversion major|minor|patch to update the version number locally and create a tagged commit.
  3. Run git push origin <version_number> to push the tag to GitHub.
  4. 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

This version

0.4.1

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.4.1.tar.gz (21.3 kB view hashes)

Uploaded Source

Built Distribution

driftpy-0.4.1-py3-none-any.whl (24.9 kB view hashes)

Uploaded Python 3

Supported by

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