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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file driftpy-0.4.1.tar.gz.

File metadata

  • Download URL: driftpy-0.4.1.tar.gz
  • Upload date:
  • Size: 21.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.10 CPython/3.9.10 Linux/5.11.0-1028-azure

File hashes

Hashes for driftpy-0.4.1.tar.gz
Algorithm Hash digest
SHA256 0df3ef5b0abef42dc47918b37dbfb8cdf684dc8a31500544caa24dc0e0f38c6a
MD5 d750180c2ea8808fe6805c5ba2b4463e
BLAKE2b-256 dec8b5b25f9e17cc7b70e4a0c317161bb47ea37a5747cce43eddc8384d4021c1

See more details on using hashes here.

File details

Details for the file driftpy-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: driftpy-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 24.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.10 CPython/3.9.10 Linux/5.11.0-1028-azure

File hashes

Hashes for driftpy-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1984518091ab839eb4b347f8383e357e9e43941f069797fb5dcad301e828f04a
MD5 fbb3ef55339fb15e215e5931a5357c13
BLAKE2b-256 447b354ff3568fd234e254a6130dca50dfc64ac2b68fe9147964f05292a6abf3

See more details on using hashes here.

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