Gheymat
A simple Python package for getting live prices of currencies, cryptocurrencies, gold, coins, and precious metals.
If this package is useful for you, you can support me with a coffee ☕😁
https://www.coffeebede.com/mrrobat
Installation
pip install gheymat
Supported Prices
Currencies
| Currency | Value |
|---|---|
| US Dollar | usd |
| British Pound | gbp |
| Euro | eur |
| Turkish Lira | try |
| UAE Dirham | aed |
| Chinese Yuan | cny |
| Indian Rupee | inr |
| Swedish Krona | sek |
| Omani Rial | omr |
Cryptocurrencies
| Cryptocurrency | Value |
|---|---|
| Bitcoin | btc |
| Ethereum | eth |
| Dogecoin | doge |
| Solana | sol |
| Tron | tron |
| Ripple | ripp |
| Dash | dash |
| Litecoin | lite |
| Stellar | stell |
| Toncoin | ton |
Gold, Coins, and Metals
| Item | Value |
|---|---|
| 18K Gold | gold18 |
| 24K Gold | gold24 |
| Used Gold | used_gold |
| Emami Coin | seke_emam |
| Bahar Azadi Coin | seke_bahar |
| 999 Silver | silver |
Usage in Python
Currency Prices
Import get_price from gheymat.currency.
from gheymat.currency import get_price
Get US Dollar Price in Toman
dollar_price = get_price("usd", toman=True)
print(dollar_price)
Get Euro Price in Rial
euro_price = get_price("eur", toman=False)
print(euro_price)
Get Pound Price With Commas
pound_price = get_price("gbp", toman=True, beauty=True)
print(pound_price)
# Example output:
# 1,520,000
Currency Function Parameters
get_price(currency="usd", toman=True, beauty=False)
| Parameter | Default | Description |
|---|---|---|
currency |
"usd" |
Currency value. Example: "usd", "eur", "gbp", or "aed". |
toman |
True |
If True, returns the price in Toman. If False, returns the price in Rial. |
beauty |
False |
If True, returns the price as a formatted string with commas. |
Currency values are not case-sensitive:
get_price("usd")
get_price("USD")
get_price("Usd")
All of them work the same.
Cryptocurrency Prices
Import get_price from gheymat.crypto.
from gheymat.crypto import get_price
Get Bitcoin Price in USD
bitcoin_price = get_price("btc", toman=False)
print(bitcoin_price)
Get Bitcoin Price in Toman
bitcoin_price = get_price("btc", toman=True)
print(bitcoin_price)
Get Ethereum Price in Toman With Commas
ethereum_price = get_price("eth", toman=True, beauty=True)
print(ethereum_price)
# Example output:
# 302,500,000
Cryptocurrency Function Parameters
get_price(crypto="btc", toman=True, beauty=False)
| Parameter | Default | Description |
|---|---|---|
crypto |
"btc" |
Crypto value. Example: "btc", "eth", "doge", or "ton". |
toman |
True |
If True, returns the price in Toman. If False, returns the price in USD. |
beauty |
False |
If True, returns the price as a formatted string with commas. |
Note:
TONprice is received from CoinMarketCap. Other supported cryptocurrencies are received from TGJU.
TON Configuration
To get the price of Toncoin (ton), you need a CoinMarketCap API key.
Create an API key from CoinMarketCap and set it as an environment variable named:
COINMARKETCAP_API_KEY
Windows PowerShell
$env:COINMARKETCAP_API_KEY="your_api_key"
Git Bash
export COINMARKETCAP_API_KEY="your_api_key"
Then use TON normally:
from gheymat.crypto import get_price
ton_price = get_price("ton", toman=True, beauty=True)
print(ton_price)
Do not put your API key directly in your source code or upload it to GitHub.
Gold, Coin, and Metal Prices
Import get_price from gheymat.metal.
from gheymat.metal import get_price
Get 18K Gold Price in Toman
gold_price = get_price("gold18", toman=True)
print(gold_price)
Get Emami Coin Price With Commas
emami_coin_price = get_price("seke_emam", toman=True, beauty=True)
print(emami_coin_price)
Get Silver Price in Rial
silver_price = get_price("silver", toman=False)
print(silver_price)
Metal Function Parameters
get_price(metal="gold18", toman=True, beauty=False)
| Parameter | Default | Description |
|---|---|---|
metal |
"gold18" |
Metal or coin value. Example: "gold18", "silver", or "seke_emam". |
toman |
True |
If True, returns the price in Toman. If False, returns the price in Rial. |
beauty |
False |
If True, returns the price as a formatted string with commas. |
Usage in Terminal
You can also use Gheymat directly in your terminal.
Currency
python -m gheymat.currency usd --toman
Get the price in Rial:
python -m gheymat.currency eur --rial
Get a formatted price:
python -m gheymat.currency gbp --toman --beauty
Cryptocurrency
Get Bitcoin price in USD:
python -m gheymat.crypto btc --usd
Get Bitcoin price in Toman:
python -m gheymat.crypto btc --toman
Get formatted Ethereum price in Toman:
python -m gheymat.crypto eth --toman --beauty
Get TON price in Toman:
python -m gheymat.crypto ton --toman --beauty
Gold, Coin, and Metal
Get 18K gold price in Toman:
python -m gheymat.metal gold18 --toman
Get Emami coin price with commas:
python -m gheymat.metal seke_emam --toman --beauty
Get silver price in Rial:
python -m gheymat.metal silver --rial --beauty
Terminal Help
Use --help to see all available options.
python -m gheymat.currency --help
python -m gheymat.crypto --help
python -m gheymat.metal --help
Notes
- Prices are collected from online sources and may change at any time.
- Currency, gold, coin, metal, and most crypto prices are collected from TGJU.
- TON price is collected from CoinMarketCap.
- This package depends on the structure and availability of source websites.
- If a source website changes its HTML structure or API, the package may need an update.
- Use returned prices for informational purposes only.
- When
beauty=True, the returned value is astr. - When
beauty=False, the returned value is usually anintorfloat.
Support
If you like this package and want to support its development, you can buy me a coffee ☕😁
https://www.coffeebede.com/mrrobat
License
This project is available under the MIT License.
Metadata
Release files for gheymat 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gheymat-0.4.0.tar.gz | 7.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gheymat-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.1 kB
Release files / gheymat-0.4.0.tar.gz
| Download URL | gheymat-0.4.0.tar.gz |
|---|---|
| Size | 7.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9bfaa2a15a139ff306099b8ba5fea819536b3a794549b49e62c3a296bd1c58bb
|
|
BLAKE2b-256 checksum How to use checksums |
1f9aef18c19c1f66e92ff91cd485f4910320a5c30905b1df6d812c63e4860119
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.11
|
Release files / gheymat-0.4.0-py3-none-any.whl
| Download URL | gheymat-0.4.0-py3-none-any.whl |
|---|---|
| Size | 8.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
79e10dfaf3ed84a47f5f46953b3f32ee9ff28d4a2614793cf03665f803a1674b
|
|
BLAKE2b-256 checksum How to use checksums |
b94b72109dee34f469998c20fc9157fa540f89a2216e027e62f45a48409f0f75
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.11
|