Package: cmc-api-wrapper
IntroductionCMC_API is a Python-client for the Coin Market Cap API.This client provides support for the basic or free tier at the moment.
However, it is open for extension to anyone who has access to paid packages.It provides access to all the available endpoint on the API and produce a result similar to the original API with some
minor difference.
The most relevant difference is the addition of a list of keys available in each answer, as shown in the bellow example.{"metadata":{"timestamp":"2022-06-04T04:26:55.117Z","credit_count":0,"error_message":null,"list_keys":["plan","usage"]},...IndexAbout[Why Use the Client](#Why use the Client:)UsageDeploymentPre-RequisitesFile StructureCommunityContributionBranchesGuidelineResourcesLicenseAboutThe CoinMarketCap API is an API provided by the company with the same name. This API provides cryptocurrency data such as price, volume, market cap, and exchange data.This project is a wrapper around this API that facilitates its usage for python projects.Why use the Client:It will reduce the coding time since the code for request and parsing of the data is already done, and the user only needs to call a function.It provides the option to save the response data to save in credit calls for data that is not updated constantly.It provides metadata information in the response. This metadata contains the "cost" per request in credits and a list of the keys in the data part of the response so users can retrieve information with ease.UsageDecided with URL you will use:BASE:base is the real API and provide the real
data.cmc_helper.Urls.BASE.valueSANDBOX: sandbox is for testing, and returns dummy data.cmc_helper.Urls.SANDBOX.valueCreate an Object of classCmc(), passing the URL to be usecmc = Cmc(url=cmc_helper.Urls.BASE.value)use the object of typeCmc()to call a function.cmc.get_cmc_id_map()fromcmc_apiimportcmc,cmc_helperbase_url=cmc_helper.Urls.BASE.valuecmc=cmc.Cmc(url=base_url,api_key="YOU_LICENSE_KEY",save_to_json=True)cmc.get_cmc_id_map(listing_status="active",start=1,limit=1000)The response will be similar to:{"metadata":{"timestamp":"2022-06-04T13:14:05.108Z","credit_count":1,"error_message":null,"list_keys":["id","name","symbol","slug","rank","is_active","first_historical_data","last_historical_data","platform"]},"data":[{"id":1,"name":"Bitcoin","symbol":"BTC","slug":"bitcoin","rank":1,"is_active":1,"first_historical_data":"2013-04-28T18:47:21.000Z","last_historical_data":"2022-06-04T13:09:00.000Z","platform":null},...]}DevelopmentStill working in this part but any contribution or suggestion is more than welcomePre-Requisitespython=>3.10requestFile StructureThis is the structure of this repository not of a project using this python-client..
├── coinmarketcapAPI
│   ├── json_files
│   │   ├── API_info.json
│   │   └── ...
│   └── src
│       ├── cmc_api
│       │   ├── cmc.py              # definition of the wrapper and function available
│       │   └── cmc_dataHandler.py  # Helper to parse the information on the API response
│       │   └── cmc_helper.py       # Emuns that hold the endpoinrs URI and args need it
│       │   └── cmc_utils.py        # Extra utility functions.
│       └── logs
│           └── *.logs
│           └── ....
├── LICENSE
├── MANIFEST.in
├── pyproject.toml
├── setup.cfg
└── README.mdCommunityAs mentioned before the contribution guidelines are not done yet, but any report or suggestion will be appreciatedContributionYour contributions are always welcome and appreciated. Following are the things you can do to contribute to this project.Report a bugIf you think you have encountered a bug, and I should know about it, feel free to report ithere, and I will take care of it.Branchesmasteris the main development branch.mainis the production branch.Developmentis the experimental development branch.ResourcesIf you want more information about the Coin market cap API you can visit their sidecoinmarketcapAPILicenseMIT license