Skip to main content

A Python package to get details from OceanProtocol jobs

Project description

A Python package to get details from OceanProtocol jobs


Installation

pip install oceanprotocol-job-details

Usage

As a simple library, we only need to import the main object and use it once:

from oceanprotocol_job_details import JobDetails

# Having no algorithm input parameters
job_details = JobDetails.load()

If our algorithm has custom input parameters and we want to load them into our algorithm, we can do it as follows:

from dataclasses import dataclass
from oceanprotocol_job_details import JobDetails


@dataclass
class InputParameters:
    name: str
    age: int


job_details: JobDetails[InputParameters] = JobDetails.load(InputParameters)

# Usage (is type hinted)
job_details.input_parameters.name
job_details.input_parameters.age

Assumes the directory structure of OceanProtocol algorithms.

Core functionalities

Given the Ocean Protocol job details structure, parses the passed algorithm parameters into an object to use in your algorithms.

  1. Input parameter JSON parsing and validation
  2. Metadata and service extraction from the directory structure.

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

oceanprotocol_job_details-0.2.2.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

oceanprotocol_job_details-0.2.2-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file oceanprotocol_job_details-0.2.2.tar.gz.

File metadata

File hashes

Hashes for oceanprotocol_job_details-0.2.2.tar.gz
Algorithm Hash digest
SHA256 ca717086e27c4b0c614b915418f38e61d979d17bf51e2772d099d49eb593daa0
MD5 079148f948e5d03ba87bf1154c30deac
BLAKE2b-256 69b36d62276671ea47f14d8bf36569a1fc42097c69993828a4960d117e815aa1

See more details on using hashes here.

File details

Details for the file oceanprotocol_job_details-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for oceanprotocol_job_details-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a18dfbe44cbb363a0d10e4fcc39a4a4d0fa3b625c8fc493e144820b2c9c7efc5
MD5 87a9daf0455f02a512c9346f2c51e748
BLAKE2b-256 453d7c9b4fbdce2f236c5c3212b21e13f66dc54b2737344cdf9f7b4183739c65

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