{ "info": { "author": "Beijing ColorfulClouds Technology Co.,Ltd.", "author_email": "admin@caiyunapp.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python" ], "description": "# rb3, the rb fork support Python3.7\n\n## Changes compared to [getsentry/rb](https://github.com/getsentry/rb)\n\n**Not a compatibility upgrade.**\n\nFrom this version, this fork of rb will only support Python3.7+ (Python3.5+ is tested but not recommend).\n\nAt the moment, we focus on how to make rb work under Python3.7 like it workd well on Python2.7.\n\nChange in `crc32`:\n\n- [Python 3 crc32 documentation clarifications](https://bugs.python.org/issue22341)\n- [crc32 Python 3 doc](https://docs.python.org/3/library/binascii.html)\n- [crc32 Python 2 doc](https://docs.python.org/2/library/binascii.html)\n\nFor now, we decide to support Python2-like `crc32` computing result by editing `rb/router.py`:\n\n```python\nclass PartitionRouter(BaseRouter):\n \"\"\"A straightforward router that just individually routes commands to\n single nodes based on a simple ``crc32 % node_count`` setup.\n\n This router requires that the hosts are gapless which means that\n the IDs for N hosts range from 0 to N-1.\n\n ``crc32`` returns different value in Python2 and Python3, for details\n check this link: https://bugs.python.org/issue22341.\n \"\"\"\n\n def __init__(self, cluster):\n BaseRouter.__init__(self, cluster)\n assert_gapless_hosts(self.cluster.hosts)\n\n def get_host_for_key(self, key):\n if isinstance(key, text_type):\n k = key.encode('utf-8')\n else:\n k = bytes_type(key)\n # Make sure return value same as in Python3\n # return (crc32(k) & 0xffffffff) % len(self.cluster.hosts)\n\n # Make sure return value same as in Python2\n crc_res = crc32(k)\n crc_res = (crc_res - ((crc_res & 0x80000000) <<1))\n return crc_res % len(self.cluster.hosts)\n```\n\nBut may turn to use Python 3's native `crc32` function in the future.\n\n## TODO\n\n- [ ] option to choose `crc32`'s method\n- [ ] fix macOS travis test\n- [ ] fix pypy travis test\n\n# rb's original README\n\n![logo](https://github.com/getsentry/rb/blob/master/docs/_static/rb.png?raw=true)\n\nrb - the redis blaster.\n\nThe fastest way to talk to many redis nodes. Can do routing as well as\nblindly blasting commands to many nodes. How does it work?\n\nFor full documentation see [rb.rtfd.org](http://rb.rtfd.org/)\n\n## Quickstart\n\nSet up a cluster:\n\n```python\nfrom rb import Cluster\n\ncluster = Cluster({\n 0: {'port': 6379},\n 1: {'port': 6380},\n 2: {'port': 6381},\n 3: {'port': 6382},\n}, host_defaults={\n 'host': '127.0.0.1',\n})\n```\n\nAutomatic routing:\n\n```python\nresults = []\nwith cluster.map() as client:\n for key in range(100):\n client.get(key).then(lambda x: results.append(int(x or 0)))\n\nprint('Sum: %s' % sum(results))\n```\n\nFanout:\n\n```python\nwith cluster.fanout(hosts=[0, 1, 2, 3]) as client:\n infos = client.info()\n```\n\nFanout to all:\n\n```python\nwith cluster.fanout(hosts='all') as client:\n client.flushdb()\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/caiyunapp/rb3", "keywords": "Redis rb python3", "license": "", "maintainer": "", "maintainer_email": "", "name": "rb3", "package_url": "https://pypi.org/project/rb3/", "platform": "", "project_url": "https://pypi.org/project/rb3/", "project_urls": { "Homepage": "https://github.com/caiyunapp/rb3" }, "release_url": "https://pypi.org/project/rb3/1.8/", "requires_dist": null, "requires_python": "", "summary": "rb3, the redis blaster which support Python 3.7", "version": "1.8" }, "last_serial": 5807211, "releases": { "1.8": [ { "comment_text": "", "digests": { "md5": "1a5549bbb5a9ad30b16d30505dd1e75b", "sha256": "67fb6586114c49956ba569f28cf95c5be41c72d68461fd9b4f1d21ec442bc44d" }, "downloads": -1, "filename": "rb3-1.8.tar.gz", "has_sig": false, "md5_digest": "1a5549bbb5a9ad30b16d30505dd1e75b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21939, "upload_time": "2019-08-09T09:59:43", "url": "https://files.pythonhosted.org/packages/91/00/355164ad68c4b96bed337e3aa54ed9c592c4c54d2e339a02526c221297a0/rb3-1.8.tar.gz" } ], "1.8.1a0": [ { "comment_text": "", "digests": { "md5": "6a7bc4580684e4f38ca89c949bd3b600", "sha256": "befd4a3932e436f97918729e9aa7eb5a3ea687800eb818db1272e8ccb1547d80" }, "downloads": -1, "filename": "rb3-1.8.1a0.tar.gz", "has_sig": false, "md5_digest": "6a7bc4580684e4f38ca89c949bd3b600", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21981, "upload_time": "2019-09-10T06:38:42", "url": "https://files.pythonhosted.org/packages/4b/2c/a14eb285390212fd7fc4a55532fdc7ddb79830f179b841dc4b4750bc1987/rb3-1.8.1a0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1a5549bbb5a9ad30b16d30505dd1e75b", "sha256": "67fb6586114c49956ba569f28cf95c5be41c72d68461fd9b4f1d21ec442bc44d" }, "downloads": -1, "filename": "rb3-1.8.tar.gz", "has_sig": false, "md5_digest": "1a5549bbb5a9ad30b16d30505dd1e75b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21939, "upload_time": "2019-08-09T09:59:43", "url": "https://files.pythonhosted.org/packages/91/00/355164ad68c4b96bed337e3aa54ed9c592c4c54d2e339a02526c221297a0/rb3-1.8.tar.gz" } ] }