{ "info": { "author": "Adam Janin", "author_email": "pypi@janin.org", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3" ], "description": "# uni2ascii\n\nConvert unicode to closest ASCII equivalent.\n\nThere are many unicode glyphs whose appearance is very similar to ASCII characters. This script converts these codepoints to their ASCII equivalent. For example, the string `\u0456 l\u043e\u0475\u0435 \u00fc\u0144\u0456\u0441\u03bfd\u0435` contains only 2 ASCII characters, despite the fact that all but `\u00fc\u0144` look fine at first glance. To convert to ASCII:\n\n > echo \u0456 l\u043e\u0475\u0435 \u00fc\u0144\u0456\u0441\u03bfd\u0435 | uni2ascii\n i love unicode\n\nThe default action is to leave untouched any non-ascii that `uni2ascii.py` doesn't know about. This can be overridden with command line arguments. Call `uni2ascii -h` for help.\n\nYou can also call from python:\n\n from uni2ascii import uni2ascii\n ascii_string = uni2ascii('\u0456 l\u043e\u0475\u0435 \u00fc\u0144\u0456\u0441\u03bfd\u0435')\n\nIt's quite easy to add new transliterations. See the function `get_translits` in `__init__.py`. Feel free to contact me or do a pull request if you find useful ones that aren't there.\n\n## Notes\n\n`uni2ascii` was written to handle particular data we had on hand. There are plenty of missing transliterations. I'm happy to add new ones!\n\nInput encoding must be utf-8.\n\nFeel free to modify - it's not likely it'll work exactly correctly for you out of the box.\n\nThe code should work in python2 or python3.\n\nThis was not designed to thwart homograph attacks, but rather to help with text normalization of English, where unicode sometimes sneaks in.\n\n## Install\n\n pip install uni2ascii\n\n## Alternatives\n\n### The Python module `unidecode`\n\nVery similar in spirit, but doesn't handle punctuation and makes some choices I disagree with.\n\n### iconv\n\nIf you call `iconv -t //TRANSLIT`, it'll do some of what `uni2ascii` does, but a bunch of stuff is missing that is important to our application.\n\n### Image processing approaches\n\nThere have been a few projects that actually look at the generated pixels to determine if two glyphs are too similar. I love the idea, but wanted more fine grain control.\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/ajanin/uni2ascii", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "uni2ascii-janin", "package_url": "https://pypi.org/project/uni2ascii-janin/", "platform": "", "project_url": "https://pypi.org/project/uni2ascii-janin/", "project_urls": { "Homepage": "https://github.com/ajanin/uni2ascii" }, "release_url": "https://pypi.org/project/uni2ascii-janin/1.0.1/", "requires_dist": null, "requires_python": "", "summary": "Convert unicode characters that resemble ASCII to their equivalent.", "version": "1.0.1" }, "last_serial": 4856748, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "0d80dd0f1a41bc875fae13d1988c2439", "sha256": "916ad516616af1b25292175862dc13bbb56cd2c3e4127c643c3e515883a5a715" }, "downloads": -1, "filename": "uni2ascii_janin-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "0d80dd0f1a41bc875fae13d1988c2439", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6545, "upload_time": "2019-02-16T00:14:47", "url": "https://files.pythonhosted.org/packages/e2/ad/435de3d59823583e57f167ee5f1d42aa494261a178585b0b457a34c7b67d/uni2ascii_janin-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a22858b9b91ca157e22808639db9a582", "sha256": "fd67848e2211489b2475ec9ffa80e6926106e083f022a6f2464990397995996f" }, "downloads": -1, "filename": "uni2ascii-janin-1.0.0.tar.gz", "has_sig": false, "md5_digest": "a22858b9b91ca157e22808639db9a582", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4858, "upload_time": "2019-02-16T00:14:49", "url": "https://files.pythonhosted.org/packages/b7/47/3f31e2ecc3055897c84cfae9c84002f65ec64f156e6a84fd86fe818365d9/uni2ascii-janin-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "5a5c5c5c5e607f7c8f0bb33d2d6ea01f", "sha256": "17a542e9391d65fc0d2d64d12073a996447a36eb89965e6e9fb980a435eae06c" }, "downloads": -1, "filename": "uni2ascii_janin-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "5a5c5c5c5e607f7c8f0bb33d2d6ea01f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6542, "upload_time": "2019-02-23T00:37:26", "url": "https://files.pythonhosted.org/packages/b8/db/e0e37d87ca92787997867ad3caaf914530212087ff69f6f0141a44a324de/uni2ascii_janin-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1ad35c372ec34d2f6099ce1dd2fd9f16", "sha256": "685002fee0e6e8c0a1615e58f4400ca69896b05cdd488a1c8e73b1003dc7b362" }, "downloads": -1, "filename": "uni2ascii-janin-1.0.1.tar.gz", "has_sig": false, "md5_digest": "1ad35c372ec34d2f6099ce1dd2fd9f16", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4859, "upload_time": "2019-02-23T00:37:27", "url": "https://files.pythonhosted.org/packages/04/b7/0abd36fbd9a2fadac5f314291820de4eb90aa90aa7ff11d94e22d3748dc1/uni2ascii-janin-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5a5c5c5c5e607f7c8f0bb33d2d6ea01f", "sha256": "17a542e9391d65fc0d2d64d12073a996447a36eb89965e6e9fb980a435eae06c" }, "downloads": -1, "filename": "uni2ascii_janin-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "5a5c5c5c5e607f7c8f0bb33d2d6ea01f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6542, "upload_time": "2019-02-23T00:37:26", "url": "https://files.pythonhosted.org/packages/b8/db/e0e37d87ca92787997867ad3caaf914530212087ff69f6f0141a44a324de/uni2ascii_janin-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1ad35c372ec34d2f6099ce1dd2fd9f16", "sha256": "685002fee0e6e8c0a1615e58f4400ca69896b05cdd488a1c8e73b1003dc7b362" }, "downloads": -1, "filename": "uni2ascii-janin-1.0.1.tar.gz", "has_sig": false, "md5_digest": "1ad35c372ec34d2f6099ce1dd2fd9f16", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4859, "upload_time": "2019-02-23T00:37:27", "url": "https://files.pythonhosted.org/packages/04/b7/0abd36fbd9a2fadac5f314291820de4eb90aa90aa7ff11d94e22d3748dc1/uni2ascii-janin-1.0.1.tar.gz" } ] }