Skip to main content

OpenGHG logo

OpenGHG - a Cloud Platform for Greenhouse Gas Data Analysis and Collaboration

License OpenGHG tests

OpenGHG is a platform for collaboration and analysis of greenhouse gas (GHG) data, inspired by the HUGS platform. It allows researchers to analyze and collaborate on large datasets using the scalability of the cloud.

For more information, please visit our documentation.


Install OpenGHG

OpenGHG supports Python 3.11 through 3.14 on Linux or MacOS (Python 3.13 is the recommended version). To install the released package, you can use uv or conda. For development installs from a local checkout, you can also use pixi.

Installing with Pixi for development

OpenGHG reads and writes NetCDF/HDF5 data through xarray, h5netcdf, h5py, netcdf4, and zarr. The Pixi environment in this repository installs the compiled scientific, HDF5, and NetCDF stack from conda-forge and installs the local OpenGHG checkout in editable mode.

Install Pixi directly with one of the following commands.

On macOS or Linux, use the official installer:

curl -fsSL https://pixi.sh/install.sh | sh

If curl is unavailable, use wget:

wget -qO- https://pixi.sh/install.sh | sh

On macOS with Homebrew:

brew install pixi

Then create the editable OpenGHG development environment from a cloned checkout:

git clone https://github.com/openghg/openghg.git
cd openghg
pixi install -e dev
pixi run -e dev python -c "import openghg, h5py, h5netcdf, netCDF4, xarray, zarr"

Useful development commands:

pixi run -e dev test
pixi run -e dev test-storage
pixi run -e dev lint
pixi run -e dev typecheck

Do not run commands such as pip install -U h5py h5netcdf netcdf4 inside the Pixi environment. That can replace Pixi's conda-forge HDF5/NetCDF packages with PyPI wheels and reintroduce binary incompatibilities.

Installing with uv

uv simplifies environment creation and dependency management, making it easy to manage your setup. To install OpenGHG using uv:

  1. Install uv:

    The uv tool from Astral streamlines Python management, virtual environments, and package installation. Follow the recommended steps from the official uv docs:

    1. Install from linkuv (Recommended "robust, Python-independent"):
    • macOS/Linux:
      curl -LsSf https://astral.sh/uv/install.sh | sh
      
    1. Install from pip (Alternative "requires existing Python + pip"):
      pip install uv
      
  2. Create and activate an environment for OpenGHG:

    uv venv openghg-env --python 3.13
    

    Python 3.13 is the recommended version. Additionally, any supported python version (3.11-3.14) can be specified while creating the environment as follows.

    uv venv openghg-env --python 3.12
    

    To activate:

    source openghg-env/bin/activate
    
  3. Install OpenGHG:

    uv pip install openghg
    

This installs OpenGHG and its core dependencies.

Installing with conda

To get OpenGHG installed using conda, follow these steps:

  1. Create and activate a conda environment:

    conda create --name openghg_env python=3.13
    conda activate openghg_env
    

    Python 3.13 is the recommended version. Any supported python version (3.11-3.14) can be used instead.

  2. Install OpenGHG and its dependencies using the conda-forge and openghg channels:

    conda install --channel conda-forge --channel openghg openghg
    

Note: The optional xesmf library is pre-installed when using conda. No additional steps are required for regridding functionality.


Quickstart Configuration

Once OpenGHG is installed, you need to configure the object store and user data. OpenGHG stores its configuration file by default at: ~/.config/openghg/openghg.conf.

Configure via CLI:

openghg --quickstart

Configure via Python:

from openghg.util import create_config

create_config()

When prompted, you can specify the path to the object store. Leave the field blank to use the default directory at ~/openghg_store.


Developers

If you'd like to contribute to OpenGHG, here are the steps to set up a development environment. Pixi is recommended when working with NetCDF, HDF5, or Zarr data because it keeps the compiled data stack on conda-forge. You can also use uv or conda.

Using Pixi for Development

  1. Clone the repository:

    git clone https://github.com/openghg/openghg.git
    cd openghg
    
  2. Install the development environment:

    pixi install -e dev
    

    This installs the local OpenGHG repository in editable mode.

  3. Run checks:

    pixi run -e dev test-storage
    pixi run -e dev lint
    

Using uv for Development

  1. Clone the repository:

    git clone https://github.com/openghg/openghg.git
    cd openghg
    
  2. Create and activate an environment for OpenGHG:

    export UV_PYTHON=3.13
    uv venv --python 3.13
    

    Python 3.13 is the recommended version. A python environment with name can also be created, as showed in non-developer instance previously. Additionally, any supported python version (3.11-3.14) can be specified while creating the environment as follows. Keep UV_PYTHON set when running subsequent uv sync and uv run commands so that uv continues to use the selected version; substitute 3.11 if that is your chosen version.

    export UV_PYTHON=3.12
    uv venv --python 3.12
    

    Note: If the virtual environment is not named, the .venv folder is created at the directory level, and using commands like "uv add" or "uv pip install" will automatically detect the environment and install the packages.

    To activate:

    source .venv/bin/activate
    
  3. Install development dependencies and the package in editable mode:

    uv sync --all-extras
    

    This installs the local checkout in editable mode with the development and documentation dependencies. For a runtime-only checkout on the recommended Python version, run uv sync --locked --python 3.13.

    Run development commands through uv so that their executables and dependencies always come from the project's .venv, even if another environment (for example, Conda or Homebrew Python) is also on PATH:

    uv run python --version
    uv run pytest -v tests/
    

    For more details, please refer to the UV Documentation (sync).

Using conda for Development

  1. Clone the repository:

    git clone https://github.com/openghg/openghg.git
    cd openghg
    
  2. Create and activate a conda environment:

    conda create --name openghg-dev python=3.13
    conda activate openghg-dev
    

    Python 3.13 is the recommended version. Any supported Python version (3.11–3.14) can be used instead.

  3. Install development dependencies:

    pip install --upgrade pip wheel setuptools
    pip install -e ".[dev]"
    

Building the Documentation

The local documentation build guide explains how to install the docs extra with uv, run make -C doc html, and preview doc/build/html/index.html.

Running Tests

OpenGHG uses pytest for testing. After setting up the development environment, you can run tests as follows:

# uv
uv run pytest -v tests/

# Pixi
pixi run -e dev test

# An activated conda or Python virtual environment
python -m pytest -v tests/

Using uv run or python -m pytest prevents a pytest executable from a different Python installation from being selected. You can confirm the Python used by uv with:

uv run python --version

Additional Testing:

The examples below use the uv environment. When using Pixi or an activated Conda/virtual environment, use the corresponding invocation shown above.

  • CF Checker Tests: Install the udunits2 library for certain tests:

    sudo apt-get install libudunits2-0
    uv run pytest -v --run-cfchecks tests/
    
  • ICOS Tests: These tests access the ICOS Carbon Portal and should be run sparingly:

    uv run pytest -v --run-icos tests/
    

If you encounter issues, please open a GitHub issue.


Additional Functionality

OpenGHG's optional functionality includes the xesmf module for map regridding.

Note that xesmf is not installed by default with the core OpenGHG package.

  • When using uv, install it explicitly, for example:
    uv add xesmf
    
  • For conda install of xesmf
    conda install -c conda-forge xesmf
    

For further details, refer to our documentation.


Community and Contributions

We encourage contributions and are happy to assist where needed. Raise issues and pull requests in our repository.

For further information, check out our documentation.

Metadata

Release files for openghg 0.20.0

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

Source distribution (sdist)

Source distribution for openghg 0.20.0
File Size Uploaded Provenance Actions
openghg-0.20.0.tar.gz 409.3 kB Without provenance Details for openghg-0.20.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for openghg 0.20.0
File Interpreter ABI Platform Actions
openghg-0.20.0-py3-none-any.whl Python 3 none any Details for openghg-0.20.0-py3-none-any.whl

Total release size: 917.8 kB

Release files / openghg-0.20.0.tar.gz

Download URL openghg-0.20.0.tar.gz
Size 409.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8789b515c34da9179b2fa8326282ae2e614f7aaa5a4c4f733139345816fce70b
BLAKE2b-256 checksum
How to use checksums
8541047e77bb884ff9112aa74ae70c1e59e1c7698fb9a4da42655426c46ee3ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / openghg-0.20.0-py3-none-any.whl

Download URL openghg-0.20.0-py3-none-any.whl
Size 508.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e7251f124f235d7bf50d01edf7b85a948bd83d4e544e48efe9817dfd4ec31b5e
BLAKE2b-256 checksum
How to use checksums
69c7b37a23eb6d3ac516e57c24c9629fd8bbc4e4ef2839fc1ea203642ac828b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for openghg 0.20.0

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

0.20.0 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