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.
- Parsing JSON
- Validation
- Metadata and service extraction
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file oceanprotocol_job_details-0.1.1.tar.gz.
File metadata
- Download URL: oceanprotocol_job_details-0.1.1.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07e714fa7aa57a4260a7250e2ec9abe9bc7143edca7aa712295e98312a03dcc7
|
|
| MD5 |
ad0526ee5c943449db96f47d5a4e4c96
|
|
| BLAKE2b-256 |
c3ef879a4bbcf8ab73b08855860f550396a0e80d88403dfe067a209854f7b133
|
File details
Details for the file oceanprotocol_job_details-0.1.1-py3-none-any.whl.
File metadata
- Download URL: oceanprotocol_job_details-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df6334cdfd9bc9b872e0fc1fae498984aec9d1db0403224201b11f9d6591557b
|
|
| MD5 |
1f1b951ffb2cb9f5be2f3a3f504783c2
|
|
| BLAKE2b-256 |
b6a564b9b5b17dba58015c85bf5b9eab2cf3db4113e3b11b159eb6d16438d928
|