Skip to content

Commit f0bf0d0

Browse files
Merge pull request #16 from deepesdl/tejas-xxx-create-mkdocs
create mkdocs
2 parents 9e5bdd0 + 67d2faa commit f0bf0d0

File tree

10 files changed

+228
-176
lines changed

10 files changed

+228
-176
lines changed

CHANGES.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
- Prevented duplicate item and self links when updating base catalogs of workflows and
5656
experiments.
5757

58-
## Changes in 0.1.7 (in development)
58+
## Changes in 0.1.7
5959

60-
- Fixed a bug in build_child_link_to_related_experiment for the publish mode `"all"`.
60+
- Fixed a bug in build_child_link_to_related_experiment for the publish mode `"all"`.
61+
62+
## Changes in 0.1.8 (in Development)

README.md

Lines changed: 13 additions & 174 deletions
Original file line numberDiff line numberDiff line change
@@ -5,177 +5,16 @@
55
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
66
[![License](https://img.shields.io/github/license/dcs4cop/xcube-smos)](https://github.com/deepesdl/deep-code/blob/main/LICENSE)
77

8-
`deep-code` is a lightweight python tool that comprises a command line interface(CLI)
9-
and Python API providing utilities that aid integration of DeepESDL datasets,
10-
experiments with EarthCODE.
11-
12-
The first release will focus on implementing the publish feature of DeepESDL
13-
experiments/workflow as OGC API record and Datasets as an OSC stac collection.
14-
15-
## Setup
16-
17-
## Install
18-
`deep-code` will be available in PyPI for now and will be available in conda-forge
19-
in the near future. Till the stable release,
20-
developers/contributors can follow the below steps to install deep-code.
21-
22-
## Installing from the repository for Developers/Contributors
23-
24-
To install deep-code directly from the git repository, clone the repository, and execute the steps below:
25-
26-
```commandline
27-
conda env create
28-
conda activate deep-code
29-
pip install -e .
30-
```
31-
32-
This installs all the dependencies of `deep-code` into a fresh conda environment,
33-
and installs deep-code from the repository into the same environment.
34-
35-
## Testing
36-
37-
To run the unit test suite:
38-
39-
```commandline
40-
pytest
41-
```
42-
43-
To analyze test coverage
44-
```shell
45-
pytest --cov=deep-code
46-
```
47-
48-
To produce an HTML coverage report
49-
50-
```commandline
51-
pytest --cov-report html --cov=deep-code
52-
```
53-
54-
## deep_code usage
55-
56-
`deep_code` provides a command-line tool called deep-code, which has several subcommands
57-
providing different utility functions.
58-
Use the --help option with these subcommands to get more details on usage.
59-
60-
The CLI retrieves the Git username and personal access token from a hidden file named
61-
.gitaccess. Ensure this file is located in the same directory where you execute the CLI
62-
command.
63-
64-
#### .gitaccess example
65-
66-
```
67-
github-username: your-git-user
68-
github-token: personal access token
69-
```
70-
### deep-code generate-config
71-
72-
Generates starter configuration templates for publishing to EarthCODE openscience
73-
catalog.
74-
75-
#### Usage
76-
```
77-
deep-code generate-config [OPTIONS]
78-
```
79-
80-
#### Options
81-
--output-dir, -o : Output directory (default: current)
82-
83-
#### Examples:
84-
```
85-
deep-code generate-config
86-
deep-code generate-config -o ./configs
87-
```
88-
89-
### deep-code publish
90-
91-
Publishes metadata of experiment, workflow and dataset to the EarthCODE open-science
92-
catalog
93-
94-
### Usage
95-
```
96-
deep-code publish DATASET_CONFIG WORKFLOW_CONFIG [--environment ENVIRONMENT] [--mode
97-
all|dataset|workflow]
98-
```
99-
100-
#### Arguments
101-
DATASET_CONFIG - Path to the dataset configuration YAML file
102-
(e.g., dataset-config.yaml)
103-
104-
WORKFLOW_CONFIG - Path to the workflow configuration YAML file
105-
(e.g., workflow-config.yaml)
106-
107-
#### Options
108-
--dataset-config, - Explict path to dataset config
109-
--workflow-config, - Explicit path to workflow config
110-
--environment, -e - Target catalog environment:
111-
production (default) | staging | testing
112-
--mode, -m Publishing mode:
113-
all (default) | dataset | workflow
114-
115-
#### Examples:
116-
1. Publish to staging catalog
117-
```
118-
deep-code publish dataset-config.yaml workflow-config.yaml --environment=staging
119-
```
120-
2. Publish to testing catalog
121-
```
122-
deep-code publish dataset-config.yaml workflow-config.yaml -e testing
123-
```
124-
3. Publish to production catalog
125-
```
126-
deep-code publish dataset-config.yaml workflow-config.yaml
127-
```
128-
4. Publish Dataset only
129-
```
130-
deep-code publish dataset-config.yaml -m dataset
131-
132-
deep-code publish --dataset-config dataset.yaml -m dataset
133-
```
134-
5. Publish Workflow only
135-
```
136-
deep-code publish workflow-config.yaml -m workflow
137-
138-
deep-code publish --workflow-config workflow.yaml -m workflow
139-
```
140-
#### dataset-config.yaml example
141-
142-
```
143-
dataset_id: esa-cci-permafrost-1x1151x1641-1.0.0.zarr
144-
collection_id: esa-cci-permafrost
145-
osc_themes:
146-
- cryosphere
147-
osc_region: global
148-
# non-mandatory
149-
documentation_link: https://deepesdl.readthedocs.io/en/latest/datasets/esa-cci-permafrost-1x1151x1641-0-0-2-zarr
150-
access_link: s3://deep-esdl-public/esa-cci-permafrost-1x1151x1641-1.0.0.zarr
151-
dataset_status: completed
152-
```
153-
154-
dataset-id has to be a valid dataset-id from `deep-esdl-public` s3 bucket or your team
155-
bucket.
156-
157-
#### workflow-config.yaml example
158-
159-
```
160-
workflow_id: "esa-cci-permafrost"
161-
properties:
162-
title: "ESA CCI permafrost"
163-
description: "cube generation workflow for esa-cci-permafrost"
164-
keywords:
165-
- Earth Science
166-
themes:
167-
- cryosphere
168-
license: proprietary
169-
jupyter_kernel_info:
170-
name: deepesdl-xcube-1.8.3
171-
python_version: 3.11
172-
env_file: "https://github.com/deepesdl/cube-gen/blob/main/Permafrost/environment.yml"
173-
jupyter_notebook_url: "https://github.com/deepesdl/cube-gen/blob/main/Permafrost/Create-CCI-Permafrost-cube-EarthCODE.ipynb"
174-
contact:
175-
- name: Tejas Morbagal Harish
176-
organization: Brockmann Consult GmbH
177-
links:
178-
- rel: "about"
179-
type: "text/html"
180-
href: "https://www.brockmann-consult.de/"
181-
```
8+
`deep-code` is a lightweight Python CLI and API that turns DeepESDL datasets and
9+
workflows into EarthCODE Open Science Catalog metadata. It can generate starter configs,
10+
build STAC collections and OGC API records, and open pull requests to the target
11+
EarthCODE metadata repository (production, staging, or testing).
12+
13+
## Features
14+
- Generate starter dataset and workflow YAML templates.
15+
- Publish dataset collections, workflows, and experiments via a single command.
16+
- Build STAC collections and catalogs for Datasets and their corresponding variables
17+
automatically from the dataset metadata.
18+
- Build OGC API records for Workflows and Experiments from your configs.
19+
- Flexible publishling targets i.e production/staging/testing EarthCODE metadata
20+
repositories with GitHub automation.

docs/about.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# About
2+
3+
## Changelog
4+
See `CHANGES.md`.
5+
6+
## Reporting issues
7+
Open an issue at https://github.com/deepesdl/deep-code/issues.
8+
9+
## Contributions
10+
PRs are welcome. Please follow the code style (black/ruff) and add tests where relevant.
11+
12+
## Development install
13+
```bash
14+
pip install -e .[dev]
15+
pytest
16+
pytest --cov=deep-code
17+
black .
18+
ruff check .
19+
```
20+
21+
## Documentation commands (MkDocs)
22+
```bash
23+
pip install -e .[docs] # install mkdocs + theme
24+
mkdocs serve # live preview at http://127.0.0.1:8000
25+
mkdocs build # build site into site/
26+
mkdocs gh-deploy --clean # publish to GitHub Pages
27+
```
28+
29+
## License
30+
MIT License. See `LICENSE`.

docs/cli.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# CLI
2+
3+
## Generate configs
4+
Create starter templates for both workflow and dataset:
5+
6+
```bash
7+
deep-code generate-config # writes to current directory
8+
deep-code generate-config -o ./configs # custom output folder
9+
```
10+
11+
## Publish metadata
12+
Publish dataset, workflow, or both (default is both) to the target environment:
13+
14+
```bash
15+
deep-code publish dataset.yaml workflow.yaml # production (default)
16+
deep-code publish dataset.yaml workflow.yaml -e staging # staging
17+
deep-code publish dataset.yaml -m dataset # dataset only
18+
deep-code publish workflow.yaml -m workflow # workflow only
19+
deep-code publish --dataset-config ./ds.yaml --workflow-config ./wf.yaml -m all
20+
```
21+
22+
Options:
23+
- `--environment/-e`: `production` (default) | `staging` | `testing`
24+
- `--mode/-m`: `all` (default) | `dataset` | `workflow`
25+
- `--dataset-config` / `--workflow-config`: explicitly set paths and bypass auto-detection
26+
27+
## How publishing works
28+
1. Reads your configs and builds dataset STAC collections plus variable catalogs.
29+
2. Builds workflow and experiment OGC API Records.
30+
3. Forks/clones the target metadata repo (production, staging, or testing), commits generated JSON, and opens a pull request on your behalf.

docs/configuration.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Configuration
2+
3+
## Dataset config (YAML)
4+
```yaml
5+
dataset_id: your-dataset.zarr
6+
collection_id: your-collection
7+
osc_themes: [cryosphere]
8+
osc_region: global
9+
dataset_status: completed # or ongoing/planned
10+
documentation_link: https://example.com/docs
11+
access_link: s3://bucket/your-dataset.zarr
12+
```
13+
14+
## Workflow config (YAML)
15+
```yaml
16+
workflow_id: your-workflow
17+
properties:
18+
title: "My workflow"
19+
description: "What this workflow does"
20+
keywords: ["Earth Science"]
21+
themes: ["cryosphere"]
22+
license: proprietary
23+
jupyter_kernel_info:
24+
name: deepesdl-xcube-1.8.3
25+
python_version: 3.11
26+
env_file: https://example.com/environment.yml
27+
jupyter_notebook_url: https://github.com/org/repo/path/to/notebook.ipynb
28+
contact:
29+
- name: Jane Doe
30+
organization: Example Org
31+
links:
32+
- rel: about
33+
type: text/html
34+
href: https://example.org
35+
```
36+
37+
More templates and examples live in `dataset_config.yaml`, `workflow_config.yaml`, and `example-config/`.

docs/examples.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Examples
2+
3+
- Templates: `dataset_config.yaml`, `workflow_config.yaml`
4+
- Example configs: `examples/example-config/`
5+
- Notebooks on publishing: `examples/notebooks`

docs/getting-started.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Getting Started
2+
3+
When working with cloud platforms like DeepESDL, workflow outputs typically live in S3 object storage. Before the project ends or once datasets and workflows are finalized, move the datasets into the ESA Project Results Repository (PRR) and publish the workflows (Jupyter notebooks) to a publicly accessible GitHub repository. The notebook path becomes an input in the dataset config file.
4+
5+
Use the EarthCODE Project Results Repository to publish and preserve outputs from ESA-funded Earth observation projects. It is professionally maintained, FAIR-aligned, and keeps your results findable, reusable, and citable for the long term—no storage, operations, or access headaches.
6+
7+
To transfer datasets into the ESA PRR, contact the DeepESDL platform team at [[email protected]](mailto:[email protected]).
8+
9+
In the near future, `deep-code` will include built-in support for uploading your results to the ESA PRR as part of the publishing workflow, making it seamless to share your scientific contributions with the community.
10+
11+
## Requirements
12+
- Python 3.10+
13+
- GitHub token with access to the target EarthCODE metadata repo.
14+
- Input configuration files.
15+
- Datasets which needs to be published is uploaded to S3 like object storage and made publicly accessible.
16+
17+
## Install
18+
```bash
19+
pip install deep-code
20+
```
21+
22+
## Authentication
23+
The CLI or the Python API reads GitHub credentials from a `.gitaccess` file in the directory where you run the command:
24+
25+
1. **Generate a GitHub Personal Access Token (PAT)**
26+
27+
1. Navigate to GitHub → Settings → Developer settings → Personal access tokens.
28+
2. Click “Generate new token”.
29+
3. Choose the following scopes to ensure full access:
30+
- repo (Full control of repositories — includes fork, pull, push, and read)
31+
4. Generate the token and copy it immediately — GitHub won’t show it again.
32+
33+
2. **Create the .gitaccess File**
34+
35+
Create a plain text file named .gitaccess in your project directory or home folder:
36+
37+
```
38+
github-username: your-git-user
39+
github-token: your-personal-access-token
40+
```
41+
Replace your-git-user and your-personal-access-token with your actual GitHub username and token.
42+
43+

docs/index.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Overview
2+
3+
`deep-code` is a lightweight Python CLI and API that publishes DeepESDL datasets and workflows as EarthCODE Open Science Catalog metadata. It can generate starter configs, build STAC collections and OGC API records, and open pull requests to the target EarthCODE metadata repository (production, staging, or testing).
4+
5+
## Features
6+
- Generate starter dataset and workflow YAML templates.
7+
- Publish dataset collections, workflows, and experiments via a single command.
8+
- Build STAC collections and catalogs for Datasets and their corresponding variables automatically from the dataset metadata.
9+
- Build OGC API records for Workflows and Experiments from your configs.
10+
- Flexible publishling targets i.e production/staging/testing EarthCODE metadata repositories with GitHub automation.
11+
12+
```mermaid
13+
%%{init: {'flowchart': {'nodeSpacing': 110, 'rankSpacing': 160}, 'themeVariables': {'fontSize': '28px', 'lineHeight': '1.6em'}}}%%
14+
flowchart LR
15+
subgraph User
16+
A["Config files<br/>(dataset.yaml, workflow.yaml)"]
17+
B["deep-code CLI<br/>(generate-config, publish)"]
18+
end
19+
20+
subgraph App["deep-code internals"]
21+
C["Publisher<br/>(mode: dataset/workflow/all)"]
22+
D["STAC builder<br/>OscDatasetStacGenerator"]
23+
E["OGC record builder<br/>OSCWorkflowOGCApiRecordGenerator"]
24+
F["GitHubAutomation<br/>(fork, clone, branch, PR)"]
25+
end
26+
27+
subgraph Output
28+
G["Generated JSON<br/>collections, variables,<br/>workflows, experiments"]
29+
H["GitHub PR<br/>(prod/staging/testing repo)"]
30+
I["EarthCODE Open Science Catalog"]
31+
end
32+
33+
A --> B --> C
34+
C --> D
35+
C --> E
36+
D --> G
37+
E --> G
38+
G --> F --> H --> I
39+
```

0 commit comments

Comments
 (0)