{ "info": { "author": "Zachary Voase", "author_email": "zack@biga.mp", "bugtrack_url": null, "classifiers": [], "description": "h2. What is baseconv?\n\nbaseconv is a generic _base conversion_ library for Python. It allows you to\nconvert any number between binary, hexadecimal, decimal, octal or any other\nbase you can define. A base is a method of representing numbers; using two or\nmore different _words_ you can represent any conceivable number using an\nordered combination of those words. For example, the _decimal_ base is made up\nof 10 words: 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9. _Binary_ uses only 0 and 1.\n\nh2. Usage\n\nh3. Installation\n\nTo install baseconv, simply pull the repository using @git@ (for more info\nconsult the \"github documentation\":http://github.com/guides), @cd@ into the\ndirectory and run the following command as root:\n\n\tpython setup.py install\n\nThis will copy @baseconv.py@ to Python's @site-packages@ directory, and you\ncan then import the library in your code via @import baseconv@.\n\nh3. Using the Library In Your Code\n\nIn order to carry out the most common features of base conversion, the library\ncomes equipped with the pre-defined bases @DECIMAL@, @BINARY@, @HEXADECIMAL@,\n@OCTAL@, @ALPHA\\_LOWER@, @ALPHA\\_UPPER@ and @ALPHA@. This means you can, out\nof the box, convert between all of these bases. An example usage case is shown\nbelow; note that numbers are held as instances of the @baseconv.Number@ class,\nand bases as @baseconv.Base@ instances. The attributes @decimal@, @base@,\n@values@ and @indices@ are all Python _descriptors_; setting or otherwise\nchanging one will cause the number's other attributes to update. The following\ncode sample shows how you might use the library in a basic way:\n\n\t>>> from baseconv import \\*\n\t>>> num = BINARY('1010011010') # Create a number\n\t>>> num # Show the representation of a number\n\tNumber(BINARY, '1010011010')\n\t>>> num.decimal\n\t666\n\t>>> num.decimal = 423 # Change a number's decimal value\n\t>>> num # The number's binary value has changed automatically\n\tNumber(BINARY, '110100111')\n\t>>> num.base = HEXADECIMAL # Change a number's base\n\t>>> num\n\tNumber(HEXADECIMAL, '1A7')\n\t>>> print num # Print a number as a string; also accessible via str(num)\n\t0x1A7\n\t>>> num.values # The sequence of base-words that this number represents\n\t'1A7'\n\t>>> num.values = 'FFC0DE' # Set this numbers values list\n\t>>> num # Number has changed accordingly\n\tNumber(HEXADECIMAL, 'FFC0DE')\n\t>>> num.indices # The decimal value of each word in this number\n\t[15, 15, 12, 0, 13, 14]\n\t>>> num.indices = [1, 10, 7] # Set this number's indices attribute\n\t>>> num\n\tNumber(HEXADECIMAL, '1A7')\n\nh2. About the Author\n\nMy name is Zachary Voase, and you can get to my personal home page (which has links to all my other pages) \"here\":http://biga.mp.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "BaseConv", "package_url": "https://pypi.org/project/BaseConv/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/BaseConv/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/BaseConv/0.1a/", "requires_dist": null, "requires_python": null, "summary": "A generic base-conversion library for Python.", "version": "0.1a" }, "last_serial": 74404, "releases": { "0.1a": [] }, "urls": [] }