Skip to main content

Python Wrapper for DefiLlama endpoints

Project description

pydefillama: a DefiLlama Python client

PyPi PyPi

An unofficial DeFiLlama wrapper built for data science workflows.

For detailed instructions on the endpoints, refer to the API docs.

Installation

pip install pydefillama

Usage

import pydefillama as llama

# fetch all protocols
protocols = llama.fetch_all_protocols()

# fetch TVL for a protocol
llama.fetch_protocol_tvl(protocols[0]["slug"])

# fetch all chains
chains = llama.fetch_all_chains()

# fetch TVL for a chain
llama.fetch_chain_tvl(chains["name"])

Full list of supported functions here.

Run Tests

python -m unittest discover

Developing Locally

# install module without pip
python setup.py develop

# run shell to play around
ipython

# import and use module in python shell
import pydefillama as llama
...

Contributing

If you would like to contribute to this project, please open an issue or submit a PR. While we are open to all contributions, we would like to keep this project focused on data science workflows, which is why functions often return a pandas dataframe. If you would like to use this API for other purposes, please consider forking this repo.

Maintainers

To push to PyPi, follow the following steps:

  • Update version in setup.py
  • Push to main branch
  • Run ./updatepip.sh

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

We are thankful for the DefiLlama team for providing this open API. If you would like to support them, consider donating to them here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydefillama-1.0.7.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

pydefillama-1.0.7-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file pydefillama-1.0.7.tar.gz.

File metadata

  • Download URL: pydefillama-1.0.7.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for pydefillama-1.0.7.tar.gz
Algorithm Hash digest
SHA256 ba4df73f3c34624671d18725910b929c368ab81a32bb2435a1de563f1010c591
MD5 90264db41911095cb332fb3509718d82
BLAKE2b-256 6ab75a54e1e61496156e2dac011b2820ce313589721f4d94dcc0fd44eb30720b

See more details on using hashes here.

File details

Details for the file pydefillama-1.0.7-py3-none-any.whl.

File metadata

  • Download URL: pydefillama-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for pydefillama-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 abe1bb19567fa7323f88dfe265df5b242a5258498137d61856a95928bf592398
MD5 0710a97ab9100da4c3da38672fec9000
BLAKE2b-256 8eeb2d2e31bce7d698446f67e04f5d2f9831b7e42a613c464ac55508d2b974e3

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