Python implementation of Uniswaps' tokenlists
Project description
py-tokenlists
Uniswap Token Lists implementation in Python.
Dependencies
- python3 version 3.8 or greater, python3-dev
Installation
via pip
You can install the latest release via pip:
pip install tokenlists
via setuptools
You can clone the repository and use setuptools for the most up-to-date version:
git clone https://github.com/ApeWorX/py-tokenlists.git
cd py-tokenlists
python3 setup.py install
Quick Usage
>>> from tokenlists import TokenListManager
>>> tlm = TokenListManager()
>>> tlm.available_tokenlists()
[]
>>> tlm.install_tokenlist("tokens.1inch.eth")
>>> tlm.available_tokenlists()
['1inch']
You can also author and test your own token list locally before publishing it:
tokenlists new ./tokenlist.json --name "My Token List" --keyword defi --keyword dex
tokenlists add ./tokenlist.json --chain-id 1 --address 0x0000000000000000000000000000000000000001 --name "Token" --symbol TKN --decimals 18 --tag stablecoin
tokenlists install ./tokenlist.json
If you omit required options from tokenlists new or tokenlists add, the CLI will prompt for the missing values. When a token is added to a list, the list timestamp is refreshed and the semantic version is bumped from major.minor.patch to the next minor version, following the token list update rules for additive changes.
Publishing is simply serving the generated JSON somewhere reachable by your users. Once hosted, install and verify it with tokenlists install <url>.
Token lookup order is controlled locally through pyproject.toml:
[tool.tokenlists]
order = ["My Preferred List", "Fallback List"]
HTTP downloads use httpx and honor the standard environment variables that HTTPX documents for restricted networks and custom trust stores, including HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, NO_PROXY, SSL_CERT_FILE, and SSL_CERT_DIR.
License
This project is licensed under the MIT license.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tokenlists-0.2.0.tar.gz.
File metadata
- Download URL: tokenlists-0.2.0.tar.gz
- Upload date:
- Size: 26.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8fc925636489f6408a651cbc3252e6d6a31e7bd3413b2553c878d977884f0945
|
|
| MD5 |
75d1ce6e655657c95ae9362eea68d54b
|
|
| BLAKE2b-256 |
f3b8562e3ca8dcdf390073ed040263e3dbac79a3b4a3557c75a655e7816e6c42
|
Provenance
The following attestation bundles were made for tokenlists-0.2.0.tar.gz:
Publisher:
publish.yml on ApeWorX/py-tokenlists
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tokenlists-0.2.0.tar.gz -
Subject digest:
8fc925636489f6408a651cbc3252e6d6a31e7bd3413b2553c878d977884f0945 - Sigstore transparency entry: 1282835167
- Sigstore integration time:
-
Permalink:
ApeWorX/py-tokenlists@c1d09bbee6f34a2a16668e79f09298b97cda12e8 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/ApeWorX
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c1d09bbee6f34a2a16668e79f09298b97cda12e8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file tokenlists-0.2.0-py3-none-any.whl.
File metadata
- Download URL: tokenlists-0.2.0-py3-none-any.whl
- Upload date:
- Size: 16.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0963a6a7a2920408cdc744047885f197e6e654286a6eb651f361adde5c2bad76
|
|
| MD5 |
324926882f475bdfbda97ba4bb8a18e7
|
|
| BLAKE2b-256 |
41e63451de8200e10baf23cddf0fb8590d001ca63877aa81c96dd6d65c5b4dbb
|
Provenance
The following attestation bundles were made for tokenlists-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on ApeWorX/py-tokenlists
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tokenlists-0.2.0-py3-none-any.whl -
Subject digest:
0963a6a7a2920408cdc744047885f197e6e654286a6eb651f361adde5c2bad76 - Sigstore transparency entry: 1282835173
- Sigstore integration time:
-
Permalink:
ApeWorX/py-tokenlists@c1d09bbee6f34a2a16668e79f09298b97cda12e8 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/ApeWorX
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c1d09bbee6f34a2a16668e79f09298b97cda12e8 -
Trigger Event:
release
-
Statement type: