inflect
English language inflection library for Python — generates grammatically correct plurals, singulars, ordinals, and indefinite articles. inflect features: plural(word) for noun pluralization, plural_verb() for verb pluralization, singular_noun() for singularization, an() for 'a'/'an' article selection, ordinal() for '1st'/'2nd'/'3rd', number_to_words() for '42' → 'forty-two', join() for comma-separated lists with 'and', inflect_mode() for word-by-word or sentence-level, classical() for classical plurals, num() for numeric context, and compare()/compare_verbs() for form comparison.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
Pure English text inflection library with no network calls. No security concerns. Text transformation is safe for any string input.
⚡ Reliability
Best When
Generating grammatically correct English text in agent CLI output, notifications, and reports — inflect handles the complex rules of English pluralization, ordinals, and articles that are easy to get wrong.
Avoid When
Non-English languages, morphological parsing, or professional publication (verify edge cases manually).
Use Cases
- • Agent natural language output — import inflect; p = inflect.engine(); count = 3; print(f'Found {count} {p.plural("error", count)}') — 'Found 3 errors'; count = 1: 'Found 1 error' — context-aware plural; agent CLI messages use grammatically correct plurals based on count; p.plural(word, count) handles both singular and plural
- • Agent article selection — p = inflect.engine(); for item in items: desc = f'{p.an(item.type)} {item.type}' — 'a user', 'an agent', 'a HTTP request'; agent descriptive output uses correct 'a'/'an'; inflect handles edge cases: 'an hour', 'a unicorn' (phonetic, not spelling)
- • Agent ordinal formatting — p = inflect.engine(); for i, result in enumerate(results, 1): print(f'{p.ordinal(i)} result: {result}') — '1st result', '2nd result', '3rd result'; agent numbered output with correct ordinals; p.number_to_words(42) → 'forty-two' for written-form numbers
- • Agent list formatting — p = inflect.engine(); items = ['apple', 'banana', 'cherry']; print(p.join(items)) — 'apple, banana, and cherry'; 2 items: 'apple and banana'; 1 item: 'apple' — Oxford comma join; agent notification messages list items grammatically
- • Agent noun normalization — p = inflect.engine(); if p.singular_noun(word): base = p.singular_noun(word); else: base = word — normalize plurals to singular; agent NLP pipeline normalizes 'users' → 'user'; singular_noun() returns singular form or False if already singular
Not For
- • Non-English languages — inflect is English-only; for multilingual pluralization use babel or language-specific libraries
- • Morphological analysis — inflect generates forms but doesn't parse morphology; for NLP use spacy or nltk
- • Names/proper nouns — inflect may incorrectly pluralize proper nouns; 'Jones' → 'Joneses' (questionable for all contexts)
Interface
Authentication
No auth — local text processing library.
Pricing
inflect is MIT licensed. Free for all use.
Agent Metadata
Known Gotchas
- ⚠ Reuse inflect.engine() instance — p = inflect.engine() has initialization overhead; agent code creating engine per request is wasteful; create once at module level: p = inflect.engine(); reuse across all calls; engine is stateless between calls
- ⚠ plural(word, count) handles both forms — p.plural('error', 1) → 'error'; p.plural('error', 3) → 'errors'; p.plural('error') always returns plural; agent code f'{count} {p.plural("item", count)}' is the correct pattern; passing count to plural gives the right form automatically
- ⚠ singular_noun() returns False for singulars — p.singular_noun('user') → False (already singular); p.singular_noun('users') → 'user'; agent code must check: base = p.singular_noun(word) or word; the 'or word' fallback handles already-singular inputs
- ⚠ an() uses phonetic rules not spelling — p.an('hour') → 'an hour' (phonetic 'h' is silent); p.an('unicorn') → 'a unicorn' (phonetic 'y' sound); p.an('HTTP') → 'an HTTP' (phonetic 'aitch'); agent code cannot use simple 'aeiou' check — use p.an() for correct English
- ⚠ classical() changes some plurals — p.classical().plural('formula') → 'formulae' (Latin); p.plural('formula') → 'formulas' (English); agent code targeting general audiences should not use classical mode; use classical() only for scientific/academic contexts expecting Latin forms
- ⚠ number_to_words() handles large numbers — p.number_to_words(1000000) → 'one million'; p.number_to_words(1234567) → 'one million, two hundred and thirty-four thousand, five hundred and sixty-seven'; agent formatted numbers in words for accessibility or formal output
Alternatives
Full Evaluation Report
Comprehensive deep-dive: security analysis, reliability audit, agent experience review, cost modeling, competitive positioning, and improvement roadmap for inflect.
AI-powered analysis · PDF + markdown · Delivered within 30 minutes
Package Brief
Quick verdict, integration guide, cost projections, gotchas with workarounds, and alternatives comparison.
Delivered within 10 minutes
Score Monitoring
Get alerted when this package's AF, security, or reliability scores change significantly. Stay ahead of regressions.
Continuous monitoring
Scores are editorial opinions as of 2026-03-06.