cmc-py-wrapper-0.1.4
توضیحات
Unofficial CoinMarketCap API and Python wrapper
| ویژگی | مقدار |
|---|---|
| سیستم عامل | Microsoft :: Windows |
| نام فایل | cmc-py-wrapper-0.1.4 |
| نام | cmc-py-wrapper |
| نسخه کتابخانه | 0.1.4 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Devansh Singh |
| ایمیل نویسنده | devanshamity@gmail.com |
| آدرس صفحه اصلی | https://devansh3712.github.io/cmc-py/ |
| آدرس اینترنتی | https://pypi.org/project/cmc-py-wrapper/ |
| مجوز | MIT |
# cmc-py
Unofficial [CoinMarketCap](https://coinmarketcap.com/) API and Python wrapper. `cmc-py` uses `Selenium` and `BeautifulSoup` to scrape the website and return desired data.
[](https://github.com/Devansh3712/cmc-py/actions/workflows/lint.yml) [](https://github.com/Devansh3712/cmc-py/actions/workflows/test.yml) [](https://github.com/Devansh3712/cmc-py/actions/workflows/codecov-coverage.yml) [](https://github.com/Devansh3712/cmc-py/actions/workflows/python-publish.yml) [](https://github.com/Devansh3712/cmc-py/actions/workflows/pages/pages-build-deployment) [](https://github.com/Devansh3712/cmc-py/actions/workflows/docker-image.yml) [](https://github.com/Devansh3712/cmc-py/actions/workflows/docker-publish.yml) [](https://github.com/psf/black) [](https://codecov.io/gh/Devansh3712/cmc-py)
### Installation
- Using `setup.py`
```shell
python setup.py install
```
- Using `Python Package Index`
```shell
pip install cmc-py-wrapper
```
- Using `poetry`
```
poetry install
```
### Wrapper
`cmc-py` library can be used to fetch data for the following:
- `CryptoCurrencies`
```python
from cmc import Trending, format_data
top_30_trending = Trending().get_data
print(format_data(top_30_trending))
```
- `Exchanges`
```python
from cmc import Spot, format_data
spot_exchanges = Spot().get_data
print(format_data(spot_exchanges))
```
- `Non Fungible Tokens (NFTs)`
```python
from cmc import UpcomingSale, format_data
upcoming_nft_sales = UpcomingSale(pages=[1, 2]).get_data
print(format_data(upcoming_nft_sales))
```
### API
An API is also built using the `cmc-py` modules using `FastAPI` and `Redis`. Redis configurations can be set using the `config.yml` file, and it is used to cache the scraped data fetched through `cmc-py`. `Redis` server should be running in the background in order to cache API calls. An instance of the API is hosted on [Heroku](https://cmc-api.herokuapp.com/docs#/).
- Running the API locally
```shell
uvicorn api.main:app
```
- Building the API using `Dockerfile`
```shell
docker build -t cmc .
docker compose up -d
```
- Running the API using [`Docker Image`](https://hub.docker.com/r/devansh3712/cmc-api)
```shell
docker pull devansh3712/cmc-api
docker run devansh3712/cmc-api
```
نیازمندی
| مقدار | نام |
|---|---|
| ==1.10 | async-generator |
| ==21.4.0 | attrs |
| ==4.10.0 | beautifulsoup4 |
| ==2021.10.8 | certifi |
| ==1.15.0 | cffi |
| ==2.0.12 | charset-normalizer |
| ==0.4.4 | colorama |
| ==5.2.0 | configparser |
| ==0.4.0 | crayons |
| ==36.0.1 | cryptography |
| ==0.13.0 | h11 |
| ==3.3 | idna |
| ==4.8.0 | lxml |
| ==1.1.0 | outcome |
| ==2.21 | pycparser |
| ==22.0.0 | pyOpenSSL |
| ==2.27.1 | requests |
| ==4.1.0 | selenium |
| ==1.2.0 | sniffio |
| ==2.4.0 | sortedcontainers |
| ==2.3.1 | soupsieve |
| ==0.19.0 | trio |
| ==0.9.2 | trio-websocket |
| ==1.26.8 | urllib3 |
| ==3.5.3 | webdriver-manager |
| ==1.0.0 | wsproto |
نحوه نصب
نصب پکیج whl cmc-py-wrapper-0.1.4:
pip install cmc-py-wrapper-0.1.4.whl
نصب پکیج tar.gz cmc-py-wrapper-0.1.4:
pip install cmc-py-wrapper-0.1.4.tar.gz