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 module 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.9.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

pydefillama-1.0.9-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pydefillama-1.0.9.tar.gz
  • Upload date:
  • Size: 5.3 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.9.tar.gz
Algorithm Hash digest
SHA256 7d407599d1dad84d0a8e96a20cbb11798fc95958667eee9b28b5319834d0ea57
MD5 3a2540e48cb79ac6448d30eb98afe541
BLAKE2b-256 1e845aa97a83f9f4650dc98a94a591d9646d9c4089058e79663390f9a5108121

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pydefillama-1.0.9-py3-none-any.whl
  • Upload date:
  • Size: 6.1 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.9-py3-none-any.whl
Algorithm Hash digest
SHA256 40a96ea5e19ac04b532b11878ca28811ff0643a3171bbeecd3a57c995aa08b58
MD5 2737208e982f3a8e0654e755c666ad87
BLAKE2b-256 2836aa7befbb5930caaa987285f55a06317f3d090da68d72503f0c50bde581dc

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