Metadata-Version: 2.4
Name: ogc-edr-profile
Version: 1.0.0
Summary: Authoritative tooling for creating OGC API - EDR Part 3 Service Profiles
Author-email: Shane Mill <shane.mill@noaa.gov>
License: Apache License
        Version 2.0, January 2004
        http://www.apache.org/licenses/
        
        Copyright 2025 NOAA/NWS/Meteorological Development Laboratory
        
        Licensed under the Apache License, Version 2.0 (the "License");
        you may not use this file except in compliance with the License.
        You may obtain a copy of the License at
        
            http://www.apache.org/licenses/LICENSE-2.0
        
        Unless required by applicable law or agreed to in writing, software
        distributed under the License is distributed on an "AS IS" BASIS,
        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
        See the License for the specific language governing permissions and
        limitations under the License.
        
Project-URL: Homepage, https://github.com/ShaneMill1/OGC-Service-Profile-Creation
Project-URL: Issues, https://github.com/ShaneMill1/OGC-Service-Profile-Creation/issues
Keywords: ogc,edr,environmental-data-retrieval,profile,openapi
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: GIS
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: edr-pydantic>=0.3
Requires-Dist: pydantic>=2.0
Requires-Dist: pyyaml>=6.0
Dynamic: license-file

# OGC API - EDR Part 3 Service Profile Generator

Authoritative tooling for creating OGC API - Environmental Data Retrieval (EDR) Part 3 Service Profiles, built on Pydantic.

## Overview

Profile structure is defined as Pydantic models (`src/models.py`). Instantiating a `ServiceProfile` validates the entire profile — enums enforce normative OGC values, cross-model validators catch referential errors — before any files are written.

## Repository Structure


```
├── src/
│   ├── models.py     # Authoritative Pydantic schema (ServiceProfile, Collection, Requirement, etc.)
│   ├── generate.py   # Serialization: validated model → OpenAPI, AsyncAPI, AsciiDoc
│   └── cli.py        # CLI entry point
├── examples/
│   └── water_gauge.yaml  # Example profile config
└── requirements.txt
```


## Installation

```bash
pip install -r requirements.txt
```

## Usage

Define your profile in YAML or JSON, then generate:

```bash
python src/cli.py --config examples/water_gauge.yaml --output ./my_profile
```

### Output

```
my_profile/
├── openapi.yaml
├── asyncapi.yaml                        # if pubsub is configured
├── profile_config.json                  # round-trip model export
├── requirements/
│   ├── requirements_class_core.adoc
│   └── core/REQ_<id>.adoc
└── abstract_tests/
    ├── ATS_class_core.adoc
    └── core/ATS_<id>.adoc
```

## Profile Config Schema

Key fields in your YAML/JSON config:

| Field | Type | Description |
|---|---|---|
| `name` | `string` | Lowercase identifier, e.g. `water_gauge` |
| `title` | `string` | Human-readable profile title |
| `collections` | `list` | One or more EDR collections |
| `collections[].query_types` | `enum[]` | `items`, `position`, `area`, `radius`, `cube`, `trajectory`, `corridor`, `locations`, `instances` |
| `collections[].output_formats` | `enum[]` | `GeoJSON`, `CoverageJSON`, `CSV`, `NetCDF`, `GRIB`, `Zarr` |
| `requirements` | `list` | Normative requirements |
| `abstract_tests` | `list` | Conformance tests (each must reference a valid requirement id) |
| `pubsub` | `object` | Optional OGC API - EDR Part 2 PubSub config (AMQP/MQTT/Kafka) |

See [`examples/water_gauge.yaml`](examples/water_gauge.yaml) for a complete example.

## Programmatic Use

```python
from src.models import ServiceProfile
from src.generate import generate
from pathlib import Path

profile = ServiceProfile.model_validate_json(open("my_profile.json").read())
generate(profile, Path("./output"))
```

## Standards

- OGC API - EDR Part 1: Core
- OGC API - EDR Part 2: PubSub
- OGC API - EDR Part 3: Service Profiles (draft)
- OpenAPI 3.0 / AsyncAPI 3.0
- Metanorma/AsciiDoc documentation format

## License

Apache License 2.0 — See [LICENSE](LICENSE) for details.

## Contact

- **Author**: Shane Mill (NOAA/NWS/MDL)
- **Email**: shane.mill@noaa.gov
- **Issues**: https://github.com/ShaneMill1/OGC-Service-Profile-Creation/issues
