Encoding-decoding HELML format
Project description
HELML
Overview
HELML (Human-Editable List Markup Language , HEader-Like Markup Language) is a Python library that provides an easy way to encode and decode data structures such as lists, dictionaries, and tuples into human-readable and editable strings. This can be used for cross-platform data transfer, configuration files, data serialization, and other purposes.
See more: HELML format definition
Installation
To install HELML, simply use pip:
pip install helml
Usage
Here's a quick example of how to use the HELML library:
from helml import HELML
# Example data structure
data = {
"key1": "value1",
"key2": [1, 2, 3],
"key3": {
"nested_key": "nested_value"
}
}
# Encode the data structure into a HELML string
encoded_data = HELML.encode(data)
print(encoded_data)
# Decode the HELML string back into a data structure
decoded_data = HELML.decode(encoded_data)
print(decoded_data)
encoded_data:
key1: value1
key2:
:0: 1
:1: 2
:2: 3
key3
:nested_key: nested_value
Features
Encode and decode lists, dictionaries, and tuples into human-readable and editable strings. Support for URL mode, which uses different characters to separate levels and spaces. Customizable value encoding and decoding functions. Easy-to-understand format that can be used for various applications.
API
HELML.encode(arr, url_mode=False)
Encode a data structure (list, dict, or tuple) into a HELML string.
- arr: The input data structure to be encoded.
- url_mode (bool, optional): A boolean indicating if the URL mode should be used. Defaults to False.
Returns:
- str: The encoded HELML string.
HELML.decode(src_rows)
Decode a HELML formatted string or list of strings into a nested dictionary.
- src_rows: The HELML input as a string or strings-array.
Returns:
- dict: The decoded nested dictionary.
License
This project is licensed under the MIT License.
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 HELML-0.1.4.tar.gz.
File metadata
- Download URL: HELML-0.1.4.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ff17bb3cbf5d1122bc866a7eceb379a47048f111ac03aaf18bde3c3fe4a9c2d
|
|
| MD5 |
6cf2c25f13ca2511c737d61e1e871895
|
|
| BLAKE2b-256 |
db0a69373d23a0690455e5d50a5276a19d886cce8ed479bc0245c952f44ec4fb
|
File details
Details for the file HELML-0.1.4-py3-none-any.whl.
File metadata
- Download URL: HELML-0.1.4-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bde435178eefa3446d1a35975bf93c337c50a9fe06593b1d242c2bfa999f9941
|
|
| MD5 |
245a9f177cf2126651c5bf256209bd8c
|
|
| BLAKE2b-256 |
449f0199bb57489c8eabcbb0bf5e29b1b6f81273c891fb3b617cd77b8ef84f81
|