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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file writing_style_converter-0.0.12.tar.gz.
File metadata
- Download URL: writing_style_converter-0.0.12.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
008bfce1f32926a8691305f0d63319a427a8d5c8d60c421e5302d2208b66d052
|
|
| MD5 |
37b909c83c0d0f7f6fb89d6a8103abd6
|
|
| BLAKE2b-256 |
4c4442e350f981c2f7807b249c0bf85f5633fc474da3b55f68b3aaa4e99331c6
|
File details
Details for the file writing_style_converter-0.0.12-py3-none-any.whl.
File metadata
- Download URL: writing_style_converter-0.0.12-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cdafa01337522fe59778e4811e7b69b8b3d7934d90b762e92b5456cc13e4215d
|
|
| MD5 |
a5784e54b91f7377f52a8f92dc1a5fba
|
|
| BLAKE2b-256 |
412919611e966d12c0a30174ba739261ce8f9acd6c741601bc003f5cfa906fb2
|