Metadata-Version: 2.4
Name: gheymat
Version: 0.3.9
Summary: کتابخانه‌ای برای دریافت قیمت ارزها و طلا و...
Author-email: Ali Heydari <imrrobat@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/imrrobat/gheymat
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Requires-Dist: beautifulsoup4
Dynamic: license-file

# 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

![Downloads](https://static.pepy.tech/personalized-badge/gheymat?period=total&units=international_system&left_color=black&right_color=green&left_text=Downloads)

---

## Installation

```bash
pip install gheymat
```

---

## Supported Prices

### Currencies

| Currency | Symbol |
| --- | --- |
| 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 | Symbol |
| --- | --- |
| 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 | Symbol |
| --- | --- |
| 18K Gold | `GOLD18` |
| 24K Gold | `GOLD24` |
| Used Gold | `USED_GOLD` |
| Emami Coin | `SEKE_EMAM` |
| Bahar Azadi Coin | `SEKE_BAHAR` |
| 999 Silver | `SILVER` |

---

## Usage

## Get Currency Prices

You can use the new `get_price()` function to get the price of any supported currency.

```python
from gheymat.currency import get_price
```

### Get US Dollar Price in Toman

```python
dollar_price = get_price("usd", toman=True)
print(dollar_price)
```

### Get Euro Price in Rial

```python
euro_price = get_price("eur", toman=False)
print(euro_price)
```

### Get Pound Price With Commas

```python
pound_price = get_price("gbp", toman=True, beauty=True)
print(pound_price)

# Example output:
# 1,520,000
```

The currency name is not case-sensitive:

```python
get_price("usd")
get_price("USD")
get_price("Usd")
```

All of them work the same.

### `get_price()` Parameters

| Parameter | Default | Description |
| --- | --- | --- |
| `currency` | `"usd"` | Currency symbol. 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. |

Supported currency values:

```python
usd, gbp, eur, try, aed, cny, inr, sek, omr
```

---

## Old Currency Functions

The old functions are still available and will continue to work.

```python
from gheymat.currency import USD, EUR

dollar_price = USD(toman=True, beauty=False)
euro_price = EUR(toman=False, beauty=True)

print(dollar_price)
print(euro_price)
```

For new projects, using `get_price()` is recommended.

---

## Cryptocurrency Prices

You can get cryptocurrency prices with their own functions.

```python
from gheymat.crypto import BTC, ETH, DOGE

bitcoin_price = BTC(toman=True, beauty=True)
ethereum_price = ETH(toman=False)
dogecoin_price = DOGE(toman=True)

print(bitcoin_price)
print(ethereum_price)
print(dogecoin_price)
```

### Cryptocurrency Function Parameters

| Parameter | Default | Description |
| --- | --- | --- |
| `toman` | `True` | If `True`, returns the price in Toman. If `False`, returns the price in USD. |
| `beauty` | `False` | If `True`, returns a formatted string with commas. |

---

## Gold and Metal Prices

```python
from gheymat.metal import GOLD18, GOLD24, SEKE_EMAM, SILVER

gold_18_price = GOLD18(toman=True, beauty=True)
gold_24_price = GOLD24(toman=True)
emami_coin_price = SEKE_EMAM(toman=True, beauty=True)
silver_price = SILVER(toman=False)

print(gold_18_price)
print(gold_24_price)
print(emami_coin_price)
print(silver_price)
```

### Gold and Metal Function Parameters

| Parameter | Default | Description |
| --- | --- | --- |
| `toman` | `True` | If `True`, returns the price in Toman. If `False`, returns the price in Rial. |
| `beauty` | `False` | If `True`, returns a formatted string with commas. |

---

## Notes

- Prices are collected from online sources and may change at any time.
- This package depends on the structure of source websites. If a source website changes its HTML structure, some functions may need an update.
- Use the returned prices for informational purposes only.
- When `beauty=True`, the returned value is a `str`.
- When `beauty=False`, the returned value is usually an `int` or `float`.

---

## 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.
