syned package

Subpackages

Submodules

syned.syned_object module

class syned.syned_object.SynedObject[source]

Bases: object

duplicate()[source]

Returns a copy of the SYNED object instance.

Returns:

A copy of the object instance.

Return type:

SynedObject instance

classmethod from_hex_tring(hex_string)[source]
get_value_from_key_name(key)[source]

Gets a value using its key value.

Parameters:

key (str) – The key for the value to retrieve.

info()[source]

Get text info of recurrent SYNED objects.

Return type:

str

info_recurrent(fd, prefix='    ')[source]

Get text info of recurrent SYNED objects.

Parameters:
  • fd (dict) – The dictionary with SYNED data.

  • prefix (str, optional) – Prefix to indent recursive items.

Return type:

str

keys()[source]

Returns the keys of the supporting doctionary. :returns: A list of keys. :rtype: list

set_value_from_key_name(key, value)[source]

Sets a value using its key value.

Parameters:
  • key (str) – The key for the value to modify.

  • value – The new value

to_dictionary()[source]

Returns a dictionary with the object fields.

Some dictionary keys may contain SYNED instances. Use to_full_dictionary to recurrently expand these objects in their basic ingredients.

Returns:

A dictionary with the data.

Return type:

dict

to_full_dictionary()[source]

Returns a dictionary with the object fields, including other syned objects embedded or list of elements.

The “full” means that the SYNED instances found are recurrently expanded in their basic ingredients.

Return type:

dict

to_hex_tring()[source]
to_json(file_name=None)[source]

Writes a json file with the SYNED object data.

Parameters:

file_name (str) – The file name

Returns:

JSON formatted str. The result of json.dumps()

Return type:

str

Module contents