Extended Data Typesβ
π Supercharge your Python data types! π
Extended Data Types is a Python library that provides additional functionality for Pythonβs standard data types. It includes utilities for handling YAML, JSON, Base64, file paths, strings, lists, maps, and more.
Key Featuresβ
π Base64 encoding and decoding - Easily encode data to Base64 format with optional wrapping for export.
π File path utilities - Manipulate and validate file paths, check file extensions, and determine encoding types.
πΊοΈ Extended map and list utilities - Flatten, filter, and manipulate dictionaries and lists with ease.
π String matching and manipulation - Partially match strings, convert case, and validate URLs.
ποΈ Custom YAML utilities - Handle custom YAML tags, construct YAML pairs, and represent data structures.
Base64 Encodingβ
from extended_data_types import base64_encode
data = "Hello, world!"
encoded = base64_encode(data)
print(encoded) # Output: SGVsbG8sIHdvcmxkIQ==
File Path Utilitiesβ
from extended_data_types import match_file_extensions
file_path = "example.txt"
allowed_extensions = [".txt", ".log"]
is_allowed = match_file_extensions(file_path, allowed_extensions)
print(is_allowed) # Output: True
YAML Utilitiesβ
from extended_data_types import encode_yaml, decode_yaml
data = {"name": "Alice", "age": 30}
yaml_str = encode_yaml(data)
print(yaml_str)
# Output:
# name: Alice
# age: 30
decoded_data = decode_yaml(yaml_str)
print(decoded_data) # Output: {'name': 'Alice', 'age': 30}
For more usage examples, see the Usage documentation.
Contributingβ
Contributions are welcome! Please see the Contributing Guidelines for more information.
Creditβ
Extended Data Types is written and maintained by Jon Bogaty.
Project Linksβ
Get Help (use the extended-data-types tag on Stack Overflow)
User Documentationβ
Licenseβ
The Extended Data Types library is provided under the MIT License. See the LICENSE file for details.
