Skip to main content

Encoding-decoding HELML format

Project description

HELML

helml-logo

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

HELML-0.1.5.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

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

HELML-0.1.5-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file HELML-0.1.5.tar.gz.

File metadata

  • Download URL: HELML-0.1.5.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for HELML-0.1.5.tar.gz
Algorithm Hash digest
SHA256 b3869c05eef1498e14cb62501c6acd28f5c79a1e2afeedc55c6357621457885a
MD5 828134a61619c5101f25b3fa32dc8e01
BLAKE2b-256 b6a04c2403b9d8a055176e8fb3ebc3348e35a5c6e76d206f6d37559add1a54f4

See more details on using hashes here.

File details

Details for the file HELML-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: HELML-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for HELML-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 a225b0cc400982b84ece2b31539fe0a9f3c46d4be7d101c094b7f971e8e2d3f4
MD5 9bc86e49af73c1f8387485bcf3f1d652
BLAKE2b-256 1ce8e40a86a86f09d58a4eb870347d7d06bfc71ff16d19c21d8be3335cca7c43

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