Dump Operation
The dump functions are the initial step in using Upsonic. These functions serialize and prepare the data, sending it to the Upsonic Server system.
To get started, you will need:
- Implemented connection code
upsonic.dump
This function is used for dumping a singular item to Upsonic. With this, you can dump a Function, Class, Object, or any Variable. You just need to provide a name with the key
parameter and assign the element with the value
parameter.
The virtual and freely chosen path for your dumped value.
The value that you want to dump.
def sum(a, b):
return a + b
upsonic.dump("math.sum", sum)
upsonic.dump_module
This command is designed to dump an entire library with just one line. You can use it to dump a folder containing your existing library. You only need to provide a ‘key’ and the ‘module’ as its ‘value’ .
The name you want to use in load operations.
The module that you want to dump, including all its contents.
import random
upsonic.dump_module("random", random)