Skip to main content

Basket Case

Basket case is a small, pure-Python swiss army knife for translating strings between case styles. I developed it because in my development work I often need to switch between string renderings: snake_case for Python, slug-names for document names, camelCase for a bunch of things, CONSTANT_NAMES for, well, constants, and Title Case for nice human readability.

I want to be able to move between these fluidly and reliably, and by using a single import statement.

import basket_case as bc

my_string = "a long name for a variable"
assert bc.slug(my_string)     == "a-long-name-for-a-variable"
assert bc.title(my_string)    == "A Long Name for a Variable"
assert bc.camel(my_string)    == "aLongNameForAVariable"
assert bc.snake(my_string)    == "a_long_name_for_a_variable"
assert bc.constant(my_String) == "A_LONG_NAME_FOR_A_VARIABLE"

Installation

pip install basket-case

Python 3+ only; sorry not sorry.

Usage

Dependencies

Basket case wraps titlecase and python-slugify for their respective capabilities.

Contributions

Please!

Metadata

Release files for basket-case 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for basket-case 0.1.4
File Size Uploaded Provenance Actions
basket-case-0.1.4.tar.gz 3.7 kB Without provenance Details for basket-case-0.1.4.tar.gz

Release files / basket-case-0.1.4.tar.gz

Download URL basket-case-0.1.4.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ee90798bf44c780d88d96e539bf24605bb2373b5e9f3968c0b00669d48357f76
BLAKE2b-256 checksum
How to use checksums
3bf7bf5c9b4f8cc7ae4b125f879534a1689ea658178cbb088be17bba801ea2cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

Security for basket-case 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page