Skip to main content

Converts PascalCase or snake_case strings to camelCase.

Project description

camelCasing Package

This package converts Pascal Case and snake_case strings into its camelCase equivalent.

Installation

pip install camelCasing

Basic Use

from camelCasing import camel_case_generator as camelCase

Its functionality can be used in at least two ways:

(1) Individually:

# recode a single string
camelCase.to_camel_case(s='TheQuickBrownFox', user_acronyms=None)

or (2) in list comprehensions:

# get camelCase replacements for an arbitrary dataframe
[camelCase.to_camel_case(s=s, user_acronyms=None) for s in df.columns]

User Defined Acronyms

One of the tricky problems facing camel case text generation is the problem of acronyms. This package allows for user defined acronyms that the program should look for and account for when creating its camelCase equivalent.

Consider the following example:

s7 = 'UefiDbx_UefiDbxKeyStatus'
assert camelCase.to_camel_case(s7, ['WMI', 'FRU', 'SKU', 'UEFI']) == 'UEFIDbxUEFIDbxKeyStatus', 'failed'

This functionality lets you have control over the acronyms that you want to keep and maintain.

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

camelcasing-0.0.4.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

camelcasing-0.0.4-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file camelcasing-0.0.4.tar.gz.

File metadata

  • Download URL: camelcasing-0.0.4.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.12

File hashes

Hashes for camelcasing-0.0.4.tar.gz
Algorithm Hash digest
SHA256 b3356c367f2bf88a5afd2b22277730d3bf414ec0af3ce68618a5b801e2a4457e
MD5 751b1f8b07be2771b7bfde21472d6489
BLAKE2b-256 8ad7b8bdc68470ab0ec989cac7441e5a969518296d44c900971efc6e93fb93d3

See more details on using hashes here.

File details

Details for the file camelcasing-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: camelcasing-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.12

File hashes

Hashes for camelcasing-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5ec12878cf0e620e36c6e8a088434765697d994643e58229825ddeaebcdf27f9
MD5 9570464126de419057d5f532f0f30926
BLAKE2b-256 1828a41fd7ef9e7414d265d639c610d426bf881964831547bd942e667d72879b

See more details on using hashes here.

Supported by

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