Skip to main content

Golem Python API

Tests - Status Docs status PyPI - Status PyPI version GitHub license GitHub issues

What's Golem and yapapi?

The Golem Network fosters a global group of creators building ambitious software solutions that will shape the technological landscape of future generations by accessing computing resources across the platform. Golem Network is an accessible, reliable, open access and censorship-resistant protocol, democratizing access to digital resources and connecting users through a flexible, open-source platform.

Yapapi is the Python high-level API that allows developers to connect to their Golem nodes and manage their distributed, computational loads through Golem Network.

Golem application development

For a detailed introduction to using Golem and yapapi to run your tasks on Golem and a guide to Golem Network application development in general, please consult our handbook.

Installation

yapapi is available as a PyPI package.

You can install it through pip:

pip install yapapi

Or if your project uses poetry you can add it to your dependencies like this:

poetry add yapapi

API Reference

For a comprehensive API reference, please refer to our official readthedocs page.

Local setup for yapapi developers

Poetry

yapapi uses poetry to manage its dependencies and provide a runner for common tasks.

If you don't have poetry available on your system then follow its installation instructions before proceeding. Verify your installation by running:

poetry --version

Project dependencies

To install the project's dependencies run:

poetry install

By default, poetry looks for the required Python version on your PATH and creates a virtual environment for the project if there's none active (or already configured by Poetry).

All of the project's dependencies will be installed to that virtual environment.

Running unit tests

yapapi uses Poe the Poet for running tasks. Declarations of project tasks can be found in pyproject.toml.

poetry run poe tests_unit

Running goth integration tests

Prerequisites

If you'd like to run the yapapi integration test suite locally then you'll need to install an additional set of dependencies separately.

First, install the dependencies required to run goth.

Next, configure goth's GitHub API token.

Make sure you have OpenSSH installed and added to path

ssh -V

Now, you can install goth and its additional python requirements:

poetry install -E integration-tests

Finally, generate goth's default assets:

poetry run poe tests_integration_assets

Running the tests

Once you have the environment set up, to run all the integration tests, use:

poetry run poe tests_integration

Contributing

It is recommended to run unit tests and static code analysis before committing changes.

poetry run poe checks

You can clean up the artifacts created during the test runs with:

poetry run poe clean

See also

Environment variables

It's possible to set various elements of yagna configuration through environment variables. yapapi currently supports the following environment variables:

  • YAGNA_ACTIVITY_URL, URL to yagna activity API, e.g. http://localhost:7500/activity-api/v1
  • YAGNA_API_URL, base URL to yagna REST API, e.g. http://localhost:7500
  • YAGNA_APPKEY, yagna app key to be used, e.g. a70facb9501d4528a77f25574ab0f12b
  • YAGNA_MARKET_URL, URL to yagna market API, e.g. http://localhost:7500/market-api/v1
  • YAGNA_PAYMENT_NETWORK, Ethereum network name for yagna to use, e.g. rinkeby
  • YAGNA_PAYMENT_DRIVER, payment driver name for yagna to use, e.g. erc20
  • YAGNA_PAYMENT_URL, URL to yagna payment API, e.g. http://localhost:7500/payment-api/v1
  • YAGNA_NET_URL, URL to yagna net APU, e.g. http://localhost:7500/net-api/v1
  • YAGNA_SUBNET, name of the yagna sub network to be used, e.g. public
  • YAPAPI_USE_GFTP_CLOSE, if set to a truthy value (e.g. "1", "Y", "True", "on") then yapapi will ask gftp to close files when there's no need to publish them any longer. This may greatly reduce the number of files kept open while yapapi is running but requires yagna 0.7.3 or newer, with older versions it will cause errors.

Metadata

Release files for yapapi 0.13.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yapapi 0.13.1
File Size Uploaded Provenance
yapapi-0.13.1.tar.gz 115.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for yapapi 0.13.1
File Interpreter ABI Platform
yapapi-0.13.1-py3-none-any.whl Python 3 none any Details

Total release size: 252.4 kB

Release files / yapapi-0.13.1.tar.gz

Download URL yapapi-0.13.1.tar.gz
Size 115.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b40360b333385fccf5253cf9734f8b14bc8a018963a68d0d69451f04d020b4a0
BLAKE2b-256 checksum
How to use checksums
00b41a384d388edd78b0d43348bb713fe8d00c814b47dfed25c5d21f7937f2cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.9.20 Linux/6.5.0-1025-azure

Release files / yapapi-0.13.1-py3-none-any.whl

Download URL yapapi-0.13.1-py3-none-any.whl
Size 136.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
003d664c0dd89ca4591092cd9b6a793df515ec4c1465d6b4bdcb5d918bdcdeb4
BLAKE2b-256 checksum
How to use checksums
86403a48a549b9be1689cbca2f90fb7193ddf49d4fd90f4f9bc206fdffb91e22
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.9.20 Linux/6.5.0-1025-azure

Security for yapapi 0.13.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.13.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page