{ "info": { "author": "Patrick Dill", "author_email": "jamespatrickdill@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "Color Guard\n===========\n\n.. image:: https://img.shields.io/pypi/v/colorguard.svg\n :target: https://pypi.org/project/colorguard/\n\n**Color Guard** provides simple bit manipulation and bit flags in Python. Everything is built on\nthe ``int`` type so no number functionality is lost, while making it possible to index and slice binary numbers\nlike strings.\n\n.. image:: https://i.imgur.com/nety2Ty.jpg\n :width: 100%\n\n---------------------\n\nBasic usage:\n\n.. code-block:: pycon\n\n >>> num = Bits(20)\n >>> num\n Bits(0b10100)\n >>> num * 3\n Bits(0b111100)\n >>> num[:4]\n Bits(0b1010)\n >>> num.bit_length()\n 5\n >>> num.join(0b101)\n Bits(0b10100101)\n\nColor Guard also supports conversion to and from other Python data types.\n\n.. code-block:: pycon\n\n >>> Bits.from_binary(\"111101001101\")\n Bits(0b111101001101)\n >>> Bits.from_hex(\"abc123\")\n Bits(0b101010111100000100100011)\n >>> Bits.from_bytes(b\"abc\")\n Bits(0b11000010110001001100011)\n\n >>> bytes(Bits(367))\n b'\\x01o'\n >>> int(Bits(0b1011010))\n 90\n >>> list(Bits(367))\n [1, 0, 1, 1, 0, 1, 1, 1, 1]\n\nFeatures\n--------\n\n- Indexing and slicing of binary numbers like strings\n- Conversion between several Python data types\n- All builtin math operations including bit manipulation and comparison\n- Padded binary numbers that maintain bit length\n- Custom, easy-to-use bit flags\n - Bit field loading from bytes or stream\n - Custom data descriptors for fields\n - Field editing & conversion to bytes\n\nFor further documentation, visit http://paric.xyz/python/", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/reshanie/colorguard", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "colorguard", "package_url": "https://pypi.org/project/colorguard/", "platform": "", "project_url": "https://pypi.org/project/colorguard/", "project_urls": { "Homepage": "http://github.com/reshanie/colorguard" }, "release_url": "https://pypi.org/project/colorguard/0.3.1/", "requires_dist": null, "requires_python": "", "summary": "Better bit manipulation that allows indexing, and automatic bit flags.", "version": "0.3.1" }, "last_serial": 4663313, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "12bde6197666b5b707d59d4838db6edb", "sha256": "a904738289777a3af15a6759453e9cb6fecb2c7984f0be6d019d58d1dd75cb04" }, "downloads": -1, "filename": "colorguard-0.1.tar.gz", "has_sig": false, "md5_digest": "12bde6197666b5b707d59d4838db6edb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3435, "upload_time": "2017-09-24T22:49:16", "url": "https://files.pythonhosted.org/packages/43/2d/054342751c1b9ef11849390bfd06c5c1ffcf71ca5a02e27bc0890b12c7f2/colorguard-0.1.tar.gz" } ], "0.2a2": [ { "comment_text": "", "digests": { "md5": "7ab54985f3703bf4f635334809fe17a2", "sha256": "6ffdd44478afb292ca66e8c609eb28734af43eafab853f5cd8842a02c19c293d" }, "downloads": -1, "filename": "colorguard-0.2a2.tar.gz", "has_sig": false, "md5_digest": "7ab54985f3703bf4f635334809fe17a2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3512, "upload_time": "2017-09-25T04:08:08", "url": "https://files.pythonhosted.org/packages/39/dc/4fe3ba0f37ea3d795cb76eedbd6da995d1d2eeb0dbc5eb5428eba76c97b6/colorguard-0.2a2.tar.gz" } ], "0.2a3": [ { "comment_text": "", "digests": { "md5": "0393973832c8d8c2748763c5cf5e5580", "sha256": "8a0b3b948a52858012778aed2736651d17f9aff5217bf7a4497c80a06db94206" }, "downloads": -1, "filename": "colorguard-0.2a3.tar.gz", "has_sig": false, "md5_digest": "0393973832c8d8c2748763c5cf5e5580", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3506, "upload_time": "2017-09-27T18:48:46", "url": "https://files.pythonhosted.org/packages/75/5a/1b23484bab1b3914a1674ffa6178f9e64fdedc46ffed2716e9c13723db4c/colorguard-0.2a3.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "86f78ae20ff28dfe344ab66ac3a6ff93", "sha256": "b4b2090c737c2a537f020a5e4446ed959a2e7c486eff4aff6399349e10f50e77" }, "downloads": -1, "filename": "colorguard-0.3.tar.gz", "has_sig": false, "md5_digest": "86f78ae20ff28dfe344ab66ac3a6ff93", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6278, "upload_time": "2019-01-05T12:59:31", "url": "https://files.pythonhosted.org/packages/ad/ac/60445f14dc0dfc0fa611d58b333bc809d95a504ad2026840fdd9239e234a/colorguard-0.3.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "21959ce67a4944a3e534ee3f6fcdd0c3", "sha256": "2b97f292627d03ddb630f819655f78bff2a49ec69840dc6790a76e80484580ac" }, "downloads": -1, "filename": "colorguard-0.3.1.tar.gz", "has_sig": false, "md5_digest": "21959ce67a4944a3e534ee3f6fcdd0c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6366, "upload_time": "2019-01-05T13:05:51", "url": "https://files.pythonhosted.org/packages/b3/6c/eeb8de26a41674e4f0e729c3dc2726f4f9f38c67b132a402be0d80c2fd61/colorguard-0.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "21959ce67a4944a3e534ee3f6fcdd0c3", "sha256": "2b97f292627d03ddb630f819655f78bff2a49ec69840dc6790a76e80484580ac" }, "downloads": -1, "filename": "colorguard-0.3.1.tar.gz", "has_sig": false, "md5_digest": "21959ce67a4944a3e534ee3f6fcdd0c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6366, "upload_time": "2019-01-05T13:05:51", "url": "https://files.pythonhosted.org/packages/b3/6c/eeb8de26a41674e4f0e729c3dc2726f4f9f38c67b132a402be0d80c2fd61/colorguard-0.3.1.tar.gz" } ] }