Pre-generated sets of Unicode code points
Project description
uniset
Pre-generated sets of Unicode code points
uniset
is a module containing frozenset
s of Unicode code points (characters).
API
Categories
The module includes a set for all Unicode categories and subcategories except the main category "C" (other) and its subcategories "Co" (private use) and "Cn" (not assigned).
Example:
import uniset
# The letter "A" is in category "L" (letters)
assert "A" in uniset.L
# The letter "A" is also in category "Lu" (uppercase letters)
assert "A" in uniset.Lu
Whitespace
uniset.WHITESPACE
contains all Unicode whitespace characters.
uniset.WHITESPACE
is a union of ASCII whitespace characters and the Unicode category "Zs".
import uniset
assert " " in uniset.WHITESPACE
Punctuation
uniset.PUNCTUATION
contains all Unicode punctuation letters.
uniset.PUNCTUATION
is a union of ASCII punctuation characters and the Unicode category "P".
import uniset
assert "." in uniset.PUNCTUATION
Alternatives
unicategories
also provides access to Unicode categories.
The implementation is based on "range groups" and iterators, and should be faster and more memory efficient than uniset
for inclusion checks.
If you need the frozenset
API (unions, intersections, etc.), or the sets beyond Unicode categories (whitespace, punctuation), use uniset
.
Otherwise unicategories
is the better option.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file uniset-0.1.0.tar.gz
.
File metadata
- Download URL: uniset-0.1.0.tar.gz
- Upload date:
- Size: 324.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.8.6 Linux/5.4.0-1032-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f352178efdd55061daadbaa0a9492162c0bb67cc31cee73ddb6623df9fe17926 |
|
MD5 | 3f9964d582cd63db12e71c83c2e88be5 |
|
BLAKE2b-256 | 3698eb04a7d9fca54f1bd426798a5f541a23ff9e2defd0e8f87dc1976260a83a |
File details
Details for the file uniset-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: uniset-0.1.0-py3-none-any.whl
- Upload date:
- Size: 316.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.8.6 Linux/5.4.0-1032-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa767bfe9f3ea94d0387586bdcb46d313e431ce0d97bb4b31222a663dc60e216 |
|
MD5 | 6da93c4346b67722039ee76928af21e1 |
|
BLAKE2b-256 | 281ce8792ec67f120a98cf73edfaffa4f849dc5ed45beea1db90126813c44d90 |