yapapi


Nameyapapi JSON
Version 0.13.0 PyPI version JSON
download
home_pagehttps://github.com/golemfactory/yapapi
SummaryHigh-level Python API for the New Golem
upload_time2024-06-04 14:41:00
maintainerNone
docs_urlNone
authorGolemFactory
requires_python<4.0,>=3.8
licenseLGPL-3.0-or-later
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Golem Python API

[![Tests - Status](https://img.shields.io/github/workflow/status/golemfactory/yapapi/Continuous%20integration/master?label=tests)](https://github.com/golemfactory/yapapi/actions?query=workflow%3A%22Continuous+integration%22+branch%3Amaster)
[![Docs status](https://readthedocs.org/projects/yapapi/badge/?version=latest)](https://yapapi.readthedocs.io/en/latest/)
![PyPI - Status](https://img.shields.io/pypi/status/yapapi)
[![PyPI version](https://badge.fury.io/py/yapapi.svg)](https://badge.fury.io/py/yapapi)
[![GitHub license](https://img.shields.io/github/license/golemfactory/yapapi)](https://github.com/golemfactory/yapapi/blob/master/LICENSE)
[![GitHub issues](https://img.shields.io/github/issues/golemfactory/yapapi)](https://github.com/golemfactory/yapapi/issues)

## What's Golem and yapapi?

**[The Golem Network](https://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](https://handbook.golem.network/requestor-tutorials/flash-tutorial-of-requestor-development).

### Installation

`yapapi` is available as a [PyPI package](https://pypi.org/project/yapapi/).

You can install it through `pip`:

```bash
pip install yapapi
```

Or if your project uses [`poetry`](https://python-poetry.org/) you can add it to your dependencies like this:

```bash
poetry add yapapi
```

### API Reference

For a comprehensive API reference, please refer to [our official readthedocs page](https://yapapi.readthedocs.io/).

## Local setup for yapapi developers

### Poetry

`yapapi` uses [`poetry`](https://python-poetry.org/) 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](https://python-poetry.org/docs/#installation) before proceeding.
Verify your installation by running:

```bash
poetry --version
```

### Project dependencies

To install the project's dependencies run:

```bash
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](https://github.com/nat-n/poethepoet) for running tasks.
Declarations of project tasks can be found in `pyproject.toml`.

```bash
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](https://github.com/golemfactory/goth#requirements).

Next, [configure goth's GitHub API token](https://github.com/golemfactory/goth#getting-a-github-api-token).

Make sure you have OpenSSH installed and added to path

```bash
ssh -V
```

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

```bash
poetry install -E integration-tests
```

Finally, generate goth's default assets:

```bash
poetry run poe tests_integration_assets
```

#### Running the tests

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

```bash
poetry run poe tests_integration
```

### Contributing

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

```bash
poetry run poe checks
```

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

```bash
poetry run poe clean
```

## See also

* [Golem](https://golem.network), a global, open-source, decentralized supercomputer that anyone can access.
* Learn what you need to know to set-up your Golem requestor node:
  * [Requestor development: a quick primer](https://handbook.golem.network/requestor-tutorials/flash-tutorial-of-requestor-development)
  * [Run first task on Golem](https://handbook.golem.network/requestor-tutorials/flash-tutorial-of-requestor-development/run-first-task-on-golem)
* Have a look at the most important concepts behind any Golem application: [Golem application fundamentals](https://handbook.golem.network/requestor-tutorials/golem-application-fundamentals)
* Learn about preparing your own Docker-like images for the [VM runtime](https://handbook.golem.network/requestor-tutorials/vm-runtime)
* Write your own app with yapapi:
  * [Task Model development](https://handbook.golem.network/requestor-tutorials/task-processing-development)
  * [Service Model development](https://handbook.golem.network/requestor-tutorials/service-development)

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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/golemfactory/yapapi",
    "name": "yapapi",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "GolemFactory",
    "author_email": "contact@golem.network",
    "download_url": "https://files.pythonhosted.org/packages/ff/83/05e5f020e3df09f1a897df417bf8c6a435fcc8e16d7f8683e0a97a67bd8f/yapapi-0.13.0.tar.gz",
    "platform": null,
    "description": "# Golem Python API\n\n[![Tests - Status](https://img.shields.io/github/workflow/status/golemfactory/yapapi/Continuous%20integration/master?label=tests)](https://github.com/golemfactory/yapapi/actions?query=workflow%3A%22Continuous+integration%22+branch%3Amaster)\n[![Docs status](https://readthedocs.org/projects/yapapi/badge/?version=latest)](https://yapapi.readthedocs.io/en/latest/)\n![PyPI - Status](https://img.shields.io/pypi/status/yapapi)\n[![PyPI version](https://badge.fury.io/py/yapapi.svg)](https://badge.fury.io/py/yapapi)\n[![GitHub license](https://img.shields.io/github/license/golemfactory/yapapi)](https://github.com/golemfactory/yapapi/blob/master/LICENSE)\n[![GitHub issues](https://img.shields.io/github/issues/golemfactory/yapapi)](https://github.com/golemfactory/yapapi/issues)\n\n## What's Golem and yapapi?\n\n**[The Golem Network](https://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.\n\n**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.\n\n## Golem application development\n\nFor 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](https://handbook.golem.network/requestor-tutorials/flash-tutorial-of-requestor-development).\n\n### Installation\n\n`yapapi` is available as a [PyPI package](https://pypi.org/project/yapapi/).\n\nYou can install it through `pip`:\n\n```bash\npip install yapapi\n```\n\nOr if your project uses [`poetry`](https://python-poetry.org/) you can add it to your dependencies like this:\n\n```bash\npoetry add yapapi\n```\n\n### API Reference\n\nFor a comprehensive API reference, please refer to [our official readthedocs page](https://yapapi.readthedocs.io/).\n\n## Local setup for yapapi developers\n\n### Poetry\n\n`yapapi` uses [`poetry`](https://python-poetry.org/) to manage its dependencies and provide a runner for common tasks.\n\nIf you don't have `poetry` available on your system then follow its [installation instructions](https://python-poetry.org/docs/#installation) before proceeding.\nVerify your installation by running:\n\n```bash\npoetry --version\n```\n\n### Project dependencies\n\nTo install the project's dependencies run:\n\n```bash\npoetry install\n```\n\nBy 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).\n\nAll of the project's dependencies will be installed to that virtual environment.\n\n### Running unit tests\n\n`yapapi` uses [Poe the Poet](https://github.com/nat-n/poethepoet) for running tasks.\nDeclarations of project tasks can be found in `pyproject.toml`.\n\n```bash\npoetry run poe tests_unit\n```\n\n### Running `goth` integration tests\n\n#### Prerequisites\n\nIf you'd like to run the `yapapi` integration test suite locally then you'll need to install an additional set of dependencies separately.\n\nFirst, install [the dependencies required to run goth](https://github.com/golemfactory/goth#requirements).\n\nNext, [configure goth's GitHub API token](https://github.com/golemfactory/goth#getting-a-github-api-token).\n\nMake sure you have OpenSSH installed and added to path\n\n```bash\nssh -V\n```\n\nNow, you can install goth and its additional python requirements:\n\n```bash\npoetry install -E integration-tests\n```\n\nFinally, generate goth's default assets:\n\n```bash\npoetry run poe tests_integration_assets\n```\n\n#### Running the tests\n\nOnce you have the environment set up, to run all the integration tests, use:\n\n```bash\npoetry run poe tests_integration\n```\n\n### Contributing\n\nIt is recommended to run unit tests and static code analysis before committing changes.\n\n```bash\npoetry run poe checks\n```\n\nYou can clean up the artifacts created during the test runs with:\n\n```bash\npoetry run poe clean\n```\n\n## See also\n\n* [Golem](https://golem.network), a global, open-source, decentralized supercomputer that anyone can access.\n* Learn what you need to know to set-up your Golem requestor node:\n  * [Requestor development: a quick primer](https://handbook.golem.network/requestor-tutorials/flash-tutorial-of-requestor-development)\n  * [Run first task on Golem](https://handbook.golem.network/requestor-tutorials/flash-tutorial-of-requestor-development/run-first-task-on-golem)\n* Have a look at the most important concepts behind any Golem application: [Golem application fundamentals](https://handbook.golem.network/requestor-tutorials/golem-application-fundamentals)\n* Learn about preparing your own Docker-like images for the [VM runtime](https://handbook.golem.network/requestor-tutorials/vm-runtime)\n* Write your own app with yapapi:\n  * [Task Model development](https://handbook.golem.network/requestor-tutorials/task-processing-development)\n  * [Service Model development](https://handbook.golem.network/requestor-tutorials/service-development)\n\n## Environment variables\n\nIt's possible to set various elements of `yagna` configuration through environment variables.\n`yapapi` currently supports the following environment variables:\n\n* `YAGNA_ACTIVITY_URL`, URL to `yagna` activity API, e.g. `http://localhost:7500/activity-api/v1`\n* `YAGNA_API_URL`, base URL to `yagna` REST API, e.g. `http://localhost:7500`\n* `YAGNA_APPKEY`, `yagna` app key to be used, e.g. `a70facb9501d4528a77f25574ab0f12b`\n* `YAGNA_MARKET_URL`, URL to `yagna` market API, e.g. `http://localhost:7500/market-api/v1`\n* `YAGNA_PAYMENT_NETWORK`, Ethereum network name for `yagna` to use, e.g. `rinkeby`\n* `YAGNA_PAYMENT_DRIVER`, payment driver name for `yagna` to use, e.g. `erc20`\n* `YAGNA_PAYMENT_URL`, URL to `yagna` payment API, e.g. `http://localhost:7500/payment-api/v1`\n* `YAGNA_NET_URL`, URL to `yagna` net APU, e.g. `http://localhost:7500/net-api/v1`\n* `YAGNA_SUBNET`, name of the `yagna` sub network to be used, e.g. `public`\n* `YAPAPI_USE_GFTP_CLOSE`, if set to a _truthy_ value (e.g. \"1\", \"Y\", \"True\", \"on\") then `yapapi`\n  will ask `gftp` to close files when there's no need to publish them any longer. This may greatly\n  reduce the number of files kept open while `yapapi` is running but requires `yagna`\n  0.7.3 or newer, with older versions it will cause errors.\n",
    "bugtrack_url": null,
    "license": "LGPL-3.0-or-later",
    "summary": "High-level Python API for the New Golem",
    "version": "0.13.0",
    "project_urls": {
        "Documentation": "https://yapapi.readthedocs.io/en/stable/api.html",
        "Homepage": "https://github.com/golemfactory/yapapi",
        "Repository": "https://github.com/golemfactory/yapapi"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "48b5bb11e93da627a7895a9cea7afcdc6addd94f8507e2169ea4353a48b2d136",
                "md5": "4110f7ec312b90459818d032823e7f37",
                "sha256": "6ddcbba6dde0d98b4b0fd63516d2acb4f4be9b26c55b5789e61cf425204cb63c"
            },
            "downloads": -1,
            "filename": "yapapi-0.13.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4110f7ec312b90459818d032823e7f37",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 134794,
            "upload_time": "2024-06-04T14:40:58",
            "upload_time_iso_8601": "2024-06-04T14:40:58.420469Z",
            "url": "https://files.pythonhosted.org/packages/48/b5/bb11e93da627a7895a9cea7afcdc6addd94f8507e2169ea4353a48b2d136/yapapi-0.13.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ff8305e5f020e3df09f1a897df417bf8c6a435fcc8e16d7f8683e0a97a67bd8f",
                "md5": "7fe4bab36a380ee655e1f3fa4fb8a9b8",
                "sha256": "441a158d313b1da1c846df0c6d64115b4a24e4baf5b41c0cfb26993726f127d8"
            },
            "downloads": -1,
            "filename": "yapapi-0.13.0.tar.gz",
            "has_sig": false,
            "md5_digest": "7fe4bab36a380ee655e1f3fa4fb8a9b8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 113639,
            "upload_time": "2024-06-04T14:41:00",
            "upload_time_iso_8601": "2024-06-04T14:41:00.898029Z",
            "url": "https://files.pythonhosted.org/packages/ff/83/05e5f020e3df09f1a897df417bf8c6a435fcc8e16d7f8683e0a97a67bd8f/yapapi-0.13.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-04 14:41:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "golemfactory",
    "github_project": "yapapi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "yapapi"
}
        
Elapsed time: 0.24681s