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
Install nomage with pip:
pip install nomageInstall 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>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'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 / StudlyCasefrom 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'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.
Copyright © 2026, Clément GUICHARD
Nomage is licensed under the MIT license. A copy of this license is provided in the LICENSE file.
This package was created with Cookiecutter from the project template CGuichard/cookiecutter-pypackage.
