Skip to main content

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.

mypy lint pytest codecov PyPI Code style: black codecov

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
from cmc import Trending, format_data

top_30_trending = Trending().get_data
print(format_data(top_30_trending))
  • Exchanges
from cmc import Spot, format_data

spot_exchanges = Spot().get_data
print(format_data(spot_exchanges))
  • Non Fungible Tokens (NFTs)
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.

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.2.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

cmc_py_wrapper-0.1.2-py3-none-any.whl (43.2 kB view details)

Uploaded Python 3

File details

Details for the file cmc-py-wrapper-0.1.2.tar.gz.

File metadata

  • Download URL: cmc-py-wrapper-0.1.2.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for cmc-py-wrapper-0.1.2.tar.gz
Algorithm Hash digest
SHA256 846426f71b55621f0437150009aae0aa719e1422c5240ab8332daf55069c81f4
MD5 823893be09f8b0cee481d0edbfe2ea71
BLAKE2b-256 04b1c5bdce97f6f8c5c1c775329604282d949d62071932ee87b93667bfd0ce03

See more details on using hashes here.

File details

Details for the file cmc_py_wrapper-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: cmc_py_wrapper-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 43.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for cmc_py_wrapper-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f9e11595aee215a3545e7df280652318bd41143d49c21bf2bde235787b62e84d
MD5 2ccea220b89c09aacac1bf1ae2b0f367
BLAKE2b-256 bc34710628b71d1cf740fce1a20b277519cb3298dc8a6c664e8f3ec2c4fc69a2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page