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.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gheymat-0.4.0.tar.gz.
File metadata
- Download URL: gheymat-0.4.0.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bfaa2a15a139ff306099b8ba5fea819536b3a794549b49e62c3a296bd1c58bb
|
|
| MD5 |
131473a9c91aa0a1eb6140e70a4d74c3
|
|
| BLAKE2b-256 |
1f9aef18c19c1f66e92ff91cd485f4910320a5c30905b1df6d812c63e4860119
|
File details
Details for the file gheymat-0.4.0-py3-none-any.whl.
File metadata
- Download URL: gheymat-0.4.0-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79e10dfaf3ed84a47f5f46953b3f32ee9ff28d4a2614793cf03665f803a1674b
|
|
| MD5 |
46112dbf9388504330c95ea25aba52f0
|
|
| BLAKE2b-256 |
b94b72109dee34f469998c20fc9157fa540f89a2216e027e62f45a48409f0f75
|