{ "info": { "author": "Takumi Sueda", "author_email": "puhitaku@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7" ], "description": "# uint [![CI](https://travis-ci.org/puhitaku/uint.svg?branch=master)](https://travis-ci.org/puhitaku/uint) [![Coverage Status](https://coveralls.io/repos/github/puhitaku/uint/badge.svg?branch=master)](https://coveralls.io/github/puhitaku/uint?branch=master)\n\n*Fixed-width integer and calculation for Python*\n\n```\n$ pip install uint\n```\n\n\n## Fixed-width integers for Python\n\nuint provides two classes: `Uint` and `Int`. They are calculated like `int` but is fixed-width so they behave like ones that you're familiar with ... like in C language.\n\n```\nIn [1]: from uint import Uint, Int\n\nIn [2]: u, i = Uint(0xff, 8), Int(0xff, 8)\n\nIn [3]: u\nOut[3]: \n\nIn [4]: i\nOut[4]: \n\nIn [5]: u << 2 >> 1\nOut[5]: \n\nIn [6]: i << 2 >> 1\nOut[6]: \n```\n\n\nOf course they overflows when you do like:\n\n```\nIn [1]: from uint import Uint, Int\n\nIn [2]: u, i = Uint(0xff, 8), Int(0x7f, 8)\n\nIn [3]: u, i\nOut[3]: (, )\n\nIn [4]: u+1, i+1\nOut[4]: (, )\n```\n\n## Register with multiple fields inside\n\nThe original purpose of this package is to reduce labor of calculating \"register values\" in several MCUs and SoCs. See `examples` directory for detailed usage.\n\n```\nIn [1]: from uint import Register\n\nIn [2]: reg = Register('reg')\n\nIn [3]: reg[15:8] = 'f1'\n\nIn [4]: reg[7:0] = 'f2'\n\nIn [5]: reg['f1'] = 0x5A\n\nIn [6]: reg['f2'] = 0x0F\n\nIn [7]: hex(reg.encode())\nOut[7]: '0x5a0f'\n\nIn [8]: reg.decode(0x1234)\n\nIn [9]: reg['f1'].value.wire.hex\nOut[9]: \"8'h12\"\n\nIn [10]: reg['f2'].value.wire.hex\nOut[10]: \"8'h34\"\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/puhitaku/uint", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "uint", "package_url": "https://pypi.org/project/uint/", "platform": "", "project_url": "https://pypi.org/project/uint/", "project_urls": { "Homepage": "https://github.com/puhitaku/uint" }, "release_url": "https://pypi.org/project/uint/0.2.1/", "requires_dist": null, "requires_python": "", "summary": "Fixed-width integer and calculation for Python", "version": "0.2.1" }, "last_serial": 5743161, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "2cbb54e323d590566549fb32adf235de", "sha256": "5f59b58bad6b2bbb3c900a3f8a2a95342a3fed1e31cd27473a8ff9fd9523aa5a" }, "downloads": -1, "filename": "uint-0.0.1.tar.gz", "has_sig": false, "md5_digest": "2cbb54e323d590566549fb32adf235de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3209, "upload_time": "2019-08-12T20:21:09", "url": "https://files.pythonhosted.org/packages/05/8d/737da36e07c9039def83bf86403867873d2fa61b52d31342a100fcc1c8bb/uint-0.0.1.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "a2e71b32c0e7b5946321be4311542735", "sha256": "793a79c9c31a19019f4254ad19565e7b20a0c6c289680cf54a426d87a6a13e6a" }, "downloads": -1, "filename": "uint-0.1.0.tar.gz", "has_sig": false, "md5_digest": "a2e71b32c0e7b5946321be4311542735", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6773, "upload_time": "2019-08-27T15:29:08", "url": "https://files.pythonhosted.org/packages/56/3d/9d29a174a3a0d866ecde7248312fa51f717cf343aaa242c481cb31251488/uint-0.1.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "4624431c206ac7a116f5b4d84bab8f6a", "sha256": "f114406f330c9d2caa1fc974280d3d19bab175191712fdb0475ba25941b685fd" }, "downloads": -1, "filename": "uint-0.2.1.tar.gz", "has_sig": false, "md5_digest": "4624431c206ac7a116f5b4d84bab8f6a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7071, "upload_time": "2019-08-28T14:58:54", "url": "https://files.pythonhosted.org/packages/b9/5e/423241e382403a3a52dd32a51298ca32bb63d0d404cf8e04e0b449a5191d/uint-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4624431c206ac7a116f5b4d84bab8f6a", "sha256": "f114406f330c9d2caa1fc974280d3d19bab175191712fdb0475ba25941b685fd" }, "downloads": -1, "filename": "uint-0.2.1.tar.gz", "has_sig": false, "md5_digest": "4624431c206ac7a116f5b4d84bab8f6a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7071, "upload_time": "2019-08-28T14:58:54", "url": "https://files.pythonhosted.org/packages/b9/5e/423241e382403a3a52dd32a51298ca32bb63d0d404cf8e04e0b449a5191d/uint-0.2.1.tar.gz" } ] }