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:

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.

key
string

The virtual and freely chosen path for your dumped value.

value
any_python_thing

The value that you want to dump.

def sum(a, b):
    return a + b

upsonic.dump("math.sum", sum)
You can include any class just as it is; no changes are required.

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’ .

key
string

The name you want to use in load operations.

value
module

The module that you want to dump, including all its contents.

import random

upsonic.dump_module("random", random)