Metadata-Version: 2.4
Name: lexeme-type
Version: 1.1.0
Summary: This provides a no-dependency type for string manipulation of similar words (eg. Car, car, Cars, cars)
Author: Gwyn Uttmark
Author-email: biosafetylevel5@gmail.com
Requires-Python: >=3.11
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Provides-Extra: doc
Provides-Extra: lint
Provides-Extra: test
Requires-Dist: doc8 ; extra == "doc" or extra == "lint"
Requires-Dist: mypy ; extra == "lint"
Requires-Dist: myst-parser ; extra == "doc"
Requires-Dist: pinkrst ; extra == "doc" or extra == "lint"
Requires-Dist: prettier ; extra == "lint"
Requires-Dist: pydantic ; extra == "test"
Requires-Dist: pytest ; extra == "test"
Requires-Dist: pytest-cov ; extra == "test"
Requires-Dist: pytest-xdist ; extra == "test"
Requires-Dist: ruff ; extra == "lint"
Requires-Dist: sphinx ; extra == "doc"
Requires-Dist: sphinx-argparse ; extra == "doc"
Requires-Dist: sphinx-autodoc-typehints ; extra == "doc"
Requires-Dist: sphinx-copybutton ; extra == "doc"
Requires-Dist: sphinx-rtd-theme ; extra == "doc"
Requires-Dist: sphinxcontrib-mermaid ; extra == "doc"
Project-URL: Documentation, https://biosafetylvl5.github.io/lexeme-type/
Project-URL: Homepage, https://github.com/biosafetylvl5/lexeme-type
Project-URL: Issues, https://github.com/biosafetylvl5/lexeme-type/issues
Project-URL: Repository, https://github.com/biosafetylvl5/lexeme-type
Description-Content-Type: text/markdown

# lexeme-type

![Tests](.github/badges/tests-badge.svg)
![Coverage](.github/badges/coverage-badge.svg)
![Mypy](.github/badges/mypy-badge.svg)
![Ruff](.github/badges/ruff-badge.svg)
![Install](.github/badges/install-badge.svg)
![CSpell](.github/badges/cspell-badge.svg)

![GitHub Release](https://img.shields.io/github/v/release/biosafetylvl5/lexeme-type)
![PyPI - Version](https://img.shields.io/pypi/v/lexeme-type)
![Pepy Total Downloads](https://img.shields.io/pepy/dt/lexeme-type?style=flat)
![PyPI - Downloads](https://img.shields.io/pypi/dm/lexeme-type)
[![GitHub stars](https://img.shields.io/github/stars/biosafetylvl5/lexeme-type.svg)](https://github.com/biosafetylvl5/lexeme-type/stargazers)

# 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

```pycon
>>> 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
```

