Metadata-Version: 2.1
Name: cmc-py-wrapper
Version: 0.1.1
Summary: Unofficial CoinMarketCap API and Python wrapper
Home-page: https://devansh3712.github.io/cmc-py/
Author: Devansh Singh
Author-email: devanshamity@gmail.com
License: MIT
Download-URL: https://pypi.org/project/cmc-py-wrapper/
Project-URL: Source, https://github.com/Devansh3712/cmc-py
Project-URL: Documentation, https://devansh3712.github.io/cmc-py/
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: Microsoft :: Windows
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: async-generator (==1.10)
Requires-Dist: attrs (==21.4.0)
Requires-Dist: beautifulsoup4 (==4.10.0)
Requires-Dist: certifi (==2021.10.8)
Requires-Dist: cffi (==1.15.0)
Requires-Dist: charset-normalizer (==2.0.12)
Requires-Dist: colorama (==0.4.4)
Requires-Dist: configparser (==5.2.0)
Requires-Dist: crayons (==0.4.0)
Requires-Dist: cryptography (==36.0.1)
Requires-Dist: h11 (==0.13.0)
Requires-Dist: idna (==3.3)
Requires-Dist: lxml (==4.8.0)
Requires-Dist: outcome (==1.1.0)
Requires-Dist: pycparser (==2.21)
Requires-Dist: pyOpenSSL (==22.0.0)
Requires-Dist: requests (==2.27.1)
Requires-Dist: selenium (==4.1.0)
Requires-Dist: sniffio (==1.2.0)
Requires-Dist: sortedcontainers (==2.4.0)
Requires-Dist: soupsieve (==2.3.1)
Requires-Dist: trio (==0.19.0)
Requires-Dist: trio-websocket (==0.9.2)
Requires-Dist: urllib3 (==1.26.8)
Requires-Dist: webdriver-manager (==3.5.3)
Requires-Dist: wsproto (==1.0.0)

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

[![mypy lint](https://github.com/Devansh3712/cmc-py/actions/workflows/lint.yml/badge.svg)](https://github.com/Devansh3712/cmc-py/actions/workflows/lint.yml) [![pytest](https://github.com/Devansh3712/cmc-py/actions/workflows/test.yml/badge.svg)](https://github.com/Devansh3712/cmc-py/actions/workflows/test.yml) [![codecov](https://github.com/Devansh3712/cmc-py/actions/workflows/codecov.yml/badge.svg)](https://github.com/Devansh3712/cmc-py/actions/workflows/codecov.yml) [![PyPI](https://github.com/Devansh3712/cmc-py/actions/workflows/python-publish.yml/badge.svg)](https://github.com/Devansh3712/cmc-py/actions/workflows/python-publish.yml) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![codecov](https://codecov.io/gh/Devansh3712/cmc-py/branch/main/graph/badge.svg?token=HDZL3E43TR)](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
import json
from cmc import Trending

top_30_trending = Trending().get_data
print(json.dumps(top_30_trending, indent=4, default=str))
```

- `Exchanges`
```python
import json
from cmc import Spot

spot_exchanges = Spot().get_data
print(json.dumps(spot_exchanges, indent=4, default=str))
```

- `Non Fungible Tokens (NFTs)`
```python
import json
from cmc import UpcomingSale

upcoming_nft_sales = UpcomingSale(pages=[1, 2]).get_data
print(json.dumps(upcoming_nft_sales, indent=4, default=str))
```

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

```shell
uvicorn api.main:app
```


