Skip to main content

No project description provided

Project description



Documentation

Description:

This Python library provides functionalities to get cryptocurrency prices and perform conversions between Iranian Toman (IRT) and USD, for 15 supported cryptocurrencies.

Key Features:

  • Get the current price of various cryptocurrencies in IRT or USD.

  • Convert between IRT and USD for any of the supported cryptocurrencies.

  • Donate to the library developer (optional).

Supported Cryptocurrencies:

TON

BTC

ETH

USDT

SHIB

BNB

DOGE

ADA

SOL

XRP

USDC

ETC

PEPE

ATM

BISO

Installation

pip install YnExchangePY

Functionality

The library provides functions for retrieving the price of 15 cryptocurrencies. Each function takes two arguments:

  • currency (str): This argument specifies the desired currency (either "IRT" or "USD").

  • grouping (bool, optional): This argument is optional (defaults to False). If set to True, the function will format the price with comma separators for readability.

Here's a list of all the available functions:

  • yn_exchange.TON_PRICE(currency, grouping=False)

  • yn_exchange.BTC_PRICE(currency, grouping=False)

  • yn_exchange.ETH_PRICE(currency, grouping=False)

  • yn_exchange.USDT_PRICE(currency, grouping=False)

  • yn_exchange.SHIB_PRICE(currency, grouping=False)

  • yn_exchange.BNB_PRICE(currency, grouping=False)

  • yn_exchange.DOGE_PRICE(currency, grouping=False)

  • yn_exchange.ADA_PRICE(currency, grouping=False)

  • yn_exchange.SOL_PRICE(currency, grouping=False)

  • yn_exchange.XRP_PRICE(currency, grouping=False)

  • yn_exchange.USDC_PRICE(currency, grouping=False)

  • yn_exchange.ETC_PRICE(currency, grouping=False)

  • yn_exchange.PEPE_PRICE(currency, grouping=False)

  • yn_exchange.ATM_PRICE(currency, grouping=False)

Example Usage

from YN_Exchange import yn_exchange



# Get Bitcoin price in USD with comma separators

bitcoin_usd_price = yn_exchange.BTC_PRICE("USD", grouping=True)

print(f"Bitcoin price in USD: ${bitcoin_usd_price}")



# Get Ethereum price in IRT

ethereum_irt_price = yn_exchange.ETH_PRICE("IRT")

print(f"Ethereum price in IRT: {ethereum_irt_price}")

Error Handling

If the function encounters an error, such as an invalid currency or a network issue, it will raise a ValueError exception. You can handle this exception using a try-except block.

Limitations

  • The library relies on scraping data from a website, which may be subject to changes or become unavailable.

  • The library only supports a limited number of cryptocurrencies (currently 15).

Additional notes

Here are some ways you can contribute to the YN_Exchange project:

  • Donate: If you've found my library to be useful, I would greatly appreciate it if you would consider making a donation. Your donation will help me to continue to develop and maintain the library, and to add new features in the future.

Donate function

yn_exchange.donate()

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

YnExchangePY-3.2.2.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

YnExchangePY-3.2.2-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file YnExchangePY-3.2.2.tar.gz.

File metadata

  • Download URL: YnExchangePY-3.2.2.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.0

File hashes

Hashes for YnExchangePY-3.2.2.tar.gz
Algorithm Hash digest
SHA256 5aba0d6d8e5856e21c98a5e1b7a8fb15a0c21ecd1a1cc176b6c0da5c567d4ea8
MD5 b5fc404af4483e52f08253907de165f8
BLAKE2b-256 78dd43965596dd2b7de26da03f1a12e21ea992dd537c35efff1ad7d44e804357

See more details on using hashes here.

File details

Details for the file YnExchangePY-3.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for YnExchangePY-3.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 33aae3de513771fc22d8edbd68a41f646c76027c941193989ac376e1d2399b2d
MD5 c0cddb641e70eec4b01b765bd6565c47
BLAKE2b-256 4d15f4163e0848d2f404582ca9bb12c168d460787c95ba2b99b7c834b98e7c3c

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