Metadata-Version: 2.1
Name: cmc-py-wrapper
Version: 0.1.0
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: certifi (==2021.10.8)
Requires-Dist: colorama (==0.4.4)
Requires-Dist: httptools (==0.2.0)
Requires-Dist: python-dotenv (==0.19.2)
Requires-Dist: pyyaml (==5.4.1)
Requires-Dist: types-pyyaml (==6.0.4)
Requires-Dist: types-redis (==4.1.16)
Requires-Dist: types-requests (==2.27.9)
Requires-Dist: types-urllib3 (==1.26.9)
Requires-Dist: uvloop (==0.16.0)
Requires-Dist: watchgod (==0.7)
Requires-Dist: websockets (==10.1)
Requires-Dist: lxml (==4.7.1) ; (python_version >= "2.7" and python_full_version < "3.0.0") or python_full_version >= "3.5.0"
Requires-Dist: cffi (==1.15.0) ; os_name == "nt" and implementation_name != "pypy" and python_version >= "3.7" and python_version < "4.0" and (python_version >= "3.7" and python_full_version < "3.0.0" and python_version < "4.0" or python_full_version >= "3.5.0" and python_version < "4" and python_version >= "3.7")
Requires-Dist: beautifulsoup4 (==4.10.0) ; python_full_version > "3.0.0"
Requires-Dist: email-validator (==1.1.3) ; python_full_version >= "3.6.1"
Requires-Dist: fastapi (==0.73.0) ; python_full_version >= "3.6.1"
Requires-Dist: pydantic (==1.9.0) ; python_full_version >= "3.6.1"
Requires-Dist: python-multipart (==0.0.5) ; python_full_version >= "3.6.1"
Requires-Dist: six (==1.16.0) ; python_full_version >= "3.6.1"
Requires-Dist: uvicorn (==0.15.0) ; python_full_version >= "3.6.1"
Requires-Dist: urllib3 (==1.26.8) ; python_full_version >= "3.6.1" and python_version < "4" and python_version >= "3.7"
Requires-Dist: charset-normalizer (==2.0.11) ; python_full_version >= "3.6.1" and python_version >= "3.6"
Requires-Dist: itsdangerous (==2.0.1) ; python_full_version >= "3.6.1" and python_version >= "3.6"
Requires-Dist: jinja2 (==3.0.3) ; python_full_version >= "3.6.1" and python_version >= "3.6"
Requires-Dist: markupsafe (==2.0.1) ; python_full_version >= "3.6.1" and python_version >= "3.6"
Requires-Dist: requests (==2.27.1) ; python_full_version >= "3.6.1" and python_version >= "3.6"
Requires-Dist: ujson (==4.3.0) ; python_full_version >= "3.6.1" and python_version >= "3.6"
Requires-Dist: asgiref (==3.5.0) ; python_full_version >= "3.6.1" and python_version >= "3.7"
Requires-Dist: orjson (==3.6.7) ; python_full_version >= "3.6.1" and python_version >= "3.7"
Requires-Dist: h11 (==0.13.0) ; python_full_version >= "3.6.1" and python_version >= "3.7" and python_version < "4.0"
Requires-Dist: black (==22.1.0) ; python_full_version >= "3.6.2"
Requires-Dist: pathspec (==0.9.0) ; python_full_version >= "3.6.2"
Requires-Dist: configparser (==5.2.0) ; python_version >= "3.6"
Requires-Dist: crayons (==0.4.0) ; python_version >= "3.6"
Requires-Dist: iniconfig (==1.1.1) ; python_version >= "3.6"
Requires-Dist: markdown (==3.3.6) ; python_version >= "3.6"
Requires-Dist: mypy (==0.931) ; python_version >= "3.6"
Requires-Dist: packaging (==21.3) ; python_version >= "3.6"
Requires-Dist: pdoc3 (==0.10.0) ; python_version >= "3.6"
Requires-Dist: pluggy (==1.0.0) ; python_version >= "3.6"
Requires-Dist: pyparsing (==3.0.7) ; python_version >= "3.6"
Requires-Dist: pytest (==7.0.1) ; python_version >= "3.6"
Requires-Dist: redis (==4.1.4) ; python_version >= "3.6"
Requires-Dist: webdriver-manager (==3.5.2) ; python_version >= "3.6"
Requires-Dist: atomicwrites (==1.4.0) ; python_version >= "3.6" and python_full_version < "3.0.0" and sys_platform == "win32" or sys_platform == "win32" and python_version >= "3.6" and python_full_version >= "3.4.0"
Requires-Dist: deprecated (==1.2.13) ; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6"
Requires-Dist: mako (==1.1.6) ; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6"
Requires-Dist: py (==1.11.0) ; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
Requires-Dist: wrapt (==1.13.3) ; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
Requires-Dist: soupsieve (==2.3.1) ; python_version >= "3.6" and python_full_version > "3.0.0"
Requires-Dist: starlette (==0.17.1) ; python_version >= "3.6" and python_full_version >= "3.6.1"
Requires-Dist: typing-extensions (==4.0.1) ; python_version >= "3.6" and python_full_version >= "3.6.1"
Requires-Dist: anyio (==3.5.0) ; python_version >= "3.6" and python_full_version >= "3.6.2"
Requires-Dist: click (==8.0.3) ; python_version >= "3.6" and python_full_version >= "3.6.2"
Requires-Dist: mypy-extensions (==0.4.3) ; python_version >= "3.6" and python_full_version >= "3.6.2"
Requires-Dist: dnspython (==2.2.0) ; python_version >= "3.6" and python_version < "4.0" and python_full_version >= "3.6.1"
Requires-Dist: pycparser (==2.21) ; python_version >= "3.7" and python_full_version < "3.0.0" and os_name == "nt" and implementation_name != "pypy" and python_version < "4.0" or os_name == "nt" and implementation_name != "pypy" and python_version >= "3.7" and python_version < "4.0" and python_full_version >= "3.4.0"
Requires-Dist: cryptography (==36.0.1) ; python_version >= "3.7" and python_full_version < "3.0.0" and python_version < "4.0" or python_full_version >= "3.5.0" and python_version < "4" and python_version >= "3.7"
Requires-Dist: pyopenssl (==22.0.0) ; python_version >= "3.7" and python_full_version < "3.0.0" and python_version < "4.0" or python_full_version >= "3.5.0" and python_version < "4" and python_version >= "3.7"
Requires-Dist: attrs (==21.4.0) ; python_version >= "3.7" and python_full_version < "3.0.0" and python_version < "4.0" or python_full_version >= "3.5.0" and python_version >= "3.7" and python_version < "4.0"
Requires-Dist: platformdirs (==2.5.0) ; python_version >= "3.7" and python_full_version >= "3.6.2"
Requires-Dist: tomli (==2.0.1) ; python_version >= "3.7" and python_full_version >= "3.6.2"
Requires-Dist: async-generator (==1.10) ; python_version >= "3.7" and python_version < "4.0"
Requires-Dist: outcome (==1.1.0) ; python_version >= "3.7" and python_version < "4.0"
Requires-Dist: selenium (==4.1.0) ; python_version >= "3.7" and python_version < "4.0"
Requires-Dist: sortedcontainers (==2.4.0) ; python_version >= "3.7" and python_version < "4.0"
Requires-Dist: trio-websocket (==0.9.2) ; python_version >= "3.7" and python_version < "4.0"
Requires-Dist: trio (==0.19.0) ; python_version >= "3.7" and python_version < "4.0"
Requires-Dist: idna (==3.3) ; python_version >= "3.7" and python_version < "4.0" and (python_version >= "3.7" and python_full_version < "3.0.0" and python_version < "4.0" or python_full_version >= "3.5.0" and python_version < "4" and python_version >= "3.7") and python_full_version >= "3.6.2"
Requires-Dist: wsproto (==1.0.0) ; python_version >= "3.7" and python_version < "4.0" and python_full_version >= "3.6.1"
Requires-Dist: sniffio (==1.2.0) ; python_version >= "3.7" and python_version < "4.0" and python_full_version >= "3.6.2"

# 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) [![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
```


