https://github.com/beaucronin/basket_case
Python swiss army knife for translating between case styles - camel, kebab, snake, title, etc.
https://github.com/beaucronin/basket_case
camelcase camelcase-to-snakecase python-library string-casing string-formatting string-manipulation titlecase
Last synced: 10 days ago
JSON representation
Python swiss army knife for translating between case styles - camel, kebab, snake, title, etc.
- Host: GitHub
- URL: https://github.com/beaucronin/basket_case
- Owner: beaucronin
- License: mit
- Created: 2020-04-18T15:29:21.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-15T23:27:32.000Z (over 5 years ago)
- Last Synced: 2025-11-27T17:27:25.828Z (2 months ago)
- Topics: camelcase, camelcase-to-snakecase, python-library, string-casing, string-formatting, string-manipulation, titlecase
- Language: Python
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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!