Skip to main content

Python library for text case conversions.

Project description

textcase logo

textcase

Python library for text case conversions.

Coveralls PyPI - Downloads PyPI - Version PyPI - Python Version

Documentation: https://zobweyt.github.io/textcase

PyPI: https://pypi.org/project/textcase

Features

  • Text case conversion: convert strings between various text cases (e.g., snake_case, kebab-case, camelCase, etc.).
  • Extensible: extend the library with custom word boundaries and cases.
  • Accurate: handles any word boundaries in strings including acronyms (as in "HTTPRequest").
  • Non-ASCII Support: handles non-ASCII characters seamlessly (no inferences on the input language itself is made).
  • Tiny, Performant & Zero Dependencies: a regex-free, efficient library that stays lightweight with no external dependencies.
  • 100% test coverage: every line of code is rigorously tested for reliability.
  • 100% type annotated codebase: full type annotations for best developer experience.

Installation

Create and activate a virtual environment and then install textcase:

pip install textcase

Usage

Convert a string to a text case:

import textcase

textcase.snake("Hello, world!")  # hello_world
textcase.constant("Hello, world!")  # HELLO_WORLD
textcase.kebab("Hello, world!")  # hello-world
textcase.middot("Hello, world!")  # hello·world
textcase.camel("Hello, world!")  # helloWorld
textcase.pascal("Hello, world!")  # HelloWorld
textcase.lower("Hello, world!")  # hello world
textcase.upper("Hello, world!")  # HELLO WORLD
textcase.title("Hello, world!")  # Hello World
textcase.sentence("Hello, world!")  # Hello world

See documentation for more usage examples.

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

textcase-0.4.4.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

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

textcase-0.4.4-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file textcase-0.4.4.tar.gz.

File metadata

  • Download URL: textcase-0.4.4.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for textcase-0.4.4.tar.gz
Algorithm Hash digest
SHA256 4af6f5e029f7c5a1d48bc49e3758351e15ff28e8f09c929ffb704f71b894ecab
MD5 0cad498e8293232869f809806ad7f2c2
BLAKE2b-256 1ffa61085c42bb62c83565453fb8b1aee823576aade439ba24faa83975519ee9

See more details on using hashes here.

Provenance

The following attestation bundles were made for textcase-0.4.4.tar.gz:

Publisher: publish.yaml on zobweyt/textcase

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file textcase-0.4.4-py3-none-any.whl.

File metadata

  • Download URL: textcase-0.4.4-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for textcase-0.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a9fad2e148bba3fb9dc40cdbb97ea948e8d548b5d486c9405faba5bc92fdce22
MD5 b99c9b3b81d759999ed85d02766b1a59
BLAKE2b-256 5a21896ad43ee6a42a5e18fdf5b2761eb5a74d4e5554f74a33fda01e14301482

See more details on using hashes here.

Provenance

The following attestation bundles were made for textcase-0.4.4-py3-none-any.whl:

Publisher: publish.yaml on zobweyt/textcase

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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