A lightweight tokens.swap.coffee API Python wrapper
Project description
Installation
pip install -U swapcoffee-tokens
Simple example
import asyncio
import logging
from swapcoffee.tokens import SwapCoffee
from swapcoffee.tokens.types import BlockchainToken
async def main() -> None:
logging.basicConfig(level=logging.DEBUG)
coffee: SwapCoffee = SwapCoffee()
tokens: list[BlockchainToken] = await coffee.get_tokens_by_symbols(symbols=["NOT", "DMT"])
for token in tokens:
logging.info("Token %s ($%s) costs %s USD", token.name, token.symbol, token.price_usd)
await coffee.session.close()
if __name__ == "__main__":
asyncio.run(main())
Donations
TON: UQAYJ1terNmvoBh26Xi7tLa_P4t_OGMZOXBUfDB2mLMGuVMb USDT TRC20: TGr2J3Pi6WmcexwmGFJDHLqrrhDoe2U6w6
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
Built Distribution
File details
Details for the file swapcoffee_tokens-1.0.2.tar.gz
.
File metadata
- Download URL: swapcoffee_tokens-1.0.2.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ac8973dc2920185593aebc853f1b205728ab4b3718dc06f60d24b922994508b |
|
MD5 | fb1c7cb199e9dad6400b35310c2dce25 |
|
BLAKE2b-256 | 7bd2d44912eb204d67573a3d0ee071760c6058559969b772c622c9d03df1198b |
Provenance
The following attestation bundles were made for swapcoffee_tokens-1.0.2.tar.gz
:
Publisher:
pypi-release.yml
on py-stollen/swapcoffee-tokens
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
swapcoffee_tokens-1.0.2.tar.gz
- Subject digest:
5ac8973dc2920185593aebc853f1b205728ab4b3718dc06f60d24b922994508b
- Sigstore transparency entry: 147576190
- Sigstore integration time:
- Predicate type:
File details
Details for the file swapcoffee_tokens-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: swapcoffee_tokens-1.0.2-py3-none-any.whl
- Upload date:
- Size: 15.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c25568eaf316a8f0fb33529b05f5811291166b2570f04979b9e6c1a4f0f2739 |
|
MD5 | bfa3ebecdb1c9ce1d5cef0167b27ecf6 |
|
BLAKE2b-256 | 83065a412563dda8c2771a32e29039bf95f60ea6179f540890d2085bf17c9f35 |
Provenance
The following attestation bundles were made for swapcoffee_tokens-1.0.2-py3-none-any.whl
:
Publisher:
pypi-release.yml
on py-stollen/swapcoffee-tokens
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
swapcoffee_tokens-1.0.2-py3-none-any.whl
- Subject digest:
8c25568eaf316a8f0fb33529b05f5811291166b2570f04979b9e6c1a4f0f2739
- Sigstore transparency entry: 147576194
- Sigstore integration time:
- Predicate type: