{ "info": { "author": "Anne Mulhern", "author_email": "amulhern@redhat.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License (GPL)", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Scientific/Engineering :: Mathematics", "Topic :: Software Development :: Libraries" ], "description": "justbases-string\n================\n\nPurpose\n-------\nA small library for generating a human readable string value from a number\nwith an arbitrary base. The number is represented by five elements:\n\n* a sign\n\n -1, 1, or 0 as appropriate\n\n* an integer part\n\n a list of non-negative ints, where each element is less than the base value\n\n* a non repeating fractional part\n\n a list of non-negative ints, where each element is less than the base value\n\n* a repeating fractional part\n\n a list of non-negative ints, where each element is less than the base value\n\n* a base\n\n the base of the number, must be an integer greater than 1.\n\n\nUsage\n-----\n\n::\n\n >>> from justbases_string import *\n >>> xformer = String(DisplayConfig(), 2)\n >>> xformer.xform(-1, [1, 0, 1], [], [1, 0], 0)\n '-101.(10)_2'\n >>> xformer.xform(0, [], [0, 0], [], 0)\n '0_2'\n\nAn exception is raised if the parts of the number do not conform to the\nnecessary constraints: ::\n\n >>> xformer.xform(1, [2], [0, 0], [], 0)\n Traceback (most recent call last):\n ...\n\n >>> xformer.xform(1, [-1], [0, 0], [], 0)\n Traceback (most recent call last):\n ...\n\nThere are numerous options for configuring the string result: ::\n\n >>> digits_config = DigitsConfig(use_letters=False)\n >>> xformer = String(DisplayConfig(digits_config=digits_config), 1024)\n >>> xformer.xform(1, [2], [2, 4, 256], [], 0)\n '2.2~4~256_1024'\n\n >>> digits_config = DigitsConfig(use_caps=True)\n >>> xformer = String(DisplayConfig(digits_config=digits_config), 16)\n >>> xformer.xform(1, [], [0, 13], [], 0)\n '0.0D_16'\n\nThe final argument is the relation of the value being displayed to the value\nit represents: ::\n\n >>> xformer.xform(1, [2], [2, 4, 256], [], Fraction(1, 3))\n '< 2.2~4~256_1024'", "description_content_type": null, "docs_url": "https://pythonhosted.org/justbases-string/", "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "Apache 2.0", "maintainer": null, "maintainer_email": null, "name": "justbases-string", "package_url": "https://pypi.org/project/justbases-string/", "platform": "Linux", "project_url": "https://pypi.org/project/justbases-string/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/justbases-string/0.1/", "requires_dist": null, "requires_python": null, "summary": "string representation of a rational number in any base", "version": "0.1" }, "last_serial": 2321674, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "0e85b31a9eadf15ee004ea28021aa380", "sha256": "4d6f3260cd80c30b2396a9a034a858726a3922c0ab83610e1294da616e5e1ede" }, "downloads": -1, "filename": "justbases-string-0.1.tar.gz", "has_sig": false, "md5_digest": "0e85b31a9eadf15ee004ea28021aa380", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14279, "upload_time": "2016-09-02T18:28:06", "url": "https://files.pythonhosted.org/packages/9d/96/76a4b4b30e37b911e3804cdecbd1a95ea9ea7da6b1f9a3ac3577587d0bfe/justbases-string-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0e85b31a9eadf15ee004ea28021aa380", "sha256": "4d6f3260cd80c30b2396a9a034a858726a3922c0ab83610e1294da616e5e1ede" }, "downloads": -1, "filename": "justbases-string-0.1.tar.gz", "has_sig": false, "md5_digest": "0e85b31a9eadf15ee004ea28021aa380", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14279, "upload_time": "2016-09-02T18:28:06", "url": "https://files.pythonhosted.org/packages/9d/96/76a4b4b30e37b911e3804cdecbd1a95ea9ea7da6b1f9a3ac3577587d0bfe/justbases-string-0.1.tar.gz" } ] }