Utility for parsing and converting naming conventions
Project description
Nomage
Nomage is a Python tool that helps you work with different naming conventions in your code. It provides tools to detect, parse, and convert identifiers between various conventions like camelCase, snake_case, kebab-case, and more.
Features:
- 🔍 Automatic Detection: Identify the naming convention of any identifier
- 🔄 Easy Conversion: Transform identifiers between different conventions
- 🛠️ Flexible API: Use it programmatically or via command-line
- 📦 Built-in Conventions: Support for common naming patterns
- 🔌 Extensible: Create and use your own custom conventions
- 🔎 Smart Lookup: Case-insensitive and separator-insensitive convention lookup
Table of Contents
Getting started
Installation
Install nomage with pip:
pip install nomage
Install from source:
pip install git+https://github.com/CGuichard/nomage.git
# or with a specific version
pip install git+https://github.com/CGuichard/nomage.git@<tag>
Usage
Detecting Conventions
from nomage import naming
# Detect convention
id_naming = naming("my_identifier")
print(id_naming.convention.names)
# ('snake_case', 'snail_case', 'pothole_case')
# Handle unknown conventions
try:
naming("my-_-identifier")
except ValueError:
print("Unrecognized convention")
$ nomage my_identifier
Detected: snake_case / snail_case / pothole_case
$ nomage my-_-identifier
No matching naming convention, invalid identifier 'my-_-identifier'
Checking Conventions
from nomage import naming
id_naming = naming("my_identifier")
print(id_naming.convention == "snake") # True
print(id_naming.convention == "pascal") # False
$ nomage my_identifier --check snake
$ nomage my_identifier --check pascal
Not matching convention: PascalCase / UpperCamelCase / StudlyCase
Converting Identifiers
from nomage import naming
id_naming = naming("my-identifier")
# Convert to different conventions
print(id_naming.to("snake_case")) # my_identifier
print(id_naming.to("camelCase")) # myIdentifier
$ nomage my-identifier --to snake
my_identifier
$ nomage my_identifier --to camelCase
myIdentifier
$ nomage my_identifier --to test
Could not find naming convention 'test'
Contributing
If you want to contribute to this project please check CONTRIBUTING.md.
Everyone contributing to this project is expected to treat other people with respect, and more generally to follow the guidelines articulated by our Code of Conduct.
License
Copyright © 2026, Clément GUICHARD
Nomage is licensed under the MIT license. A copy of this license is provided in the LICENSE file.
Acknowledgements
This package was created with Cookiecutter from the project template CGuichard/cookiecutter-pypackage.
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 nomage-1.0.0.tar.gz.
File metadata
- Download URL: nomage-1.0.0.tar.gz
- Upload date:
- Size: 68.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
431a36ffe23e8ce967ec3046582009f5693f06f360b5a06cbfea15d59a6637ff
|
|
| MD5 |
acfc48d2db898573ca84991f7a80a6e2
|
|
| BLAKE2b-256 |
d6d39bb940ee4269c4506defdb4fc49d22c18a4c833a3844fcb709eab9d51229
|
Provenance
The following attestation bundles were made for nomage-1.0.0.tar.gz:
Publisher:
release.yml on CGuichard/nomage
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nomage-1.0.0.tar.gz -
Subject digest:
431a36ffe23e8ce967ec3046582009f5693f06f360b5a06cbfea15d59a6637ff - Sigstore transparency entry: 864421329
- Sigstore integration time:
-
Permalink:
CGuichard/nomage@c3eaad640013cb757706ab29f6e91e32744b5c53 -
Branch / Tag:
refs/tags/1.0.0 - Owner: https://github.com/CGuichard
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c3eaad640013cb757706ab29f6e91e32744b5c53 -
Trigger Event:
push
-
Statement type:
File details
Details for the file nomage-1.0.0-py3-none-any.whl.
File metadata
- Download URL: nomage-1.0.0-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e82de359f26554050f4386ec6d8c2352d376171d49804ca915ba814962dbf6b
|
|
| MD5 |
9b1b169c4b2d264733900029acb97f88
|
|
| BLAKE2b-256 |
972ece5389ac5c83a5c0b2601eeaefcb91195a7b8f9edc621a61fd3010db0ba0
|
Provenance
The following attestation bundles were made for nomage-1.0.0-py3-none-any.whl:
Publisher:
release.yml on CGuichard/nomage
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nomage-1.0.0-py3-none-any.whl -
Subject digest:
8e82de359f26554050f4386ec6d8c2352d376171d49804ca915ba814962dbf6b - Sigstore transparency entry: 864421387
- Sigstore integration time:
-
Permalink:
CGuichard/nomage@c3eaad640013cb757706ab29f6e91e32744b5c53 -
Branch / Tag:
refs/tags/1.0.0 - Owner: https://github.com/CGuichard
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c3eaad640013cb757706ab29f6e91e32744b5c53 -
Trigger Event:
push
-
Statement type: