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

# Using default parameters
job_details = OceanProtocolJobDetails().load()

Assumes the following directory structure:

<ROOT_FOLDER>
└───data
    ├───ddos
    ├───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

Advanced Usage (not recommended)

If instead of the environment variables, we want to use another kind of mapping, can pass it as a parameter and it will work as long as it has the same key values (Can be implemented in a more generic way, but there is no need right now).

from oceanprotocol_job_details.job_details import OceanProtocolJobDetails
from oceanprotocol_job_details.loaders.impl.environment import Keys

# Fill in with values that will be used instead of env
custom_mapper = {
    Keys.ROOT_FOLDER: " ... ", # Use when you don't want the algorithm to take '/' as base Path
    Keys.ALGORITHM: " ... ",
    Keys.DIDS: " ... ",
    Keys.SECRET: " ... ",
}

job_details = OceanProtocolJobDetails(mapper=custom_mapper).load()

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.0.12.tar.gz (6.0 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.0.12-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for oceanprotocol_job_details-0.0.12.tar.gz
Algorithm Hash digest
SHA256 a89c381e99afa8efc9e005fc2a8506cb28e30d5956bd10e45a74e0309fcc99b5
MD5 617239fa23e39592d9fb51902e306690
BLAKE2b-256 4c19b61e1323f6fb09cb617483375a0c8dff276f6b5913f3028e4aa41ca62455

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for oceanprotocol_job_details-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 4d6e78b637938103f831a002ee2b5ac0c90f2ad65d9871a8dfaaeba8c7b23839
MD5 024216de3eb871ee3e66e6c42f7f268b
BLAKE2b-256 2339e927c91b4ce7764d1839f2253fe1455f14f2192dc87e23ca90f3c9db3ef0

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