Skip to main content

Build Status codecov.io PyPI version

uniset

Pre-generated sets of Unicode code points

uniset is a module containing frozensets 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.

Metadata

Release files for uniset 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for uniset 0.1.0
File Size Uploaded
uniset-0.1.0.tar.gz 324.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for uniset 0.1.0
File Interpreter ABI Platform
uniset-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 640.5 kB

Release files / uniset-0.1.0.tar.gz

Download URL uniset-0.1.0.tar.gz
Size 324.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f352178efdd55061daadbaa0a9492162c0bb67cc31cee73ddb6623df9fe17926
BLAKE2b-256 checksum
How to use checksums
3698eb04a7d9fca54f1bd426798a5f541a23ff9e2defd0e8f87dc1976260a83a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.8.6 Linux/5.4.0-1032-azure

Release files / uniset-0.1.0-py3-none-any.whl

Download URL uniset-0.1.0-py3-none-any.whl
Size 316.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa767bfe9f3ea94d0387586bdcb46d313e431ce0d97bb4b31222a663dc60e216
BLAKE2b-256 checksum
How to use checksums
281ce8792ec67f120a98cf73edfaffa4f849dc5ed45beea1db90126813c44d90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.8.6 Linux/5.4.0-1032-azure

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page