A library that helps with writing Golem components in Python
Project description
golem-cloud
A library that helps with writing Golem components in Python
Usage
golem-cloud is built on top of componentize-py and relies on bindings generated by it to work. To set up a project begin by creating a wit directory and defining a world that your component will implement:
package demo-namespace:demo-package;
interface demo-api {
run: func();
}
world demo-world {
import wasi:http/types@0.2.0;
import wasi:http/outgoing-handler@0.2.0;
import golem:api/host@1.1.6;
export demo-api;
}
To enable usage of golem-cloud with your project you need to tell it about your world and where the bindings will be generated by componentize-py. To do this include the following code snippet at the top of your python code. Make sure to place it before any other uses of the golem-cloud library.
import golem_py_bindings
golem_py_bindings.register_bindings("demo_world") # Put the name of your world here
You can now use golem-cloud in your project:
from golem_py.durability import Durability, DurableFunctionType
from demo_world.imports.oplog import WrappedFunctionType_ReadLocal
durability = Durability("custom", "random-number-generator", WrappedFunctionType_ReadLocal)
Note: golem-cloud is using bindings that are generated by componentize-py for your world. You can only use the modules in golem-cloud for which you have all necessary bindings (by having the appropriate imports and exports in your world). Trying to use a module for which your don't have all required bindings will fail with an import error (even if the initial register_bindings was successful). Every module in golem-cloud documents which bindings are required for it to work, so please consult the module documentation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file golem_cloud-0.1.1.tar.gz.
File metadata
- Download URL: golem_cloud-0.1.1.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42cb3828cbcb1ed2917f2108eeea2312d782fd9be817197057817b8dbce4e9ec
|
|
| MD5 |
8482f1bc453f2dfcb0a2f1a02d90d852
|
|
| BLAKE2b-256 |
af9d3b1b71b3428b40f38a75e06f743b52d8a7a7c3eb9e6d9e9511f293481fb9
|
File details
Details for the file golem_cloud-0.1.1-py3-none-any.whl.
File metadata
- Download URL: golem_cloud-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf93a83931f4da6a5fffebfe02d41f1295e5cd5dd34d70337e098933e2345e27
|
|
| MD5 |
fd7c03f28e92a951ae80cdaf86c4ab58
|
|
| BLAKE2b-256 |
d399f8f6e99749e6d8c0899e406b5de0851cc82dd0c382e22290d0fd6f6627fe
|