{ "info": { "author": "Ben Hamilton", "author_email": "bhamiltoncx@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Internationalization", "Topic :: Text Processing" ], "description": "Unicode Code Points for Python\n==============================\n\nUntil Python 3.3, the Python runtime could be compiled in one of two Unicode modes:\n\n1. ``sys.maxunicode == 0x10FFFF``\n\n In this mode, Python's Unicode strings support the full range of Unicode code points from U+0000 to U+10FFFF. One code point is represented by one string element::\n\n >>> import sys\n >>> hex(sys.maxunicode)\n '0x10ffff'\n >>> len(u'\\U0001F40D')\n 1\n >>> [c for c in u'\\U0001F40D']\n [u'\\U0001f40d']\n\n This is the default for Python 2.7 on Linux, as well as universally on Python 3.3 and later across all operating systems.\n\n2. ``sys.maxunicode == 0xFFFF``\n\n In this mode, Python's Unicode strings only support the range of Unicode code points from U+0000 to U+FFFF. Any code points from U+10000 through U+10FFFF are represented using a pair of string elements in the UTF-16 encoding::\n\n >>> import sys\n >>> hex(sys.maxunicode)\n '0xffff'\n >>> len(u'\\U0001F40D')\n 2\n >>> [c for c in u'\\U0001F40D']\n [u'\\ud83d', u'\\udc0d']\n\n This is the default for Python 2.7 on macOS and Windows.\n\nThis runtime difference makes writing Python modules to manipulate Unicode strings as series of codepoints quite inconvenient.\n\nThe codepoints module\n=====================\n\nThis module solves the problem by exposing APIs to convert Unicode strings to and from lists of code points, regardless of the underlying setting for ``sys.maxunicode``::\n\n >>> hex(sys.maxunicode)\n '0xffff'\n >>> snake = tuple(codepoints.from_unicode(u'\\U0001F40D'))\n >>> len(snake)\n 1\n >>> snake[0]\n 128013\n >> hex(snake[0])\n '0x1f40d'\n >>> codepoints.to_unicode(snake)\n u'\\U0001f40d'", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/bhamiltoncx/pycodepoints/", "keywords": "unicode utf16 surrogate pair bmp smp astral codepoint codeunit emoji maxunicode", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "codepoints", "package_url": "https://pypi.org/project/codepoints/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/codepoints/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/bhamiltoncx/pycodepoints/" }, "release_url": "https://pypi.org/project/codepoints/1.0/", "requires_dist": null, "requires_python": null, "summary": "Converts code point sequences to and from Unicode strings", "version": "1.0" }, "last_serial": 2645613, "releases": { "0.9": [ { "comment_text": "", "digests": { "md5": "a091199f35805cc1840f04d759b0b728", "sha256": "4c98fab2d01a3abc9147a4448a439b82633a6778d4f450faff68219b765cd94f" }, "downloads": -1, "filename": "codepoints-0.9.tar.gz", "has_sig": false, "md5_digest": "a091199f35805cc1840f04d759b0b728", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2076, "upload_time": "2017-02-10T18:54:25", "url": "https://files.pythonhosted.org/packages/26/92/9684786f3b23427586eda9e12c668c3cdaaa52764746f7ed2c29ce112342/codepoints-0.9.tar.gz" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "037c7b5e8d1c0e60670e9b5de673b97f", "sha256": "241fa77a03e6f0340cc6d18a875ef4888d10b20aa67f0128d0603482a11e16eb" }, "downloads": -1, "filename": "codepoints-1.0.zip", "has_sig": false, "md5_digest": "037c7b5e8d1c0e60670e9b5de673b97f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6116, "upload_time": "2017-02-16T01:08:12", "url": "https://files.pythonhosted.org/packages/8d/28/49bbe1e81240ca9cfa825c02cee48bac2facd0f8cdf6a5a17f71856a19a3/codepoints-1.0.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "037c7b5e8d1c0e60670e9b5de673b97f", "sha256": "241fa77a03e6f0340cc6d18a875ef4888d10b20aa67f0128d0603482a11e16eb" }, "downloads": -1, "filename": "codepoints-1.0.zip", "has_sig": false, "md5_digest": "037c7b5e8d1c0e60670e9b5de673b97f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6116, "upload_time": "2017-02-16T01:08:12", "url": "https://files.pythonhosted.org/packages/8d/28/49bbe1e81240ca9cfa825c02cee48bac2facd0f8cdf6a5a17f71856a19a3/codepoints-1.0.zip" } ] }