rpt_dosi.metadata ================= .. py:module:: rpt_dosi.metadata Classes ------- .. autoapisummary:: rpt_dosi.metadata.ClassWithMetaData Functions --------- .. autoapisummary:: rpt_dosi.metadata.sync_field_image_db rpt_dosi.metadata.sync_field_image_to_db rpt_dosi.metadata.sync_field_db_to_image rpt_dosi.metadata.sync_field_image_db_auto rpt_dosi.metadata.sync_field_image_db_check Module Contents --------------- .. py:class:: ClassWithMetaData Class to manage metadata, providing methods to convert to/from dict and JSON. The class fields that are considered as metadata are store in _metadata_fields. .. py:attribute:: _metadata_fields :type: Dict[str, type] .. py:attribute:: _debug_eq :value: False .. py:attribute:: _instance_metadata_fields :type: Dict[str, type] .. py:attribute:: _info_width :value: 30 .. py:method:: to_dict() Store the metadata attributes to a dictionary. .. py:method:: from_dict(data) Set the metadata attributes of the instance from a dictionary. .. py:method:: save_to_json(filepath) Save the metadata attributes to a JSON file. .. py:method:: load_from_json(filepath) Load metadata attributes from a JSON file. .. py:method:: add_metadata_field(key, mtype) .. py:method:: set_metadata(key, value) .. py:method:: info() .. py:method:: __str__() .. py:method:: debug_eq(s) .. py:method:: __eq__(other) .. py:function:: sync_field_image_db(image, element_db, tag_name, sync_policy='auto') .. py:function:: sync_field_image_to_db(image, element_db, tag_name) .. py:function:: sync_field_db_to_image(image, element_db, tag_name) .. py:function:: sync_field_image_db_auto(image, element_db, tag_name) .. py:function:: sync_field_image_db_check(image, element_db, tag_name, ok=True, msg='')