{ "info": { "author": "Guillaume VILLENA", "author_email": "contact@guillaumevillena.fr", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: System :: Monitoring" ], "description": "# Python : Simple Crypto currencies scrapper\n\nThis is a simple module that retrieve instant crypto \ncurrencies values in BTC and USD from coin360.com and coinmarketcap apis\n\n### How to use\n\nFirst install the package\n\n```\npip install cryptocurrencies_scraper\n```\n\n#### Basic usage\n\n```python\nfrom cryptocurrencies_scraper.CurrencyService import Manager\nmanager = Manager() # Create a new instance of the Manager\nmanager.update() # Ask the manager to update all currencies values\n\nmanager.all_currencies() # returns a dict that contain the currency name and symbol as key and currency information as a list\nmanager.get_curency('btc') # return the list of currency values retrived for bitcoin using symbol\nmanager.get_curency('bitcoin') # return the list of currency values retrived for bitcoin using name\n```\n\n#### Add your own scraper\n\nA scraper should extends the `CurrentPriceInterface`.\nHere is a basic scheme for a new scraper\n\n```python\n\nclass MySourceForCurrencies(CurrentPriceInterface):\n instance = None\n URL = 'https://api.mysource.com/v1/ticker/?limit=3000'\n NAME = \"mysource.com\"\n\n @classmethod\n def get_instance(cls) -> 'CurrenciesFromCoinMarketCap':\n if cls.instance is None:\n cls.instance = MySourceForCurrencies()\n return cls.instance\n\n def __init__(self):\n super().__init__()\n\n def update_currency_list(self):\n self.process_data(requests.get(self.URL).json())\n\n def process_data(self, json_data: json) -> None:\n # Manipulate the the json to be Currency \"parsable\"\n c = Currency.parse_json(json_data, self.NAME)\n #When parsed, add it to the index \n NameIndexes.get_instance().add_to_index(c)\n return None\n\n```\n\nIn order for your scraper to be working you need to add it to the manager\n\n```python\nfrom cryptocurrencies_scraper.CurrencyService import Manager\nmanager = Manager()\nmanager.add_source(MySourceForCurrencies.get_instance())\n\n# you can also remove a source\nmanager.remove_source(MySourceForCurrencies.NAME)\n\n```\n\nThen on each `manager.update()` call your scraper will be called and currencies added to the Index\n\n#### NameIndex\n\nThis class is used internally to index all currencies. \nWhen a new currency is added, it will be grouped by the symbol and the name (symbol upper, name lower case)\n\nThe only useful method is `NameIndexes.get_instance().add_to_index(currency)`. On each update, it get completlly cleared \nfrom all old values.\n\n\n#### `Currency`\n\nThis is the object that represent one currency here is the structure\n\n```json\n {\n \"symbol\" : \"BTC\",\n \"name\" : \"Bitcoin\",\n \"valueUSD\" : 5513,\n \"valueBTC\": 1,\n \"lastUpdate\" : 1566531513813,\n \"source\" : \"coin360.com\",\n \"changes\" : {\n \"7d\": -1,\n \"24h\": -5,\n \"1h\": -10\n }\n }\n```\n\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/Willena/python-crypto-currencies-scraper", "keywords": "coin coin360 coinmarketcap api web scrapper", "license": "", "maintainer": "", "maintainer_email": "", "name": "cryptocurrencies-scraper", "package_url": "https://pypi.org/project/cryptocurrencies-scraper/", "platform": "", "project_url": "https://pypi.org/project/cryptocurrencies-scraper/", "project_urls": { "Bug Reports": "https://github.com/Willena/python-crypto-currencies-scraper/issues", "Funding": "https://paypal.me/GuillaumeVillena", "Homepage": "https://github.com/Willena/python-crypto-currencies-scraper", "Say Thanks!": "https://paypal.me/GuillaumeVillena", "Source": "https://github.com/Willena/python-crypto-currencies-scraper" }, "release_url": "https://pypi.org/project/cryptocurrencies-scraper/0.0.3/", "requires_dist": [ "requests" ], "requires_python": "", "summary": "A simple scrapper that uses coin360.com and coinmarketcap.com apis to populate an instant local database", "version": "0.0.3" }, "last_serial": 4688545, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "d0975374912224fdf93aad9f1422647a", "sha256": "abd14b9636ee4904ee92be582ede21adfada6b8a08c1f4c74ca0ffeeb856ac91" }, "downloads": -1, "filename": "cryptocurrencies_scraper-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d0975374912224fdf93aad9f1422647a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5489, "upload_time": "2018-12-27T23:06:03", "url": "https://files.pythonhosted.org/packages/aa/d9/c22dc13b66cdf254bb85aa819104ad3b6c251753e95f736c09b037492530/cryptocurrencies_scraper-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b8270bc1ed30633d0d0d55da4af9a440", "sha256": "f671708191a1c83f82fb9c747f953264f3e045e280e566ac11100c3e62ae7912" }, "downloads": -1, "filename": "cryptocurrencies_scraper-0.0.1.tar.gz", "has_sig": false, "md5_digest": "b8270bc1ed30633d0d0d55da4af9a440", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5197, "upload_time": "2018-12-27T23:06:05", "url": "https://files.pythonhosted.org/packages/68/e2/658b13dc1599869914cac95ef001ef865de14cc7097ee2e2ca94677485eb/cryptocurrencies_scraper-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "d3f9781cf1f7f868fd4af9c48b08c404", "sha256": "09b59e74a87c1ed418a5a96489b02892f32f2b6cee7d7a433406833f0c2dce49" }, "downloads": -1, "filename": "cryptocurrencies_scraper-0.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d3f9781cf1f7f868fd4af9c48b08c404", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5536, "upload_time": "2018-12-28T13:53:42", "url": "https://files.pythonhosted.org/packages/81/e7/d6ffc670d76cca0fad9bfb48fdb4244e5a494c85e2c8d9761aa08b377694/cryptocurrencies_scraper-0.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cc9f0b32977954c32eae4b68b584aab2", "sha256": "40eecb71b05c6fd00e931fe3223d49cf05a9b61d4e751dc7804aae8802cf8540" }, "downloads": -1, "filename": "cryptocurrencies_scraper-0.0.2.tar.gz", "has_sig": false, "md5_digest": "cc9f0b32977954c32eae4b68b584aab2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5243, "upload_time": "2018-12-28T13:53:44", "url": "https://files.pythonhosted.org/packages/16/62/4ba4cf210dc457538d64251486fe4b16da6deade6697c3261b0b1c48cc92/cryptocurrencies_scraper-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "19261f1c4e163d8992634f89bb856356", "sha256": "4dbcdee91ce21d7330fd6dcf1535294a81d25418f92f39e6533d3e827890035e" }, "downloads": -1, "filename": "cryptocurrencies_scraper-0.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "19261f1c4e163d8992634f89bb856356", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5536, "upload_time": "2019-01-12T14:30:30", "url": "https://files.pythonhosted.org/packages/d6/8e/70230d216448000a302539e13432232525c8f2c8ad0bc677c04dfe98f79a/cryptocurrencies_scraper-0.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "112bb04bffe3b085148937af86168dcb", "sha256": "b090647eca42deeb4315350395e66e6c5e015ae6f9bab61ad9eb5ea9239f7e4c" }, "downloads": -1, "filename": "cryptocurrencies_scraper-0.0.3.tar.gz", "has_sig": false, "md5_digest": "112bb04bffe3b085148937af86168dcb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5247, "upload_time": "2019-01-12T14:30:37", "url": "https://files.pythonhosted.org/packages/da/11/5a0dfe3b2fef93c3628d0864c891426745df139a2e56b821788dd5516a7c/cryptocurrencies_scraper-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "19261f1c4e163d8992634f89bb856356", "sha256": "4dbcdee91ce21d7330fd6dcf1535294a81d25418f92f39e6533d3e827890035e" }, "downloads": -1, "filename": "cryptocurrencies_scraper-0.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "19261f1c4e163d8992634f89bb856356", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5536, "upload_time": "2019-01-12T14:30:30", "url": "https://files.pythonhosted.org/packages/d6/8e/70230d216448000a302539e13432232525c8f2c8ad0bc677c04dfe98f79a/cryptocurrencies_scraper-0.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "112bb04bffe3b085148937af86168dcb", "sha256": "b090647eca42deeb4315350395e66e6c5e015ae6f9bab61ad9eb5ea9239f7e4c" }, "downloads": -1, "filename": "cryptocurrencies_scraper-0.0.3.tar.gz", "has_sig": false, "md5_digest": "112bb04bffe3b085148937af86168dcb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5247, "upload_time": "2019-01-12T14:30:37", "url": "https://files.pythonhosted.org/packages/da/11/5a0dfe3b2fef93c3628d0864c891426745df139a2e56b821788dd5516a7c/cryptocurrencies_scraper-0.0.3.tar.gz" } ] }