Metadata-Version: 2.4
Name: textutils-hs
Version: 0.1.0
Summary: Small, dependency-free helpers for common text tasks.
Author: Hamza Fikri
License-Expression: MIT
Project-URL: Homepage, https://github.com/hamzasinko/textutils
Project-URL: Repository, https://github.com/hamzasinko/textutils
Project-URL: Issues, https://github.com/hamzasinko/textutils/issues
Project-URL: Changelog, https://github.com/hamzasinko/textutils/blob/main/CHANGELOG.md
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Text Processing
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-cov>=5.0; extra == "dev"
Requires-Dist: black>=24.0; extra == "dev"
Requires-Dist: ruff>=0.5; extra == "dev"
Requires-Dist: pre-commit>=3.7; extra == "dev"
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: twine>=5.0; extra == "dev"
Dynamic: license-file

# textutils

Small, dependency-free Python helpers for common text tasks: counting words,
counting characters, reversing a string, and capitalizing each word. Every
function has type hints, a full docstring, and tests.

## Features

- `word_count(text)` — number of words in a string.
- `character_count(text)` — number of characters in a string.
- `reverse(text)` — the string reversed.
- `capitalize_words(text)` — first letter of each word capitalized.
- `slugify(text)` — a URL-friendly slug (lowercase, hyphen-separated).

Edge cases are handled: empty strings return empty results, and non-string
input raises `TypeError`.

## Installation

Requires Python 3.9 or newer. No third-party runtime dependencies.

Clone and install in editable mode with the development tools:

```bash
git clone https://github.com/hamzasinko/textutils.git
cd textutils
python -m pip install -e ".[dev]"
```

Run the tests:

```bash
python -m pytest
```

## Usage

```python
from textutils import word_count, character_count, reverse, capitalize_words, slugify

word_count("hello world") # 2
character_count("hello")          # 5
reverse("stressed")              # "desserts"
capitalize_words("hello world")   # "Hello World"
slugify("Hello, World!")          # "hello-world"
```

## Contributing

Contributions are welcome.

1. Fork the repository on GitHub.
2. Create a branch: `git checkout -b feature/my-change`.
3. Make your change, keeping commits small and focused.
4. Run the tests: `python -m pytest`.
5. Push your branch and open a pull request.

## License

Released under the MIT License. See [LICENSE](LICENSE) for details.
