Metadata-Version: 2.4
Name: oceanprotocol-job-details
Version: 0.2.2
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
Requires-Dist: dependency-injector>=4.48.2
Requires-Dist: orjson>=3.11.3
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 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:

```Python

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
1. Metadata and service extraction from the directory structure.
