Unofficial CoinMarketCap API and Python wrapper
Project description
cmc-py
Unofficial CoinMarketCap API and Python wrapper. cmc-py
uses Selenium
and BeautifulSoup
to scrape the website and return desired data.
Installation
- Using
setup.py
python setup.py install
- Using
Python Package Index
pip install cmc-py-wrapper
- Using
poetry
poetry install
Wrapper
cmc-py
library can be used to fetch data for the following:
CryptoCurrencies
import json
from cmc import Trending
top_30_trending = Trending().get_data
print(json.dumps(top_30_trending, indent=4, default=str))
Exchanges
import json
from cmc import Spot
spot_exchanges = Spot().get_data
print(json.dumps(spot_exchanges, indent=4, default=str))
Non Fungible Tokens (NFTs)
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
.
uvicorn api.main:app
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cmc-py-wrapper-0.1.1.tar.gz
(17.3 kB
view hashes)
Built Distribution
Close
Hashes for cmc_py_wrapper-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a656f612d719ebb92053310c9ae7048c36c837162b55a7a75ddf215a30858a02 |
|
MD5 | aa4e139898718c2e2479fc6ac743fd97 |
|
BLAKE2b-256 | 5e1ed6cbb5b3e0eab76fd05ed7871495ad7e24f0fdaed37f56ea34e1d5de24d5 |