Skip to main content

esutils

Pure Python character utilities for ECMAScript language tools. Python 3.11+; no runtime dependencies or network calls. This remains a focused partial port of estools/esutils: the code module is provided; upstream ast and keyword APIs are not ported.

python -m pip install esutils

Upgrading from 1.x

Version 2.0 requires Python 3.11 or newer. Choose the unqualified identifier predicates for Unicode 17; the ES5/ES6 names retain explicit Unicode 9 policies. Predicates reject invalid integer scalars with False and reject non-integer inputs, including bool, with TypeError. fromCodePoint returns one Python scalar character and raises ValueError for invalid scalar integers. See the migration notes. The distribution and import name remain esutils; esutils.__version__ is the distribution version string.

Usage

from esutils import code
assert code.UNICODE_VERSION == "17.0.0"
assert code.isIdentifierStart(0x10400)
assert code.isIdentifierStart(0x1C90)
assert code.isIdentifierPart(0x200C)
assert not code.isIdentifierStart(0x200C)
assert not code.isIdentifierPart(0x1F600)
assert code.isWhiteSpace(0xFEFF)
assert not code.isWhiteSpace(0x180E)
API Policy
isIdentifierStart(cp) Unicode 17.0.0 ID_Start plus $ and _
isIdentifierPart(cp) Unicode 17.0.0 ID_Continue plus $, _, ZWNJ and ZWJ
isIdentifierStartES6(cp), isIdentifierPartES6(cp) Legacy Unicode 9.0.0 ID properties; astral scalar behavior repaired
isIdentifierStartES5(cp), isIdentifierPartES5(cp) Legacy Unicode 9.0.0 BMP ES5 categories and ECMAScript additions
isDecimalDigit(cp), isHexDigit(cp), isOctalDigit(cp) ASCII numeric-literal digits
isWhiteSpace(cp) ECMAScript whitespace; excludes line terminators and U+180E
isLineTerminator(cp) LF, CR, U+2028 and U+2029
fromCodePoint(cp) One Python scalar character; invalid scalars raise ValueError

Inputs are integer Unicode scalar code points, such as ord(character). Predicates return False for negative integers, values above U+10FFFF and surrogates. Non-integers (including bool) raise TypeError consistently. fromCodePoint returns one Python character for astral inputs; it is not a JavaScript UTF-16 surrogate-pair helper.

The modern policy is explicit, reproducible Unicode 17 acceptance for the ECMAScript 2026 toolchain. ES5/ES6 names preserve the previous package's Unicode 9 policy. Edition names do not imply that a particular Unicode version is required by every implementation of that edition. Character classification does not validate full identifier names, escapes, reserved words or contextual keywords. Python's str.isidentifier() and isspace() use different rules and are not used.

Generated scalar intervals use binary search with an ASCII fast path. Checked-in source files, exact SHA-256 checksums and the offline generator are documented in data provenance. Results are independent of the Python interpreter's Unicode database. Unicode updates require deliberate releases.

See contributor instructions, migration notes and CI results. Maintainers can follow the release instructions.

Performance measurements document the public validation cost and the private ord paths used by the coordinated toolchain. Public API validation and Unicode policies remain unchanged.

Metadata

Release files for esutils 2.0.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 esutils 2.0.0
File Size Uploaded
esutils-2.0.0.tar.gz 661.6 kB Details

Built distribution (wheel)

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

Total release size: 679.5 kB

Release files / esutils-2.0.0.tar.gz

Download URL esutils-2.0.0.tar.gz
Size 661.6 kB
Tags Source
SHA-256 checksum
How to use checksums
798f513192c6dc96dde917d1d056abf1c17231c186666d6081498ded97362a5e
BLAKE2b-256 checksum
How to use checksums
1348bdd4d9da59f280a4d8d264bf06d163a62efa7c36145b8e5e82cfdca0ab51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / esutils-2.0.0-py3-none-any.whl

Download URL esutils-2.0.0-py3-none-any.whl
Size 17.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
60c1bc13ebed6cffb9a46ad9e5935976acb4ed8e031498373e1c8f2a48bcb89e
BLAKE2b-256 checksum
How to use checksums
75a859c61ac0a90d3f82066141c053920327ca89451e67840efa2ac179f9d0d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.0.1

1 release file

1.0.0

1 release file

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