A collection of Python utilities for common programming tasks.
pip install toolbox-pyThis package provides various utility functions organized into different modules:
compress_string/decompress_string- String compression using zlibcamel_to_snake/snake_to_camel- Case conversion utilitiesslugify- Convert strings to URL-friendly slugs
flatten_dict- Flatten nested dictionaries with dot notationmerge_dicts- Recursively merge dictionariesDotDict- Dictionary with dot notation access
flatten_list- Flatten nested lists
encode_to_base64/decode_from_base64- Base64 encoding utilities
- JSON handling
- Data class utilities
import toolbox
# String utilities
camel_case = toolbox.snake_to_camel("hello_world") # "HelloWorld"
snake_case = toolbox.camel_to_snake("HelloWorld") # "hello_world"
slug = toolbox.slugify("Hello World!") # "hello-world"
# Dictionary utilities
nested = {'a': {'b': {'c': 1}}, 'd': 2}
flat = toolbox.flatten_dict(nested) # {'a.b.c': 1, 'd': 2}
# Dot notation dictionary
dot_dict = toolbox.DotDict(x=1, y=2)
print(dot_dict.x) # 1
# Base64 encoding
encoded = toolbox.encode_to_base64("Hello")# Clone the repository
git clone https://github.com/Aazerra/toolbox-py.git
cd toolbox-py
# Install development dependencies
pip install -e .[dev]
# Run tests
pytest
# Build the package
python -m buildMIT License - see LICENSE file for details.