Skip to main content

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

swapcoffee_tokens-1.0.3.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

swapcoffee_tokens-1.0.3-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file swapcoffee_tokens-1.0.3.tar.gz.

File metadata

  • Download URL: swapcoffee_tokens-1.0.3.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

Hashes for swapcoffee_tokens-1.0.3.tar.gz
Algorithm Hash digest
SHA256 a411e9c494444cc6ea00c73cae113f0cd98cd744e8fae78c1b9797e4735c123b
MD5 39d82ea976e7cf46e1364edde755efed
BLAKE2b-256 2200432daa1fabf7c00f8b7b32cb63fc85084d899643547d21b305e97516f095

See more details on using hashes here.

Provenance

The following attestation bundles were made for swapcoffee_tokens-1.0.3.tar.gz:

Publisher: pypi-release.yml on py-stollen/swapcoffee-tokens

Attestations:

File details

Details for the file swapcoffee_tokens-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for swapcoffee_tokens-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7ef25167c6f09ac51cc8cbfee3477adee9e5f2c24d721e95977e54eeb3b0de63
MD5 d9ab2216fe24089520c87b39a14fe547
BLAKE2b-256 fdd413ccafd14c692f8ba35b2c84c40faf5a8156d75bb21a0a7790db6f2197fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for swapcoffee_tokens-1.0.3-py3-none-any.whl:

Publisher: pypi-release.yml on py-stollen/swapcoffee-tokens

Attestations:

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