Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pxeger/uniprop
Fork of MRAB's uniprop with a fixed build process
https://github.com/pxeger/uniprop
python regex ucd unicode
Last synced: 18 days ago
JSON representation
Fork of MRAB's uniprop with a fixed build process
- Host: GitHub
- URL: https://github.com/pxeger/uniprop
- Owner: pxeger
- License: apache-2.0
- Created: 2021-11-07T20:35:36.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2021-11-08T18:51:40.000Z (about 3 years ago)
- Last Synced: 2024-10-12T09:30:10.386Z (about 1 month ago)
- Topics: python, regex, ucd, unicode
- Language: C
- Homepage: https://github.com/pxeger/uniprop/wiki
- Size: 227 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
Summary
-------This module reports the Unicode properties of codepoints, beyond what Python's ``unicodedata`` module provides.
Unicode
-------This module supports Unicode 14.0.0.
Examples
--------.. sourcecode:: python
>>> import uniprop
>>> uniprop.script('A')
'Latin'
>>> uniprop.script('\N{GREEK SMALL LETTER ALPHA}')
'Greek'
>>> uniprop.block('A')
'Basic_Latin'
>>> uniprop.block('\N{GREEK SMALL LETTER ALPHA}')
'Greek_And_Coptic'
>>> uniprop.numeric_value('\N{VULGAR FRACTION ONE THIRD}')
'1/3'
>>> uniprop.numeric_value('A')
'NaN'
>>> uniprop.numeric_type('\N{VULGAR FRACTION ONE THIRD}')
'Numeric'
>>> uniprop.numeric_type('A')
'None'Please note that all of the results are strings. This differs from the ``unicodedata`` module where ``numeric_value`` returns a float.