Skip to main content

logo

OGC Application Package Generator

This repository contains a library for the generation an OGC complaint application package from a Jupyter Notebook by parsing its contents and metadata. 

This library serves as a base upon which to build project specific application generation software. For example the Unity Project uses this libary for their Unity specific application genetation software.

mdps-app-generator | unity-example-application

Features

  • Extracts information from application Git repositorties for metadata reporting
  • Creates an algorithm descriptor file that can be used by an OGC compliant ADES server
  • Creates Common Workflow Language (CWL) files that expose the notebook's arguments
  • Creates a Docker image called by the CWL file to execute parsed notebook applications

Install from PyPi

pip install ogc-ipynb-app-gen

Preparing Your repository

Any application repository used by this library must:

  1. Contain an valid Jupyter notebook which can be run using papermill
  2. Contain a valid configuration file for repo2docker (generally an environment.yml or requirements.txt)

NOTE: papermill is required to listed as a dependencies in your configuration file.

By default repo2docker will a certain version of Python, currently Python 3.8. Be sure to provied a runtime.txt configuration file to specify a different version if your packages require it.

Preparing Your Notebook

In your Jupyter notebook file, the input parameters will be automatically determined from a code cell in the notebook annotated with the parameters tag. An attempt is made to automatically detect the type of the parameters. When that fails, type can be specified through a type hint in the form of a comment following the variable in the form # type: <type_name>. See below for examples:

example_argument_int = 1
example_argument_float = 1.0
example_argument_string = "string"
example_argument_bool = True
example_argument_empty = None # type: string Allow a null value or a string

Not that a comment can still be provided but it must be given after the type name. If a value is specified with the None it will be come an Any type inside of the generated CWL unless a type hint is provided. Parameters like the above are passed to the generated CWL through a parameters block in the CWL job input file. For example, the following YAML would be part of the job input file for the above parameters:

parameters:
    example_argument_string: "string"
    example_argument_int: 1
    example_argument_float: 1.0
    example_argument_empty: "Not null string"
    example_argument_bool: True

If any of the values in the CWL job input file are given as null then the default value inside the notebook will be used.

Two special type hints are used to connect inputs and outputs into the generated CWL file from the ADES processing system. These hints are given by the stage-in and stage-out type hints:

input_stac_collection_file = 'test/stage_in/stage_in_results.json' # type: stage-in
output_stac_catalog_dir    = 'process_results/'                    # type: stage-out

The stage-in variable will be passed a filename to either a STAC Collection file or a STAC Catalog file. The data staged for the application will be located in the same directory as the file. It is recommended to use the Unity-Py Collection.from_stac method as illustrated in the unity-example-application. This method will automatically detect the type of file being passed and handle them both seemlessly.

The stage-out variable will be passed path to the location where a STAC Catalog file should be written along with any output data. Application results must be located in this directory for them to be properly staged. Again, please follow the example in the unity-example-application archive for using Unity-Py to write such a catalog.

If either or both stage-in and stage-out variables are omitted from the notebook then the related CWL file will not be produced.

License

See our: LICENSE

Metadata

Release files for ogc-ipynb-app-gen 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ogc-ipynb-app-gen 1.2.1
File Size Uploaded Provenance Actions
ogc_ipynb_app_gen-1.2.1.tar.gz 24.0 kB Without provenance Details for ogc_ipynb_app_gen-1.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ogc-ipynb-app-gen 1.2.1
File Interpreter ABI Platform Actions
ogc_ipynb_app_gen-1.2.1-py3-none-any.whl Python 3 none any Details for ogc_ipynb_app_gen-1.2.1-py3-none-any.whl

Total release size: 62.4 kB

Release files / ogc_ipynb_app_gen-1.2.1.tar.gz

Download URL ogc_ipynb_app_gen-1.2.1.tar.gz
Size 24.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1143b2011158de18ef72eee201b8a80f220c96a31e08eaf1af4bc983f4fd0b30
BLAKE2b-256 checksum
How to use checksums
3033ee52a4a6d5096f4ba4f8e7a023299c68dfa0a7e34c1ac329ca16a8b64f59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / ogc_ipynb_app_gen-1.2.1-py3-none-any.whl

Download URL ogc_ipynb_app_gen-1.2.1-py3-none-any.whl
Size 38.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
62393cf88a032abd64c73322079ead1ac4cd96e3c8144b777d91a0365fbe9a9a
BLAKE2b-256 checksum
How to use checksums
5bc60a51daffd546155175e23b60a34fe507e19ddbc60a495bc751be7841dbeb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Security for ogc-ipynb-app-gen 1.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.2.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page