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.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

swapcoffee_tokens-1.0.0-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: swapcoffee_tokens-1.0.0.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.0.tar.gz
Algorithm Hash digest
SHA256 3a298a1b70ed8bb9240ad3e7724a313e4b45b84578809d83b5f1cdb215a454f5
MD5 7d7346545c3c288fbecb1e0dbeb80476
BLAKE2b-256 9b5bd489e0e844586d2525c694ec6d6380905e3cd3f1c254e16b0251d47f2ded

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for swapcoffee_tokens-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 509e07adf4e7765bd8e20150d8e1f5a77223f1975da21a9f9808c6c362524014
MD5 042cb79453be387db29d7e2beb412816
BLAKE2b-256 5d07c9191b764bc01b2e7462f368fc6945d417a2e9cfeec9c3c3f0261f523310

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