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.job_details import OceanProtocolJobDetails

# Having no algorithm input parameters
job_details = OceanProtocolJobDetails().load()  # type: ignore

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.job_details import OceanProtocolJobDetails
from oceanprotocol_job_details.ocean import JobDetails

@dataclass
class Input:
    name: str
    age: int

job_details: JobDetails[Input] = OceanProtocolJobDetails(Input).load()

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

Assumes the following directory structure:

<ROOT_FOLDER>
└───data
    ├───ddos
    ├───transformation
    ├───inputs
    └───logs

Core functionalities

Given the Ocean Protocol job details structure as in [https://github.com/GX4FM-Base-X/pontus-x-ontology](Pontus-X Ontology), parses the passed algorithm parameters into an object to use in your algorithms.

  1. Parsing JSON
  2. Validation
  3. Metadata and service extraction

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.1.4.tar.gz (5.8 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.1.4-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for oceanprotocol_job_details-0.1.4.tar.gz
Algorithm Hash digest
SHA256 3f2ab6ec56c56bb598d80d494dca19e3fb01ce3647d60767d96a279292de8292
MD5 15b488b7922fb1bb6f7452a2d1b75ea1
BLAKE2b-256 6b250ed6daac8eede3edbeb856fec69f9641085f8e15265fdf11e3d0940b5cf3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for oceanprotocol_job_details-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 688c43f525da46074fce9008b034ac8d3d80dd0305dd3d3f742aaa0e73a2ab68
MD5 45ffa27b43cdb1dbbdadb32c4a042dd9
BLAKE2b-256 fe7ed75dfbbd2ad9901a8adecc7279bfc2beb62d15229dc8d4b6fb1f387b5051

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