{ "info": { "author": "Ryan Malaspina", "author_email": "ryan@malaspina.tech", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# slushpool-python\nA simple API wrapper for Slushpool\n## Quick Start\n```python\nfrom slushpool import Slushpool\n\ns = Slushpool(\"access-token\")\n\ns.stats # SlushpoolStats object\ns.account # SlushpoolAccount object\ns.update() # Update stats and account information\n```\n\n## Details\n### Slushpool Class\nThe `Slushpool` class is useful for updating stats and account information at the same time.\n```python\nfrom slushpool import Slushpool\n\ns = Slushpool(\"access-token\")\n\ns.stats # SlushpoolStats object\ns.account # SlushpoolAccount object\ns.update() # Update stats and account information\n```\nAPI access tokens are only required for the `SlushpoolAccount` class.\nIf no token is provided, `Slushpool.account` with be `None`.\n```python\ns = Slushpool()\n\ns.stats # SlushpoolStats object\ns.account # None\n```\nIf public pool stats all you're interested in, it's probably better to use the `SlushpoolStats` class.\nThe difference with providing an access token for stats is you will see your rewards for recent block information instead of `'0.00000000'`.\n\n### SlushpoolStats Class\nSlushpool stats are from [https://slushpool.com/stats/json/optional-token](https://slushpool.com/stats/json/).\nAn example response looks like this:\n```json\n{\n \"blocks\": {\n \"554996\": {\n \"is_mature\": 0,\n \"date_found\": \"2018-12-22 23:14:16\",\n \"hash\": \"000000000000000000310b4e9014504aefc58ef4c14abc3032237ee8ae0e4669\",\n \"confirmations\": 30,\n \"total_shares\": 2446223480232,\n \"total_score\": 1076135671625.1742,\n \"reward\": \"0.00000000\",\n \"mining_duration\": 2737,\n \"date_started\": \"2018-12-22 22:28:39\",\n \"nmc_reward\": \"0.00000000\",\n },\n ... // Most recent 30 blocks\n },\n \"active_workers\": 0,\n \"round_started\": \"2018-12-22 23:14:16\",\n \"luck_30\": \"0.94\",\n \"shares_cdf\": \"94.70\",\n \"luck_b50\": \"1.01\",\n \"luck_b10\": \"0.94\",\n \"active_stratum\": 0,\n \"ghashes_ps\": \"3.86871139874e+27\",\n \"shares\": 15000289359851,\n \"round_duration\": \"04:42:49\",\n \"score\": \"1.87632558846e+13\",\n \"luck_b250\": \"0.97\",\n \"luck_7\": \"0.93\",\n \"luck_1\": \"0.98\"\n}\n```\nThe `SlushpoolStats` objects don't require an access token\n```python\nfrom slushpool import SlushpoolStats\n\nstats = SlushpoolStats() # or\nstats = SlushpoolStats(\"token\")\n\nstats.ghashes_ps # 3.89142412984e+27\n```\n\nIf an access token is provided you will see that account's rewards instead of `\"0.00000000\"`.\n\nThe `SlushpoolStats.blocks.block` object properties are put into a `SlushpoolStats.Block` object.\nThis makes property access nicer. The height is also added as a property of the block.\n```python\nstats.blocks[\"554996\"].height\n```\nThere is also a method to quickly get information about the latest block found by the pool\n```python\n# same as stats.blocks[\"{highest-height}\"].height\nstats.latest_block.height \n```\n`SlushpoolStats` has it's own update method to refresh information\n```python\nstats.update()\n```\n\n### SlushpoolAccount Class\nSlushpool Account information is taken from [https://slushpool.com/accounts/profile/json/required-token](https://slushpool.com/accounts/profile/json/)\n\nAn example response looks like\n```json\n{\n \"username\": \"Username\",\n \"unconfirmed_reward\": \"1.23456789\",\n \"rating\": \"none\",\n \"nmc_send_threshold\": \"1.23456789\",\n \"unconfirmed_nmc_reward\": \"1.23456789\",\n \"estimated_reward\": \"1.23456789\",\n \"hashrate\": \"123456789\",\n \"confirmed_nmc_reward\": \"1.23456789\",\n \"send_threshold\": \"1.23456789\",\n \"confirmed_reward\": \"1.23456789\",\n \"workers\": {\n \"Username.Worker\": {\n \"last_share\": 123456789,\n \"score\": \"1234567.89\",\n \"alive\": true,\n \"shares\": 123456789,\n \"hashrate\": 123456789\n }\n },\n \"wallet\": \"hidden\"\n}\n```\nAn access token is required for `SlushpoolAccount`\n```python\nfrom slushpool import SlushpoolAccount\n\naccount = SlushpoolAccount(\"token\")\naccount.hashrate # in Mh/s\n```\n\nThe `SlushpoolAccount.workers.worker` object properties are put into a `SlushpoolAccount.Worker` object.\nThis makes property access nicer.\n```python\naccount.workers[\"Username.Worker\"]\n```\nThere is also a method to get worker just by name since the username is included in the response\n```python\n# same as account.workers[\"Username.Worker\"]\naccount.worker(\"Worker\")\n```\n`SlushpoolAccount` has it's own update method to refresh information\n```python\naccount.update()\n```\n## Running Tests\nIn the project root run\n```bash\n$ python -m unittest\n```\nThe `unittest` module by default looks for `test*.py` files in a `tests/` directory.\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://gitlab.com/RyanMalaspina/slushpool-python", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "slushpool", "package_url": "https://pypi.org/project/slushpool/", "platform": "", "project_url": "https://pypi.org/project/slushpool/", "project_urls": { "Homepage": "https://gitlab.com/RyanMalaspina/slushpool-python" }, "release_url": "https://pypi.org/project/slushpool/1.0.3/", "requires_dist": [ "requests" ], "requires_python": "", "summary": "An API wrapper for Slushpool.com", "version": "1.0.3" }, "last_serial": 4630437, "releases": { "1.0.2": [ { "comment_text": "", "digests": { "md5": "f531a48c032ff391dd9387f072f03ead", "sha256": "855bf744c60157c124869df25ca88527cf15a62cc720c0256846a17e53428f9d" }, "downloads": -1, "filename": "slushpool-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "f531a48c032ff391dd9387f072f03ead", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7941, "upload_time": "2018-12-24T02:02:39", "url": "https://files.pythonhosted.org/packages/ed/7e/dc0d7eefdad2a344c62295b19a566642cd6cd3e06193c7d4ca64c68d11e4/slushpool-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "949b8397b8ba58f1db9aa6530fefae55", "sha256": "640a3016292000c3deaff401057b2136608479385d49577a8c875995227830a9" }, "downloads": -1, "filename": "slushpool-1.0.2.tar.gz", "has_sig": false, "md5_digest": "949b8397b8ba58f1db9aa6530fefae55", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5278, "upload_time": "2018-12-24T02:02:41", "url": "https://files.pythonhosted.org/packages/1f/af/c65f20c823bfdd302ced1df28a8271a608a78212220bc4ec0804a79c4c48/slushpool-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "1a1a8734c44574e4f1045b0f1bea50dc", "sha256": "af1ebcac80df4030c166a992595c74bf412e29f5030f40898723283475e25e50" }, "downloads": -1, "filename": "slushpool-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "1a1a8734c44574e4f1045b0f1bea50dc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7940, "upload_time": "2018-12-24T02:42:19", "url": "https://files.pythonhosted.org/packages/5d/9a/bafd389a86f235708094039b3c40da055d9ac4daf18e32b36127fca549a1/slushpool-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8186f77e88c119dc52012f19420936e4", "sha256": "fda56be015824d5736b3a941bc198aede5b6281f2f657aa6cc6ce290a47b4a00" }, "downloads": -1, "filename": "slushpool-1.0.3.tar.gz", "has_sig": false, "md5_digest": "8186f77e88c119dc52012f19420936e4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5283, "upload_time": "2018-12-24T02:42:21", "url": "https://files.pythonhosted.org/packages/5e/64/d09324fc879ce69e40681072aa4d9ed8c908d83f39c35d95136881504f84/slushpool-1.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1a1a8734c44574e4f1045b0f1bea50dc", "sha256": "af1ebcac80df4030c166a992595c74bf412e29f5030f40898723283475e25e50" }, "downloads": -1, "filename": "slushpool-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "1a1a8734c44574e4f1045b0f1bea50dc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7940, "upload_time": "2018-12-24T02:42:19", "url": "https://files.pythonhosted.org/packages/5d/9a/bafd389a86f235708094039b3c40da055d9ac4daf18e32b36127fca549a1/slushpool-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8186f77e88c119dc52012f19420936e4", "sha256": "fda56be015824d5736b3a941bc198aede5b6281f2f657aa6cc6ce290a47b4a00" }, "downloads": -1, "filename": "slushpool-1.0.3.tar.gz", "has_sig": false, "md5_digest": "8186f77e88c119dc52012f19420936e4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5283, "upload_time": "2018-12-24T02:42:21", "url": "https://files.pythonhosted.org/packages/5e/64/d09324fc879ce69e40681072aa4d9ed8c908d83f39c35d95136881504f84/slushpool-1.0.3.tar.gz" } ] }