Thank you for considering a contribution! This guide covers the process.
# Clone the repository
git clone https://github.com/ksanyok/TextHumanize.git
cd TextHumanize
# Create a virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install in editable mode with dev dependencies
pip install -e ".[dev]"# Full test suite
pytest tests/ -q
# Single file
pytest tests/test_core.py -q
# With coverage
pytest tests/ --cov=texthumanize --cov-report=term-missingWe use ruff for linting and formatting:
ruff check texthumanize/ tests/
ruff format --check texthumanize/ tests/mypy texthumanize/ --ignore-missing-importstexthumanize/ # Main package
├── __init__.py # Public API (PEP 562 lazy loading)
├── core.py # humanize(), detect_ai(), and other top-level functions
├── pipeline.py # 20-stage processing pipeline
├── exceptions.py # Exception hierarchy
├── lang/ # Language-specific dictionaries (RU, EN, DE, FR, ES, …)
├── detectors.py # AI detection heuristics
└── ... # 60+ specialized modules
tests/ # pytest test suite (1700+ tests)
php/ # PHP port
examples/ # Usage examples
docs/ # Documentation (if present)
- Create a branch from
main. - Write tests for any new functionality.
- Run the full test suite before submitting.
- Keep PRs focused — one feature or fix per PR.
- Update CHANGELOG.md if your change is user-facing.
- Follow existing code style — English docstrings, type hints for public APIs.
- Create
texthumanize/lang/<code>.pywith synonyms, collocations, and fillers. - Register the language in
texthumanize/lang/__init__.py. - Add tests in
tests/test_multilang.py.
Open an issue with:
- Python version
texthumanizeversion (python -c "import texthumanize; print(texthumanize.__version__)")- Minimal reproducible example
- Expected vs actual behavior
Be respectful and constructive. We follow the Contributor Covenant.
By contributing, you agree that your contributions will be licensed under the same license as the project.