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.5.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.5-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: textcase-0.4.5.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.5.tar.gz
Algorithm Hash digest
SHA256 97fd08754b7dba9bfa5daf4ace474645f6b66409fb00f483c5de729e730f8e52
MD5 7d7bda4d8c82c4ce7c2888d46b85fe39
BLAKE2b-256 c008991940591c7a8de25505a4e43642d1c2b54f43c3ed76f8c90f1df6ee9525

See more details on using hashes here.

Provenance

The following attestation bundles were made for textcase-0.4.5.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.5-py3-none-any.whl.

File metadata

  • Download URL: textcase-0.4.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 bd5d6aaf653b339e3ac60ad96cfc960a94219a97da464eddeed7084f41774937
MD5 90142e09d8da2793ff514e955e7ad6a7
BLAKE2b-256 5b486ea42c749608cfca883d5d8fae03edbcde636090d2bc751fd5da9157b451

See more details on using hashes here.

Provenance

The following attestation bundles were made for textcase-0.4.5-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