TextUtils
TextUtils is a simple Python library that provides useful text manipulation functions.
Features
- Word count: Count the number of words in a text.
- Character count: Count the number of characters in a text.
- Reverse text: Reverse the characters in a string.
- Capitalize words: Capitalize the first letter of each word.
- Truncate text: Shorten text to a maximum length, including a configurable suffix.
Project structure
textutils/
├── textutils/
│ ├── __init__.py
│ ├── transform.py
│ ├── casing/
│ │ ├── __init__.py
│ │ └── _capitalize.py
│ └── truncation/
│ ├── __init__.py
│ └── _truncate.py
├── tests/
│ ├── test_casing.py
│ ├── test_transform.py
│ └── test_truncate.py
├── .gitignore
├── CHANGELOG.md
├── LICENSE
├── pyproject.toml
└── README.md
Installation
Clone the repository:
git clone https://github.com/hytlot/textutils.git
cd textutils
Install the project in editable mode:
python -m pip install -e .
Usage
from textutils.transform import word_count, character_count, reverse
from textutils.casing import capitalize_words
from textutils import truncate
text = "hello open source"
print(word_count(text)) # 3
print(character_count(text)) # 17
print(reverse(text)) # ecruos nepo olleh
print(capitalize_words(text)) # Hello Open Source
print(truncate("Hello World", 8)) # Hello...
Development
Install the project with its development tools:
python -m pip install -e ".[dev]"
Run the tests with coverage:
python -m pytest --cov --cov-report=term-missing
Check formatting and code quality:
python -m black --check .
python -m ruff check .
License
This project is distributed under the MIT License. See the LICENSE file for details.
Metadata
Release files for textutils-hytlot 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| textutils_hytlot-1.0.0.tar.gz | 5.3 kB | With provenance | Details for textutils_hytlot-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| textutils_hytlot-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for textutils_hytlot-1.0.0-py3-none-any.whl |
Total release size: 10.6 kB
Release files / textutils_hytlot-1.0.0.tar.gz
| Download URL | textutils_hytlot-1.0.0.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ef6b7944ceba59a1842e4a04ff2383d0ec9272ecf5a9d43b44c75a5f532b85f7
|
|
BLAKE2b-256 checksum How to use checksums |
289a234c31a46726da2822a82658df09db4f5195c209185d1cb3b7107184a728
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.
Transparency logRelease files / textutils_hytlot-1.0.0-py3-none-any.whl
| Download URL | textutils_hytlot-1.0.0-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e788c512aae203c21b8e0b1d5832ac85efc9bb757c5408f29389650befdbd15f
|
|
BLAKE2b-256 checksum How to use checksums |
a4c9126e42fd95eb84260192f76b5cadae585420105c420c150da24928505949
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.
Transparency logSecurity for textutils-hytlot 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for textutils_hytlot-1.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.