Skip to main content

Create OGC Earth Observation Application Packages from Jupyter notebooks

Project description

tests codecov docs

xcengine: turn Jupyter notebooks into Application Packages

xcengine provides tools to convert a Jupyter notebook into one of several parameterized, headlessly runnable forms:

Documentation

Documentation is hosted at https://xcube-dev.github.io/xcengine/.

Defining parameters in a notebook

xcengine uses the same convention as papermill for defining parameters in a notebook. All parameters should be set as Python variables in the same notebook code cell, and that cell should be designated as the parameter cell by giving it the tag parameters. In JupyterLab, you can do this using the property inspector (⚙⚙ icon in the right sidebar). See the papermill documentation for more details.

During conversion, xcetool will detect any variables that are set in the parameters cell and make them available as command-line parameters for the output script and container, and as workflow parameters for the application package.

Customizing output formats

An xcengine-generated script or image can automatically write all xarray.Dataset objects from the notebook code to disk, for example to be staged out as EO Application Package outputs. By default, Zarr format is used, but this can be changed to NetCDF on a per-dataset basis by applying an attribute:

my_dataset.attrs["xcengine_output_format"] = "netcdf"

xcetool usage

xcengine provides a command-line tool called xcetool, which has several subcommands for different functions. Use the --help option with these subcommands to get more details on usage.

xcetool make-script

Convert a Jupyter notebook to a non-interactive Python script.

xcetool image build

Convert a Jupyter notebook to a Docker container image. This subcommand can additionally produce a Common Workflow Language (CWL) file defining an OGC Earth Observation Application Package which uses the container image.

xcetool image run

Run a Docker container using an image converted from a Jupyter notebook.

Acknowledgements

xcengine was developed as part of the Open-Earth-Monitor Cyberinfrastructure project, which has received funding from the European Union's Horizon Europe research and innovation programme under grant agreement No. 101059548.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xcengine-0.1.2.tar.gz (26.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xcengine-0.1.2-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file xcengine-0.1.2.tar.gz.

File metadata

  • Download URL: xcengine-0.1.2.tar.gz
  • Upload date:
  • Size: 26.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for xcengine-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d49754013cbba39b67bc6f537e79505cd3f7a3f4a526370635b3fffafe46cf53
MD5 eed8d1c9eae5b59bacc2c783745d34c7
BLAKE2b-256 12f006f648eddfbffdc235f88151fa842fa8575d0d21441b0abeae66e4734cf6

See more details on using hashes here.

File details

Details for the file xcengine-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: xcengine-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for xcengine-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4c264e0d39d175e70aefc2f245f966ffe81a3eaff5ae8cc1079bf2304519cc5c
MD5 1b04b1a45a9a60e7a8d1f31c549c2b75
BLAKE2b-256 fd5dc1daa875196d79bdc1f7a8e27cfb7b9c97d473c2601c9e3b57d68f018818

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page