Skip to main content

Small utility helpers for working with text and tokens.

Project description

cs_lib

cs_lib is a compact Python package with dependency-free helpers for normalizing text, creating slugs, and splitting sequences into chunks.

Installation

pip install cs_lib

Usage

from cs_lib import chunked, normalize_whitespace, slugify

text = "  Fast   and\nclean   utilities  "
print(normalize_whitespace(text))
print(slugify("CS Lib: Ready to Ship"))
print(chunked([1, 2, 3, 4, 5], 2))

API

  • normalize_whitespace(value: str) -> str
  • slugify(value: str, separator: str = "-") -> str
  • chunked(values: Sequence[T], size: int) -> list[list[T]]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cs_library-0.2.0.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cs_library-0.2.0-py3-none-any.whl (2.4 kB view details)

Uploaded Python 3

File details

Details for the file cs_library-0.2.0.tar.gz.

File metadata

  • Download URL: cs_library-0.2.0.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for cs_library-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6dd168cd8522d5158dbba9f5f839c3ab3536a995ef382e30155fb6be3d8a7d1a
MD5 f1d915b6de905c079532fae5be752df8
BLAKE2b-256 8ce387c78bf8ea6af9e4f88fa7d9e3632cfc85fdb4c96cf716326bf6ba9d725a

See more details on using hashes here.

File details

Details for the file cs_library-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: cs_library-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 2.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for cs_library-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1ad59c161b7498385de76f0547d055f0fde54cee919ec7ac9e662c23d2f84163
MD5 e7b32ebff9e585090e06ff4f84d4497d
BLAKE2b-256 7da036b9d779f69f73b4d38344c58c5ffb0345a1a270516d047b26fa7ac7bc88

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page