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.3.tar.gz (5.6 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.3-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for oceanprotocol_job_details-0.2.3.tar.gz
Algorithm Hash digest
SHA256 68ff0534b4eea43b41adbaae8e9108d7d01ba1709e4de39f39becd0d2bf59c5f
MD5 80ee9d2c7d1e6e952f276053a3a29d4c
BLAKE2b-256 328b4da80ea3046f0f79a8f8e2a79d468ff247ccb1897e72d1d5287ad6fec30e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for oceanprotocol_job_details-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a6f376cca90d649c335497de4af2de247e879fbd42bb71018c780a0397dbfff7
MD5 510de7d22362f208b53829e42102206a
BLAKE2b-256 ee032c8f1a21d9a3e0d8707827653c8bf9bbab3ee7eaee8f5edffb4412d94000

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