Skip to content

CGuichard/nomage

Nomage

Nomage logo

Utility for parsing and converting naming conventions

Language License Documentation Style Lint Security PyPI - Version Tests Coverage

Pull Request · Bug Report · Feature Request

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.

About

Utility for parsing and converting naming conventions

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors