Skip to main content

A library for converting naming styles in Python code. telegram: "@Orlov_SA"

Project description

Writing Style Converter

Overview

The WSC (writing_style_converter) library provides a utility for converting dictionaries between different naming conventions.

from writing_style_converter import WSC


all_case_dict = {
    "snake_case": {"value_one": 123, "value_two": [{"value_three": 123}]},
    "kebab-case": {"value-one": 123, "value-two": [{"value-three": 123}]},
    "camelCase": {"valueOne": 123, "valueTwo": [{"valueThree": 123}]},
    "PascalCase": {"ValueOne": 123, "ValueTwo": [{"ValueThree": 123}]},
}

# Example with humidities set to True (default)
wsc_dict = WSC(all_case_dict)

# Access different naming conventions
print(wsc_instance.value)          # Original dictionary
print(wsc_instance.snake)          # Converted to snake_case
print(wsc_instance.kebab)          # Converted to kebab-case
print(wsc_instance.camel)          # Converted to camelCase
print(wsc_instance.pascal)         # Converted to PascalCase

# Example with humidities set to False
wsc_dict_humidities = WSC(all_case_dict, humidities=False)

print(wsc_instance_without_humidities.snake)  # Converted to snake_case without humidities

The humidities parameter controls whether the conversion process includes nested dictionaries and lists. When set to True (default), the conversion includes nested structures. When set to False, only the top-level dictionary is converted.

Installation

pip install writing_style_converter

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

writing_style_converter-0.0.12.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

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

writing_style_converter-0.0.12-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file writing_style_converter-0.0.12.tar.gz.

File metadata

File hashes

Hashes for writing_style_converter-0.0.12.tar.gz
Algorithm Hash digest
SHA256 008bfce1f32926a8691305f0d63319a427a8d5c8d60c421e5302d2208b66d052
MD5 37b909c83c0d0f7f6fb89d6a8103abd6
BLAKE2b-256 4c4442e350f981c2f7807b249c0bf85f5633fc474da3b55f68b3aaa4e99331c6

See more details on using hashes here.

File details

Details for the file writing_style_converter-0.0.12-py3-none-any.whl.

File metadata

File hashes

Hashes for writing_style_converter-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 cdafa01337522fe59778e4811e7b69b8b3d7934d90b762e92b5456cc13e4215d
MD5 a5784e54b91f7377f52a8f92dc1a5fba
BLAKE2b-256 412919611e966d12c0a30174ba739261ce8f9acd6c741601bc003f5cfa906fb2

See more details on using hashes here.

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