her package


her.decoder module


It contains the decoder functions.

It could be used to decode HER and convert it into a dictionary.


It parses the string and convert it into a dictionary.

Parameters:representation (list) – A list of the lines of the string.
Return type:Dict[str, Any]

her.encoder module


It contains the encoder functions.

It could be used to encode a dictionary and convert it into an HER text.


It parses and convert the dictionary into an HER text.

Parameters:dictionary (dict) – The dictionary you want to convert.
Return type:str

her.her module


It contains all objects that represents an HER file.

class her.her.HER(value=None)

Bases: object

The HER class is used to avoid multiple calls of the encode & decode functions. It uses properties, so it updates all its attributes every single time you assign a new value to an attribute.


x = her.HER()
x.value = {"foo": {"lol": 1}}
print(repr(x.representation)) # Output: '- foo -\n    * lol = 1'

You can also pass a parameter (dict or str):

x = her.HER('- foo -\n    * lol = 1')
print(x.value) # Output: {"foo": {"lol": 1}}

y = her.HER({"foo": {"lol": 1}})
print(repr(x.representation)) # Output: '- foo -\n    * lol = 1'

The string which represents the set value using HER standards.

Returns:The representation.
Return type:str

The value which represents the content of the HER string as a dictionary.

Returns:The value.
Return type:dict

Module contents


It contains the main functions used to convert an HER string to a dictionary and viceversa.