pyheck

0.1.5 · maintenance · verified Thu Apr 16

pyheck is a Python library that provides efficient case conversion functionalities, acting as a thin wrapper around the high-performance Rust library `heck`. It supports various case conversions like snake_case, camelCase, kebab-case, and their uppercase variants. Intended to be unicode-aware, consistent, and fast, it claims 5-10x performance benefits over Python's `inflection` library for similar tasks. The current version is 0.1.5, released on February 18, 2022, indicating an infrequent release cadence since its initial development.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates importing individual case conversion functions and converting a single string, as well as using a `_many` function for a list of strings.

from pyheck import snake, upper_camel, kebab

text1 = "Hello world from pyheck"
text2 = "another string input"

# Convert to snake_case
snake_case_text = snake(text1)
print(f"Snake case: {snake_case_text}")

# Convert to UpperCamelCase
camel_case_text = upper_camel(text1)
print(f"Upper Camel case: {camel_case_text}")

# Convert a list of strings to kebab-case efficiently
texts_to_convert = [text1, text2]
kebab_case_list = kebab_many(texts_to_convert)
print(f"Kebab case list: {kebab_case_list}")

view raw JSON →