Registry / serialization / pyheck

pyheck

JSON →
library0.1.5pypypi✓ verified 87d ago

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.

pip install pyheck
INSTALL
IMPORT
SIG · PYHECK
P
pyheck
serializationpythonv0.1.5
Install
1.6s avg
Import
Disk
20MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 22.5MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 1.6s · import 0.000s · 22MB
20MB installed
● package 20MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

kebab
from pyheck import kebab
snake
from pyheck import snake
lower_camel
from pyheck import lower_camel
kebab_many
from pyheck import kebab_many
import pyheck.kebab_many
Functions are directly available from the top-level package, not submodules.

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}")
Debug
Known issues
gotchaWhen migrating from `inflection` or similar libraries, be aware that `pyheck`'s functions may not have a 1:1 overlap or identical behavior with other libraries. Always verify edge cases.
fix
Consult `pyheck`'s documentation for specific function behavior and test critical edge cases during migration.
affects: All
gotchaFor converting sequences of strings, prefer the `_many` counterparts (e.g., `snake_many`, `kebab_many`). These functions leverage Rust's parallel features for significantly higher performance on lists.
fix
Use `from pyheck import function_many` and pass a list of strings for bulk conversions to maximize performance.
affects: All
Errors
Common errors & fixes
NameError: name 'snake' is not defined
Attempting to use a conversion function (e.g., `snake`) without importing it from the `pyheck` package.
fix
Ensure the specific function is imported: `from pyheck import snake`.
TypeError: 'module' object is not callable
Attempting to call the `pyheck` module directly as a function (e.g., `pyheck('some_text')`) instead of calling one of its conversion functions.
fix
Import and use the specific conversion function, like `from pyheck import snake; snake('some text')`.
Upgrade
Version history
0.1.5latest on PyPI · released Feb 18, 2022
Audit
Dependencies
pythonrequiredRuntime dependency
Agent activity
15 hits · last 30 days
node
14
Resources
pyheck — pip install pyheck · libregistry