Skip to main content

Utility for parsing and converting naming conventions

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nomage-1.0.0.tar.gz (68.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nomage-1.0.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

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

Hashes for nomage-1.0.0.tar.gz
Algorithm Hash digest
SHA256 431a36ffe23e8ce967ec3046582009f5693f06f360b5a06cbfea15d59a6637ff
MD5 acfc48d2db898573ca84991f7a80a6e2
BLAKE2b-256 d6d39bb940ee4269c4506defdb4fc49d22c18a4c833a3844fcb709eab9d51229

See more details on using hashes here.

Provenance

The following attestation bundles were made for nomage-1.0.0.tar.gz:

Publisher: release.yml on CGuichard/nomage

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for nomage-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8e82de359f26554050f4386ec6d8c2352d376171d49804ca915ba814962dbf6b
MD5 9b1b169c4b2d264733900029acb97f88
BLAKE2b-256 972ece5389ac5c83a5c0b2601eeaefcb91195a7b8f9edc621a61fd3010db0ba0

See more details on using hashes here.

Provenance

The following attestation bundles were made for nomage-1.0.0-py3-none-any.whl:

Publisher: release.yml on CGuichard/nomage

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page