Born from a hatred of camel case manuscript titles.
Project description
nocamel
A simple command-line utility to convert camelCase or PascalCase strings to other more acceptable formats.
Description
nocamel is a Python-based CLI tool that aims to kill the camel case. Are there other ways to do this? Yes. Did I learn something while making it? Also Yes.
Installation
From PyPI
pip install nocamel
From Source
git clone https://github.com/jchar32/nocamel.git
cd nocamel
pip install -e .
Verify installation:
import nocamel
print(nocamel.__version__)
Usage
Command Line Interface
Basic usage:
nocamel "Your Camel Case String"
This will output: Your camel case string
Options
Convert from camel or pascal case to...
-snake: to snake case "like_this"--sentence (default): to sentence case and inject spaces "Like this"--lower: to all lower case "like this" or "likethis"-h, --help: Show the help message
Examples
Convert camelCase to lower case:
$ nocamel "helloWorldExample"
helloworldexample
Convert to kebab-case:
$ nocamel "Hello World Example" --kebab
hello-world-example
Convert to snake_case:
$ nocamel "hello World Example" --snake
hello_world_example
Convert sentence case:
$ nocamel "hello World Example" --sentence
Hello world example
As a Python Module
You can also use nocamel as a Python module in your projects:
from nocamel import converters
result = converters.to_snake("helloWorldExample")
print(result) # Output: hello_world_example
result_kebab = converters.to_kebob("Hello World Example")
print(result_kebab) # Output: hello-world-example
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nocamel-2025.1.0.tar.gz.
File metadata
- Download URL: nocamel-2025.1.0.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c82cc208f5e5380308ffd70a164198d7386baf81d1a5498ad1ecb23a1c1a568
|
|
| MD5 |
b5add9e5d46bb81e183420136093ed72
|
|
| BLAKE2b-256 |
719b72d4045061d438592725e6521c60a78830abe14d427042e73de8a614a7a2
|
File details
Details for the file nocamel-2025.1.0-py3-none-any.whl.
File metadata
- Download URL: nocamel-2025.1.0-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
865d15f376af73b236b3db8188e830f47812cca26011dd586b2e4be989d5e080
|
|
| MD5 |
ae19abf32530448ef5e7233d2cccb9e6
|
|
| BLAKE2b-256 |
1bbda3d32ad5f00285b1460cda8dfd8a13aaae68c60b1b108f2a4678919e3dfe
|