{ "info": { "author": "Se\u00e1n Hewitt", "author_email": "contact@2sh.me", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering :: Mathematics" ], "description": "# Number Radix\n\nThis is a Python script and library to encode, decode and format numbers\nincluding fractions and exponential notation in radixes/bases other than\ndecimal, such as octal, dozenal/duodecimal, hexadecimal, base57 and base62. The\nradix can also be determined by any number of digits specified: 0123456789ab...\n\n## Requirements\n* Python 3\n\n## Installation\nFrom the Python Package Index:\n```\npip install num-radix\n```\n\nOr download and run:\n```\npython3 setup.py install\n```\n\n## Command-Line\nUse the ```--help``` argument for help.\n```\nnum-radix --help\n```\n\nBy default, the script encodes and decodes in dozenal.\n\nThis outputs '6X,534;3000' encoded in dozenal.\n```\nnum-radix --encode 142456.25 --format ',.4f'\n```\nThe format string causes the output to have a scale of 4 and every 3 integer\ndigits to be separated by a comma.\nThe format is given in [Python format string syntax](https://docs.python.org/3/library/string.html#format-specification-mini-language).\n\nFormat with e-notation. This outputs '4;133X82e-0E'.\n```\nnum-radix --encode 0.000000000005526745 --format '.6e'\n```\n\nEncode in hexadecimal.\n```\nnum-radix --encode 142 --base hex\n```\n\nDecode back to a decimal from dozenal.\n```\nnum-radix --decode '6X534;3'\n```\n\nThe input and output can be piped. Each line of input is encoded\n(or decoded) and output on a new line.\n```\necho -e \"142\\n4353\" | num-radix --encode - | cat\n```\n\n## Python\nImport the library.\n```\nfrom num_radix import Radix\n```\n\nCreate a radix.\n```\ndozenal = Radix.dozenal()\nhexa = Radix.hex()\nbase20 = Radix(\"0123456789ABCDEFGHIJ\", sep=\"|\")\n```\n\nEncode with the radix object.\n```\ndozenal.encode(3546)\ndozenal.encode(142456.25, \"013.4f\")\nnumbers = [142456.25, 34, 0.000345]\n\"These numbers {:013.4f}, {}, {:e} are in dozenal\".format(*dozenal.wrap(numbers))\n```\n\nEncoding date & time.\n```\nfrom datetime import datetime\nnow = datetime.now()\ndozenal_now = dozenal.wrap(now.timetuple()[:6])\n\"{}-{:02}-{:02} {:02}:{:02}:{:02}\".format(*dozenal_now)\n```\n\nDecode with the radix object.\n```\ndozenal.decode(\"6X534;3\")\n```\nThere are more examples in the demo section at the end of the ```__init__.py``` file.\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/2sh/num-radix", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "num-radix", "package_url": "https://pypi.org/project/num-radix/", "platform": "", "project_url": "https://pypi.org/project/num-radix/", "project_urls": { "Homepage": "https://github.com/2sh/num-radix" }, "release_url": "https://pypi.org/project/num-radix/1.0.2/", "requires_dist": null, "requires_python": ">=3", "summary": "Number radix/base encoding, decoding and formatting", "version": "1.0.2" }, "last_serial": 4141683, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "f1e2961049591e9d48660c7229d6ce4f", "sha256": "7059e08a097a3756fcc0357d613be3b313a59f9d28066604d41b978e7f555127" }, "downloads": -1, "filename": "num_radix-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "f1e2961049591e9d48660c7229d6ce4f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 7086, "upload_time": "2018-08-03T14:34:15", "url": "https://files.pythonhosted.org/packages/1f/cc/07d9acb398c2e937bff58782379bba4204d4065872a377f9fc97f124e559/num_radix-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5aaddb923a42e96705ed114e7c8434e8", "sha256": "d998c8743e13c4e1e4cda461667734700bfaf2e7536febd494d029daa301ec2d" }, "downloads": -1, "filename": "num-radix-1.0.0.tar.gz", "has_sig": false, "md5_digest": "5aaddb923a42e96705ed114e7c8434e8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 6674, "upload_time": "2018-08-03T14:34:16", "url": "https://files.pythonhosted.org/packages/00/f8/8f83043b3de9f839f681b71a58d9f039413959f83b8e6b0a31ec2a825965/num-radix-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "7c5d29c1f0f946753a6d8268fa9f0a84", "sha256": "d5d65a7fc29c950f052fb5c669111728b418518dba648d337caf927e4520a1e3" }, "downloads": -1, "filename": "num_radix-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "7c5d29c1f0f946753a6d8268fa9f0a84", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 7085, "upload_time": "2018-08-03T14:38:34", "url": "https://files.pythonhosted.org/packages/14/5a/31b42dbbc33eed971960b249a0379f2f2a0b2e0f2c97137cfaae88e3fcc4/num_radix-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9fbaa9ae8835805bca352a3d730534d4", "sha256": "f976a0caa6d6f934cff4e451998768bd614b50a20c4b5e4c75a75ebde4931a51" }, "downloads": -1, "filename": "num-radix-1.0.1.tar.gz", "has_sig": false, "md5_digest": "9fbaa9ae8835805bca352a3d730534d4", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 6676, "upload_time": "2018-08-03T14:38:36", "url": "https://files.pythonhosted.org/packages/b1/ea/c23c92fa6772e0b430986977888abf0b80691931d6f609c6adaec109fb78/num-radix-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "08c9c8033effd6f765b4c92e9a894f36", "sha256": "8c58d821a45d7f1707fd389cd32b9dbd7affbd3ee317d458a59be63e1ef06e9b" }, "downloads": -1, "filename": "num_radix-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "08c9c8033effd6f765b4c92e9a894f36", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 7735, "upload_time": "2018-08-06T20:13:06", "url": "https://files.pythonhosted.org/packages/7c/59/d988aeec4471a2e6c1a19961a8d134a4403b96df2f79658262a9aff6f588/num_radix-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c6415e9d799b59a91d49b91496b66e42", "sha256": "eba165c958faa92e979ddfe82089055dc22da852625385849bc0855d3f0d92a0" }, "downloads": -1, "filename": "num-radix-1.0.2.tar.gz", "has_sig": false, "md5_digest": "c6415e9d799b59a91d49b91496b66e42", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 6699, "upload_time": "2018-08-06T20:13:07", "url": "https://files.pythonhosted.org/packages/f7/cd/df880fabb8eaddbda9bdfc29562d7aef91b91d40270e7b808656e00fbef8/num-radix-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "08c9c8033effd6f765b4c92e9a894f36", "sha256": "8c58d821a45d7f1707fd389cd32b9dbd7affbd3ee317d458a59be63e1ef06e9b" }, "downloads": -1, "filename": "num_radix-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "08c9c8033effd6f765b4c92e9a894f36", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 7735, "upload_time": "2018-08-06T20:13:06", "url": "https://files.pythonhosted.org/packages/7c/59/d988aeec4471a2e6c1a19961a8d134a4403b96df2f79658262a9aff6f588/num_radix-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c6415e9d799b59a91d49b91496b66e42", "sha256": "eba165c958faa92e979ddfe82089055dc22da852625385849bc0855d3f0d92a0" }, "downloads": -1, "filename": "num-radix-1.0.2.tar.gz", "has_sig": false, "md5_digest": "c6415e9d799b59a91d49b91496b66e42", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 6699, "upload_time": "2018-08-06T20:13:07", "url": "https://files.pythonhosted.org/packages/f7/cd/df880fabb8eaddbda9bdfc29562d7aef91b91d40270e7b808656e00fbef8/num-radix-1.0.2.tar.gz" } ] }