contractions
Fixes contractions such as `you're` to you `are`
What it is and what it does
Contractions is a text preprocessing library that converts English contractions and informal speech patterns into their expanded forms. It handles common cases like "you're" → "you are" and "gotta" → "got to", and resolves ambiguous cases by choosing the most common interpretation (e.g., "he's" becomes "he is" rather than "he has"). The package includes a slang mode (enabled by default) that expands informal patterns like "ima" and "yall", and allows users to register custom expansion rules.
The library depends on textsearch for pattern matching and is distributed as a pure Python wheel with low installation friction. It targets NLP preprocessing workflows where normalized text is needed for downstream analysis or model training. The package is no longer actively maintained, with the last release on 2022-11-15.
Use it for:
- Normalize user-generated text before feeding it to NLP models or text classifiers
- Preprocess social media or chat data where contractions and slang are common
- Expand contractions in customer service transcripts for consistent text analysis
- Prepare training data for language models by standardizing contraction forms
- Add domain-specific contraction rules for specialized text processing pipelines
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Expands English contractions and slang into their full forms (e.g., "you're" → "you are", "ima" → "I am going to"), with support for custom additions.
Yes, if you need lightweight contraction expansion and can accept an abandoned package. The library is simple, has no known vulnerabilities, and low install friction. However, verify that textsearch remains compatible with your Python version, and consider whether the lack of maintenance poses a risk for your use case—bug fixes or Python version updates will not be forthcoming.
Install
contractions on PyPI
pip
pip install contractionsuv
uv add contractionspoetry
poetry add contractionsInstalling contractions
Before you install
Low friction: pure Python wheel with a single runtime dependency. However, the package is abandoned—last commit was 2022-11-15. The description notes versions >0.0.18 are 50x faster, suggesting older releases had performance issues; verify you have a recent enough version.
License in practice
MIT license is permissive and imposes no restrictions on use, modification, or distribution in your own projects.
Quickstart
pip install contractions
import contractions
result = contractions.fix("you're happy now")
print(result) # "you are happy now"
Verify before relying
- Whether the runtime dependency textsearch is actively maintained and compatible with current Python versions
- Whether the 50x performance improvement claim in the description applies to version 0.1.73 specifically
- Python version compatibility given the package targets Python 2.7 and 3.4-3.6 but has not been updated since 2022-11-15
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — textsearch |
| Maintenance | abandoned — 1,368 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 588,160/month — #5,869 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: contractions-0.1.73-py2.py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
textsearchFind and replace multiple strings in text with…
permissive · top 15,000 on PyPI
opt-einsumOptimizes the contraction order of einsum…
permissive · top 1,000 on PyPI
parameter-expansion-patchedExpands POSIX and Bash shell parameter syntax…
permissive · top 15,000 on PyPI
braceexpandExpands bash-style brace patterns into…
permissive · top 5,000 on PyPI
num2wordsConverts numbers to their word representations…
copyleft · top 5,000 on PyPI
expandvarsExpands Unix-style variable references in…
permissive · top 5,000 on PyPI
pyucaImplements the Unicode Collation Algorithm to…
permissive · top 15,000 on PyPI
bracexBracex expands Bash-style brace patterns into…
permissive · top 1,000 on PyPI
matchMaps tokenized words and phrases back to their…
permissive · top 5,000 on PyPI
wetextNormalizes and denormalizes text in Chinese,…
permissive · top 15,000 on PyPI