Metadata-Version: 2.4
Name: oceanprotocol-job-details
Version: 0.1.4
Summary: A Python package to get details from OceanProtocol jobs
Project-URL: Homepage, https://github.com/AgrospAI/oceanprotocol-job-details
Project-URL: Issues, https://github.com/AgrospAI/oceanprotocol-job-details/issues
Author-email: Christian López García <christian.lopez@udl.cat>
License: Copyright 2025 Agrospai
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Requires-Dist: dataclasses-json>=0.6.7
Description-Content-Type: text/markdown

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:

```Python
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:

```Python

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
1. Validation
1. Metadata and service extraction
