{ "info": { "author": "Bernard Brenyah", "author_email": "bbrenyah@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only" ], "description": "# Coinsta\n\nA Python :snake: package for acquiring both historical and current data of crypto-currencies:moneybag:.\n_________________________________________________________________________________________________________\n\n**Author:** Bernard Brenyah\n\n## Project Status\n\n[![Latest Version](https://img.shields.io/pypi/v/coinsta.svg)](https://pypi.python.org/pypi/coinsta/)\n[![Build Status](https://www.travis-ci.org/PyDataBlog/Coinsta.svg?branch=master)](https://www.travis-ci.org/PyDataBlog/Coinsta)\n[![Issues](https://img.shields.io/github/issues/PyDataBlog/coinsta.svg)](https://github.com/PyDataBlog/Coinsta/issues)\n[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/PyDataBlog/Coinsta/commits/master)\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FPyDataBlog%2FCoinsta.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FPyDataBlog%2FCoinsta?ref=badge_shield)\n[![License](https://img.shields.io/pypi/l/coinsta.svg?color=green)](https://pypi.python.org/pypi/coinsta/)\n[![Supported Python Version](https://img.shields.io/pypi/pyversions/coinsta.svg)](https://pypi.python.org/pypi/coinsta/)\n[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/PyDataBlog/Coinsta/master)\n\n## Table of Content\n\n1. [Motivation](#motivation)\n2. [Frameworks Used](#frameworks-used)\n3. [Installation](#installation)\n4. [Features](#features)\n5. [Pending Features](#pending-features)\n6. [How To Use](#how-to-use)\n7. [Release History](#release-history)\n8. [How To Contribute](#how-to-contribute)\n9. [Credits](#credits)\n10. [License](#license)\n\n_________________________________________________________________________________________________________\n\n### Motivation\n\nWhy `coinsta`?\nI spent the past couple of months on a graduate dissertation which required the use of both historical and current data on cryptocurrencies. After browsing the Python Packaging Index (PYPI), I was frustrated by the lack of a Python package that catered for such needs. As far as I know only [cyrptoCMD](https://github.com/guptarohit/cryptoCMD) came close to meeting my needs. The only drawback is the that package only delivers historical data. OK so \"*why not edit that project and make a pull request with your suggestions?*\"\n\nThat was the original plan until I realised that the scraping code could relatively be done quickly with the help of `pandas` package. If I went with the original plan I would have to rewrite the whole code and implementation ideas for `cryptoCMD` project. The only logical conclusion was starting a new project that I wish I had during my data collection process. A project inspired by scripts I generated for my dissertation project.\n\nAs a result, this project is the first Python project that supplies both historical and current data on cryptocurrency markets and assets in one coherent package.\n\n_________________________________________________________________________________________________________\n\n### Frameworks Used\n\nThis package leverages the power of the following packages:\n\n- `pandas`\n- `requests`\n- `lxml`\n- `PyQuery`\n\n_________________________________________________________________________________________________________\n\n### Installation\n\nThe easiest way to install Coinsta is to use the default python package installer `pip`:\n\n```bash\npip install coinsta\n```\n\nand for the few brave ones who like bleeding edge technology, the latest source can be installed via with this command:\n\n```bash\npip install git+git://github.com/PyDataBlog/Coinsta.git\n```\n\n_________________________________________________________________________________________________________\n\n### Features\n\n- Current global information on cryptocurrency markets.\n- Current market information on the top 100 cryptocurrencies.\n- Current data on a specified cryptocurrency.\n- Historical data on all active cryptocurrencies.\n- Get historical snapshots of cryptocurrencies.\n\n### Pending Features\n\n- [X] Migrate the current class to the new CoinMarketCap API\n- [X] Support for Python 3.5\n- [X] test compliance with Python 3.7\n- [ ] Improve documentation and doc strings\n- [X] Optimisation of code\n- [X] Support for CoinMarketCap's historical snapshots\n\n#### How To Use\n\n**Historical Data**\n\n```python\n# import the Historical class\nfrom coinsta.core import Historical\nfrom datetime import date\n\n# specify dates considered\nstart = date(2018, 3, 1)\nend = date(2018, 6,1)\n\n# get data\ncoin_spec = Historical('btc', start=start, end=end)\nbtc_data = coin_spec.get_data()\nprint(btc_data.head())\n\n\n#by default the end date is set to use the \"today's\" date\n# of the user unless otherwise specified like above\n\n```\n\n**Alternative Constructors for Historical data from dates in the form of strings (YYYY-MM-DD) or (YYYY/MM/DD):**\n\n```python\nfrom coinsta.core import Historical\n\n# default alternative method for \"-\" formatted date strings\nalt_spec = Historical.from_strings('btc', '2018-3-1','2018-6-1', hyphen=True)\n\nalt_btc = alt_spec.get_data()\nprint(alt_btc.head())\n\n# another alternative method for \"/\" formated date strings\nother_spec = Historical.from_strings('btc', '2018/3/1','2018/6/1', hyphen=False)\n\nanother_btc = other_spec.get_data()\nprint(another_btc.head())\n\n```\n\nThe `get_data()` method and the `from_strings` method from the Historical class returns a `pandas` DataFrame object with sorted in an ascending order indexed the dates specified by the user:\n\n```shell\n Open High Low Close Volume Market_cap\nDate\n```\n\nSo what was the top cryptocurrency (in terms of market capitalisation) on date XYZ?\nLuckily, CoinMarketCap delivers periodic snapshots of the this type of rankings. The `HistoricalSnapshot` class taps into data to supply users with such information.\n\nThe Historical Snapshot feature returns a Pandas DataFrame object with the following self describing columns:\n\n```python\nIndex(['Rank', 'Name', 'Symbol', 'Market Cap', 'Price', 'Circulating Supply',\n 'Volume (24h)', '% 1h', '% 24h', '% 7d'],\n dtype='object')\n```\n\n**Historical Snapshots:**\n\n```python\nfrom coinsta.core import HistoricalSnapshot\nfrom datetime import date\n\nsnap_date = date(2018, 7, 29)\n\njuly_2018 = HistoricalSnapshot(snap_date)\njuly_2018_snapshot = july_2018.get_snapshot()\n\nprint(july_2018_snapshot.info())\n```\n\n**Current Data:**\n\n```python\n# import the Current class and instantiate the current class object with specifications\nfrom coinsta.core import Current\ncur = Current(api_key='YOUR-API-KEY-HERE', currency='eur') # Default is usd\n\n# get current market information on a specified crypto\nbtc_current = cur.get_current('btc')\nprint(btc_current)\n\n# get the top 100 cryptos (in terms of market cap)\ncurrent_100 = cur.top_100(limit=100) # Default limit is 100 but can be increased as a user wishes\nprint(current_100.head())\n\n# get global overview of crypto markets\nglo_info = cur.global_info()\nprint(glo_info)\n\n\n```\n\nThe `get_current()` method from the current class returns a `pandas` DataFrame object with one column representing the following named rows of information on the cryptocurrency specified:\n\n```python\ndict_keys(['name', 'symbol', 'rank', 'circulating_supply',\n 'total_supply', 'max_supply', 'price', 'volume_24h',\n 'percent_change_1h', 'percent_change_24h', 'percent_change_7d',\n 'market_cap', 'last_updated'])\n```\n\nThe `top_100` method in the current class returns a `pandas` DataFrame object of the top 100 cryptocurrencies in terms of market capitalization. The following are the columns returned:\n\n```python\n['id', 'name', 'symbol', 'slug', 'num_market_pairs', 'date_added',\n 'tags', 'max_supply', 'circulating_supply', 'total_supply', 'platform',\n 'cmc_rank', 'last_updated', '*currency*.price', '*currency*.volume_24h',\n '*currency*.percent_change_1h', '*currency*.percent_change_24h', '*currency*.percent_change_7d',\n '*currency*.market_cap', '*currency*.last_updated']\n```\n\nFinally, the `global_info()` method in Current class returns a dictionary with the following keys as an overview of cryptocurrency markets as a whole\n\n```python\ndict_keys(['active_cryptos', 'active_exchanges', 'btc_dominance',\n 'eth_dominance', 'total_market_cap', 'total_volume_24h',\n 'total_volume_24h_reported', 'altcoin_volume_24h',\n 'altcoin_volume_24h_reported', 'altcoin_market_cap', 'last_updated'])\n```\n\n_________________________________________________________________________________________________________\n\n#### Release History\n\n- 0.1.4 - Re-wrote the Current classes to use the new CoinMarketCap API\n- 0.1.3 - Added Historical Snapshot feature\n- 0.1.2 - Added support for Python 3.5 and 3.7\n- 0.1.1 - Added license info and improved documentation\n- 0.1.0 - Initial Public Release\n\n#### How to Contribute\n\nThis project welcomes contributions from anyone interested in this project. Guidelines for contribution is being drafted but for now a pull request with explanation of the contributions will suffice.\n\n_________________________________________________________________________________________________________\n\n#### Credits\n\nShoutout to [CoinMarketCap](https://coinmarketcap.com/) :heart: for the access to their API as well as allowing projects such as this plug into the datawarehouse.\n\n_________________________________________________________________________________________________________\n\n#### License\n\nLicense: [BSD-3](https://github.com/PyDataBlog/Coinsta/blob/master/LICENSE)\n\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FPyDataBlog%2FCoinsta.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FPyDataBlog%2FCoinsta?ref=badge_large)\n\n_________________________________________________________________________________________________________\n\n[Back to top](#table-of-content)\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/PyDataBlog/Coinsta", "keywords": "", "license": "BSD 3-Clause License", "maintainer": "", "maintainer_email": "", "name": "coinsta", "package_url": "https://pypi.org/project/coinsta/", "platform": "", "project_url": "https://pypi.org/project/coinsta/", "project_urls": { "Homepage": "https://github.com/PyDataBlog/Coinsta" }, "release_url": "https://pypi.org/project/coinsta/0.1.4/", "requires_dist": [ "pandas (~=0.23.1)", "lxml (~=4.2.2)", "requests (~=2.19.1)", "pyquery (~=1.4.0)" ], "requires_python": "", "summary": "A Python package for acquiring both historical and current data of cryptocurrencies", "version": "0.1.4" }, "last_serial": 5577138, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "14f965f87bfe87b73ec635a99254ead7", "sha256": "615d5289b433bd97bacec73f3fe50d623b65527f920d6854cd799b7160022cba" }, "downloads": -1, "filename": "coinsta-0.1.0.tar.gz", "has_sig": false, "md5_digest": "14f965f87bfe87b73ec635a99254ead7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6772, "upload_time": "2018-06-30T22:37:59", "url": "https://files.pythonhosted.org/packages/a6/7f/ea9c28289eaf0738a157200ba5084493e6867ec51cc4dc916c2064088693/coinsta-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "f8a3af7b9369532eab49e5d26e946018", "sha256": "cca1e9b9ef17c658cbbb4eb2e44ebb91ac955590fc420299549d4a875b2f8eef" }, "downloads": -1, "filename": "coinsta-0.1.1.tar.gz", "has_sig": false, "md5_digest": "f8a3af7b9369532eab49e5d26e946018", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6933, "upload_time": "2018-07-01T12:06:16", "url": "https://files.pythonhosted.org/packages/ea/c9/eaaa740c2c055a0087dd6964603d9383906a149a206141283da2def5051d/coinsta-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "35250a8e3af08cc12626a9cd45ba107f", "sha256": "efce17e36d355e90462d8d2e5a73660428bac007ea56d670719374b598f532eb" }, "downloads": -1, "filename": "coinsta-0.1.2.tar.gz", "has_sig": false, "md5_digest": "35250a8e3af08cc12626a9cd45ba107f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7433, "upload_time": "2018-07-10T17:05:09", "url": "https://files.pythonhosted.org/packages/5f/82/7adf3a5c1bcac44fc20533faab2d7c66f697ce486cf5b87cd0bb075dd721/coinsta-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "dd78a48e01b2373e294f7b73628d6f12", "sha256": "9dc02d4010ba4e9bdf32e012e6d781fc9bbd6b75cac9ca2c8d3835b8f8996e5d" }, "downloads": -1, "filename": "coinsta-0.1.3.tar.gz", "has_sig": false, "md5_digest": "dd78a48e01b2373e294f7b73628d6f12", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9770, "upload_time": "2018-08-04T22:21:53", "url": "https://files.pythonhosted.org/packages/ee/63/3f923ceb9c799292dbb96ba67b00b2059e43da3253b59474d6d7e2e76a5e/coinsta-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "5a68405c8986507282fd966f284eb530", "sha256": "5d6e7204c34535f819d45d01d0fc20ddd3ddeae93826b69d2c264e86d15d7977" }, "downloads": -1, "filename": "coinsta-0.1.4-py3-none-any.whl", "has_sig": false, "md5_digest": "5a68405c8986507282fd966f284eb530", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10939, "upload_time": "2019-07-24T11:21:45", "url": "https://files.pythonhosted.org/packages/3a/a1/565e0eb111e28954a3a849aa5084651504fecb162deb5513ff523c99b91f/coinsta-0.1.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a5aefddbf4f455580dbee445a26c8e64", "sha256": "2e5e2f788ddcf9e83cec2f876dbf2f2c52c48bf9211a2dce07019509b320d900" }, "downloads": -1, "filename": "coinsta-0.1.4.tar.gz", "has_sig": false, "md5_digest": "a5aefddbf4f455580dbee445a26c8e64", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9270, "upload_time": "2019-07-24T11:21:46", "url": "https://files.pythonhosted.org/packages/52/32/3b82adc7a842d302effd9d63c3b38f96573acc4762aa1724229e3f0c9337/coinsta-0.1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5a68405c8986507282fd966f284eb530", "sha256": "5d6e7204c34535f819d45d01d0fc20ddd3ddeae93826b69d2c264e86d15d7977" }, "downloads": -1, "filename": "coinsta-0.1.4-py3-none-any.whl", "has_sig": false, "md5_digest": "5a68405c8986507282fd966f284eb530", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10939, "upload_time": "2019-07-24T11:21:45", "url": "https://files.pythonhosted.org/packages/3a/a1/565e0eb111e28954a3a849aa5084651504fecb162deb5513ff523c99b91f/coinsta-0.1.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a5aefddbf4f455580dbee445a26c8e64", "sha256": "2e5e2f788ddcf9e83cec2f876dbf2f2c52c48bf9211a2dce07019509b320d900" }, "downloads": -1, "filename": "coinsta-0.1.4.tar.gz", "has_sig": false, "md5_digest": "a5aefddbf4f455580dbee445a26c8e64", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9270, "upload_time": "2019-07-24T11:21:46", "url": "https://files.pythonhosted.org/packages/52/32/3b82adc7a842d302effd9d63c3b38f96573acc4762aa1724229e3f0c9337/coinsta-0.1.4.tar.gz" } ] }