{
"info": {
"author": "Alvin Lindstam",
"author_email": "alvin.lindstam@gmail.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6"
],
"description": "grapheme\n========\n\nA Python package for working with user perceived characters. More specifically,\nstring manipulation and calculation functions for working with grapheme cluster\ngroups (graphemes) as defined by the `Unicode Standard Annex #29 `_.\n\n`documentation `_\n\n.. code-block:: console\n\n pip install grapheme\n\nThe currently supported version of Unicode: 12.0.0 (12.1.0 has/will add a single codepoint, not affecting graphemes).\n\nWhat? Why?\n==========\n\nUnicode strings are made up of a series of unicode characters, but a unicode character does not\nalways map to a user perceived character. Some human perceived characters are represented as two\nor more unicode characters.\n\nHowever, all built in python string functions and string methods work with single unicode characters\nwithout considering their connection to each other.\n\n.. code-block:: python\n\n >>> string = 'u\u0332n\u0332d\u0332e\u0332r\u0332l\u0332i\u0332n\u0332e\u0332d\u0332'\n >>> len(string)\n 20\n >>> grapheme.length(string)\n 10\n >>> string[:3]\n 'u\u0332n'\n >>> grapheme.substr(string, 0, 3)\n 'u\u0332n\u0332d\u0332'\n\nThis library implements the unicode default rules for extended grapheme clusters, and provides\na set of functions for string manipulation based on graphemes.\n\nDocumentation\n=============\n\nSee ``_.\n\nWhen should I consider graphemes instead of unicode characters?\n===============================================================\n\nYou should consider working with graphemes over unicode code points when:\n\n* You wish to count characters as perceived by users.\n* You wish to split or truncate text at some user perceived lengths.\n* You wish to split or truncate text without risk of corrupting the characters.\n* Formatting text by length, such as creating text based tables in monospaced fonts\n\nYou should work with normal python string functions when:\n\n* You wish to count or split by unicode codepoints for compliance with storage\n limitations (such as database maximum length)\n* When working with systems that put limits on strings by unicode character\n lengths\n* When you prioritize performance over correctness (see performance notes below)\n* When working with very long strings (see performance notes below)\n* If simplicity is more important than accuracy\n\nPerformance\n===========\n\nCalculating graphemes require traversing the string and checking each character\nagainst a set of rules and the previous character(s). Because of this, all\nfunctions in this module will scale linearly to the string length.\n\nWhenever possible, they will only traverse the string for as long as needed and return\nearly as soon as the requested output is generated. For example, the `grapheme.slice`\nfunction only has to traverse the string until the last requested grapheme is found, and\ndoes not care about the rest of the string.\n\nYou should probably only use this package for testing/manipulating fairly short strings\nor with the beginning of long strings.\n\nWhen testing with a string of 10 000 ascii characters, and a 3.1 GHz processor, the execution\ntime for some possible calls is roughly:\n\n================================================================ ==========================\nCode Approximate execution time\n================================================================ ==========================\n`len(long_ascii_string)` 8.1e-10 seconds\n`grapheme.length(long_ascii_string)` 1.5e-04 seconds\n`grapheme.length(long_ascii_string, 500)` 8.7e-06 seconds\n`long_ascii_string[0:100]` 1.3e-09 seconds\n`grapheme.slice(long_ascii_string, 0, 100)` 2.5e-06 seconds\n`long_ascii_string[:100] in long_ascii_string` 4.0e-09 seconds\n`grapheme.contains(long_ascii_string, long_ascii_string[:100])` 3.9e-06 seconds\n`long_ascii_string[-100:] in long_ascii_string` 2.1e-07 seconds\n`grapheme.contains(long_ascii_string, long_ascii_string[-100:])` 1.9e-04 seconds\n================================================================ ==========================\n\nExecution times may improve in later releases, but calculating graphemes is and will continue\nto be notably slower than just counting unicode code points.\n\nExamples of grapheme cluster groups\n===================================\n\nThis is not a complete list, but a some examples of when graphemes use multiple\ncharacters:\n\n* CR+LF\n* Hangul (korean)\n* Emoji with modifiers\n* Combining marks\n* Zero Width Join\n\nDevelopment quick start\n=======================\n\nIf you wish to contribute or edit this package, create a fork and clone it.\n\nThen install in locally editable (``-e``) mode and run the tests.\n\n.. code-block:: console\n\n pip install -e .[test]\n py.test\n\nUnicode version upgrade\n-----------------------\n\nThe library will issue a new release for each new unicode version.\n\nThe steps necessary for this:\n\n1. Verify that there has been no material changes to the rulesets in Unicode\n `Annex #29 `_ (see modifications).\n2. Download the `data files `_ from unicode into the unicode-data folder.\n For the given version, some are in `ucd` and some are in `ucd/auxiliary`.\n3. Run `make process-data-files` to parse those files (will update the\n `grapheme_break_property.json` file).\n4. Update the unicode version in the documentation and in the source code.\n5. Bump the version.\n\n\n",
"description_content_type": "",
"docs_url": null,
"download_url": "",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/alvinlindstam/grapheme",
"keywords": "",
"license": "MIT",
"maintainer": "",
"maintainer_email": "",
"name": "grapheme",
"package_url": "https://pypi.org/project/grapheme/",
"platform": "",
"project_url": "https://pypi.org/project/grapheme/",
"project_urls": {
"Homepage": "https://github.com/alvinlindstam/grapheme"
},
"release_url": "https://pypi.org/project/grapheme/0.5.0/",
"requires_dist": [
"pytest ; extra == 'test'",
"sphinx ; extra == 'test'",
"sphinx-autobuild ; extra == 'test'",
"wheel ; extra == 'test'"
],
"requires_python": "",
"summary": "Unicode grapheme helpers",
"version": "0.5.0"
},
"last_serial": 5080739,
"releases": {
"0.1.0.dev0": [
{
"comment_text": "",
"digests": {
"md5": "e61fb0da959155d1cd12e29c46a07192",
"sha256": "fe0fd0e0b74f816dd7381e14549ca3e50726b0023c859c08a0ca5579a30aa8f8"
},
"downloads": -1,
"filename": "grapheme-0.1.0.dev0.tar.gz",
"has_sig": false,
"md5_digest": "e61fb0da959155d1cd12e29c46a07192",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 12530,
"upload_time": "2017-07-25T21:13:22",
"url": "https://files.pythonhosted.org/packages/55/ad/0cc0b4f80a8d67f0e6877a937d9e082e54fb086359bbf9bc734bf2eb050e/grapheme-0.1.0.dev0.tar.gz"
}
],
"0.2.0": [
{
"comment_text": "",
"digests": {
"md5": "7893a91bdb89a452a57914d7af63a62c",
"sha256": "c5090bbe29c9efa35c4fbe5c2988d4a398a31252a1c73c14d3aa56592c187737"
},
"downloads": -1,
"filename": "grapheme-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "7893a91bdb89a452a57914d7af63a62c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 12883,
"upload_time": "2017-07-25T23:58:40",
"url": "https://files.pythonhosted.org/packages/bf/95/808d966db2c2fad1bf01cb8c559160a60ec5b9243312650c23e5c8587a8b/grapheme-0.2.0.tar.gz"
}
],
"0.2.1": [
{
"comment_text": "",
"digests": {
"md5": "71f83a61e749499b7bd52e72bfbfb11e",
"sha256": "523ff346c06be3b7f089ed5d48e964a6eabeaa218ae821d0ae1eb2eecd5d9a4e"
},
"downloads": -1,
"filename": "grapheme-0.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "71f83a61e749499b7bd52e72bfbfb11e",
"packagetype": "bdist_wheel",
"python_version": "3.5",
"requires_python": null,
"size": 16952,
"upload_time": "2017-08-07T07:36:40",
"url": "https://files.pythonhosted.org/packages/c4/8c/6fbb385d2a4da1c0c130cd910a5b10be9f3d5c3ef21bef2e2e3e35e0d5a1/grapheme-0.2.1-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "58bfa07a0e819995e26764b2a994899a",
"sha256": "a3de9b3ad931fcb9b0e0242d85016b087186bb0227f451df92f22955bbc11573"
},
"downloads": -1,
"filename": "grapheme-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "58bfa07a0e819995e26764b2a994899a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14498,
"upload_time": "2017-07-31T20:36:28",
"url": "https://files.pythonhosted.org/packages/4d/b5/2acc3cef834c7d0ae3e884935c63e8fe49727cd75f3f50d747afae1da65d/grapheme-0.2.1.tar.gz"
}
],
"0.3.0": [
{
"comment_text": "",
"digests": {
"md5": "915f2979e02beb9c8b936fe7985b00f2",
"sha256": "938acbb7d7a17a4c658c69c2d39673a8663bc7028a99a1b7cc724c808eb2f343"
},
"downloads": -1,
"filename": "grapheme-0.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "915f2979e02beb9c8b936fe7985b00f2",
"packagetype": "bdist_wheel",
"python_version": "3.5",
"requires_python": null,
"size": 18217,
"upload_time": "2017-08-12T11:47:37",
"url": "https://files.pythonhosted.org/packages/d1/09/35eb029458c91e19a5eaf63b687045da7818f2872ed7f31071391870ed33/grapheme-0.3.0-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "b1c547030648e17b5d50a760419949f5",
"sha256": "c0d9df7a0f370e280449706833bde48983f03ae6c806c0f5e00669fd4f81c04f"
},
"downloads": -1,
"filename": "grapheme-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "b1c547030648e17b5d50a760419949f5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 15756,
"upload_time": "2017-08-12T11:47:33",
"url": "https://files.pythonhosted.org/packages/02/0d/6bc8173709256e2f4483cda76215271086c7eb50794d6e51dd8e7e2fc740/grapheme-0.3.0.tar.gz"
}
],
"0.4.0": [
{
"comment_text": "",
"digests": {
"md5": "5a0e4cf91b8c5996b6f2fd46477840b1",
"sha256": "b534ac5470cdb1ecf174a461098ce6748267c6b9a5a8e91926dfd9e951020624"
},
"downloads": -1,
"filename": "grapheme-0.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5a0e4cf91b8c5996b6f2fd46477840b1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 16950,
"upload_time": "2018-06-10T20:44:12",
"url": "https://files.pythonhosted.org/packages/10/91/2e66bc5ad3bf1f085ce56e6ca3aa9212bc100c927cab866b3b3488f862a0/grapheme-0.4.0-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "8161399468c6f838e0d1b5ee8ef8be87",
"sha256": "5b35b8def5357555d9248875c3f747241b4353f13bb11445afb390dc9054664d"
},
"downloads": -1,
"filename": "grapheme-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "8161399468c6f838e0d1b5ee8ef8be87",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 18217,
"upload_time": "2018-06-10T20:44:14",
"url": "https://files.pythonhosted.org/packages/82/8b/09907171882e35f0bb2ac270fe2d59635a1c088c084d00b694bf5ca8c189/grapheme-0.4.0.tar.gz"
}
],
"0.5.0": [
{
"comment_text": "",
"digests": {
"md5": "f6c02ad8757eb17b6ca4a0a8c8aaab8d",
"sha256": "08d158551a72e71f1d0fb0652e685096296ea3dafc918a1f36dadd8beb9e7a79"
},
"downloads": -1,
"filename": "grapheme-0.5.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f6c02ad8757eb17b6ca4a0a8c8aaab8d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 17523,
"upload_time": "2019-04-02T20:36:34",
"url": "https://files.pythonhosted.org/packages/57/0f/b04815f6921ab44cc09091fe5ab259c10d1ba1fc3a9f95315ad476a4ffe9/grapheme-0.5.0-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "fa4bfa55293ea3ba5c711c9b595cd0b3",
"sha256": "16d6668dc3785bdfe70f40a53d27e5919e272c6c6cdfd477d14d4e3184b58a4c"
},
"downloads": -1,
"filename": "grapheme-0.5.0.tar.gz",
"has_sig": false,
"md5_digest": "fa4bfa55293ea3ba5c711c9b595cd0b3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 19024,
"upload_time": "2019-04-02T20:36:35",
"url": "https://files.pythonhosted.org/packages/c0/47/48d3a6fba0c0b38872fce06967f3bbbc56a67edae7c2a76a887750016c04/grapheme-0.5.0.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "f6c02ad8757eb17b6ca4a0a8c8aaab8d",
"sha256": "08d158551a72e71f1d0fb0652e685096296ea3dafc918a1f36dadd8beb9e7a79"
},
"downloads": -1,
"filename": "grapheme-0.5.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f6c02ad8757eb17b6ca4a0a8c8aaab8d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 17523,
"upload_time": "2019-04-02T20:36:34",
"url": "https://files.pythonhosted.org/packages/57/0f/b04815f6921ab44cc09091fe5ab259c10d1ba1fc3a9f95315ad476a4ffe9/grapheme-0.5.0-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "fa4bfa55293ea3ba5c711c9b595cd0b3",
"sha256": "16d6668dc3785bdfe70f40a53d27e5919e272c6c6cdfd477d14d4e3184b58a4c"
},
"downloads": -1,
"filename": "grapheme-0.5.0.tar.gz",
"has_sig": false,
"md5_digest": "fa4bfa55293ea3ba5c711c9b595cd0b3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 19024,
"upload_time": "2019-04-02T20:36:35",
"url": "https://files.pythonhosted.org/packages/c0/47/48d3a6fba0c0b38872fce06967f3bbbc56a67edae7c2a76a887750016c04/grapheme-0.5.0.tar.gz"
}
]
}