robocorp-storage
Handling different asset types
On the most basic level, the Asset Storage feature stores binary data that is associated with a name and information about the content type.
The Control Room UI has built several abstractions on top of it, such as directly uploading text or JSON. These different asset types can also be directly read and created from within the library.
Text
The text
methods can be used for directly reading and writing plaintext
assets, with the content type text/plain
.
JSON
The json
methods can be used to read and write any data that can be
serialized into JSON. Values read as JSON are automatically deserialized
into Python objects. They have the content type application/json
.
Files
The file
methods are an abstraction that help with working data that
exist on the file system instead of within Python code. The content type
can be defined manually, but the library tries to guess it automatically
based on the file's suffix.
Bytes
The lowest level API, for handling arbitrary binary data and a manually defined content type: