Skip to main content

lexeme-type

Tests Coverage Mypy Ruff Install CSpell

GitHub Release PyPI - Version Pepy Total Downloads PyPI - Downloads GitHub stars

Lexeme type

Lightweight no-dependency helper for treating singular and plural spellings as equivalent.

A drop-in str subclass that normalizes English nouns so that their singular and plural forms compare as equal, hash to the same key, and work inside Pydantic v2 models. Ignores capitalization.

Examples

>>> from lexeme_type.lexeme import Lexeme
>>> Lexeme("reader") == "readers" == Lexeme("readers")
True
>>> {Lexeme("analyses"): 1} == {"analysis": 1}
True

>>> from pydantic import BaseModel
>>> class _Plugin(BaseModel):
...     kind: Lexeme
...     interface: Lexeme
...
>>> model = _Plugin(kind="reader", interface="readers")
>>> model.kind == model.interface == "reader"
True

Release files for lexeme-type 1.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 lexeme-type 1.1.0
File Size Uploaded
lexeme_type-1.1.0.tar.gz 6.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lexeme-type 1.1.0
File Interpreter ABI Platform
lexeme_type-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.2 kB

Release files / lexeme_type-1.1.0.tar.gz

Download URL lexeme_type-1.1.0.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2a68f937469f00f0772c2cc17c30b522ae6b0a98c0a85b6ef22cdde80b6171b4
BLAKE2b-256 checksum
How to use checksums
0ae9ed73d3ef71d29659131c40a0d39f11a679fdc2e052a9452c25d0794ba84d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / lexeme_type-1.1.0-py3-none-any.whl

Download URL lexeme_type-1.1.0-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a6180105c5d8ef38e3cbeb4fcf15981fbf60cf7bbe17b54133d7390cd05a9638
BLAKE2b-256 checksum
How to use checksums
8b7c19e4c51c9635514de1b174e55670ca2ff0b29a9eeda78f003b360bf67a00
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

1.1.0 This release

2 release files

1.0.0

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