Home Butler Docs Tutorials Object Database src Butler src

Contents

  1. Script Uploading
  2. Calling the upload function

Butler module - Script Uploading

Use the following JSON files as reference if you want to upload data that you have already generated:
https://github.com/Hartvi/butler/tree/main/example_upload_dictionaries

The dictionaries are processed in Butler's post_measurement() function. On line 17 in the following example, the absolute path to the img_cam1.png file acts as a proxy for the actual file. When this dictionary is plugged into Butler's post_measurement() function, the absolute path will be replaced with just img_cam1.png and the file located on the original absolute path will be opened and its bytes uploaded.



Calling the upload function

To upload a single formatted JSON dictionary, use the post_measurement function as follows.


The Butler module keeps track of which dictionaries have been uploaded in the file butler/uploaded_dicts.json. You can therefore use the following function to upload all not yet uploaded dictionaries.