Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

golem_cloud-0.2.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

golem_cloud-0.2.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file golem_cloud-0.2.0.tar.gz.

File metadata

  • Download URL: golem_cloud-0.2.0.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.7.8

File hashes

Hashes for golem_cloud-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1eb113e8a39f007e1e3da224b929d1e23597ca0887b703169b05ce3ea008eeab
MD5 36df848f57f2a4279e454d2c43455ac3
BLAKE2b-256 2d95d9a697d1182b8c2d27d8ee7cea6ef49448867bf60ed6e31ace3ecc1f670d

See more details on using hashes here.

File details

Details for the file golem_cloud-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for golem_cloud-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 63ae1a966d3df05a2f1819b192b563c14f2afde2c681ad71556c596609c5950c
MD5 ab7a817b97eb407134b608d5d7743fca
BLAKE2b-256 c140999b24de7eac2721b0dcb8930620ceb2f4f6f8048b602f0c4ac0fe78c445

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page