Metadata-Version: 2.5
Name: openghg
Version: 0.20.0
Summary: OpenGHG: A platform for greenhouse​ gas data analysis
Project-URL: Documentation, https://www.openghg.org
Project-URL: Code, https://github.com/openghg/openghg
Project-URL: Issue-Tracker, https://github.com/openghg/openghg/issues
Author-email: Prasad Sutar <prasad.sutar@bristol.ac.uk>, Brendan Murphy <brendan.murphy@bristol.ac.uk>, Rachel Tunnicliffe <rachel.tunnicliffe@bristol.ac.uk>, Gareth Jones <g.m.jones@bristol.ac.uk>
Maintainer-email: Prasad Sutar <prasad.sutar@bristol.ac.uk>, Brendan Murphy <brendan.murphy@bristol.ac.uk>, Rachel Tunnicliffe <rachel.tunnicliffe@bristol.ac.uk>
License-File: LICENSE
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: <3.15,>=3.11
Requires-Dist: addict<=2.4.0
Requires-Dist: attrs>=22
Requires-Dist: cdsapi>=0.7.7
Requires-Dist: cf-xarray<=0.11.3
Requires-Dist: dask<2026.9
Requires-Dist: filelock<=4.2.12
Requires-Dist: flox<=0.11.2
Requires-Dist: h5netcdf<=1.8.3,>=1.8.0
Requires-Dist: h5py<3.17
Requires-Dist: icoscp<=0.2.3
Requires-Dist: ipykernel>=6.29.5
Requires-Dist: ipywidgets<=8.1.9
Requires-Dist: kaleido>=1.3.0
Requires-Dist: matplotlib<=3.11.2
Requires-Dist: msgpack-types<=0.8.0
Requires-Dist: msgpack<=1.2.4
Requires-Dist: nbformat<=5.11.1
Requires-Dist: nc-time-axis<=1.4.1
Requires-Dist: netcdf4<=1.7.5.1.post1,>=1.6.0
Requires-Dist: networkx<=3.6.1
Requires-Dist: numcodecs<0.17,>=0.16
Requires-Dist: numexpr<=2.14.2
Requires-Dist: numpy<=2.4.6,>=2.0
Requires-Dist: openghg-calscales<=0.1.3
Requires-Dist: openghg-defs>=0.0.14
Requires-Dist: openpyxl<=3.1.5
Requires-Dist: pandas<=3.1.1,>=2.0
Requires-Dist: pint-xarray<=0.6.1
Requires-Dist: pint<=0.25.3
Requires-Dist: plotly<=7.1.0
Requires-Dist: pre-commit>=4.6.0
Requires-Dist: pytest-mock>=3.15.1
Requires-Dist: pytest>=7.0.0
Requires-Dist: pyvis<=0.3.2
Requires-Dist: rapidfuzz<=3.14.6
Requires-Dist: requests<=2.34.2
Requires-Dist: rich<=15.0.0
Requires-Dist: scipy<=1.17.1
Requires-Dist: sympy<=1.14.0
Requires-Dist: tinydb<=4.9.0
Requires-Dist: toml<=0.10.2
Requires-Dist: urllib3>=1.26.3
Requires-Dist: xarray-validate==0.0.5
Requires-Dist: xarray<=2026.9.0,>=2025.9.1
Requires-Dist: zarr<=3.4.1,>=3.1.6
Provides-Extra: dev
Requires-Dist: cfchecker; extra == 'dev'
Requires-Dist: mypy==2.4.1; extra == 'dev'
Requires-Dist: pre-commit<=4.7.0; extra == 'dev'
Requires-Dist: pytest-cov<=7.1.0; extra == 'dev'
Requires-Dist: pytest-mock<=3.17.0; extra == 'dev'
Requires-Dist: pytest-timeout<3.0.0,>=2.4.0; extra == 'dev'
Requires-Dist: pytest-tornasync<=0.6.0.post2; extra == 'dev'
Requires-Dist: pytest<=9.2.0,>=7.0.0; extra == 'dev'
Requires-Dist: requests-mock<=1.12.1; extra == 'dev'
Requires-Dist: ruff==0.17.6; extra == 'dev'
Requires-Dist: tox<=4.67.15; extra == 'dev'
Requires-Dist: types-paramiko<=5.1.0.20261030; extra == 'dev'
Requires-Dist: types-pyyaml<=6.0.12.20261113; extra == 'dev'
Requires-Dist: types-requests<=2.33.0.20261030; extra == 'dev'
Requires-Dist: types-toml<=0.10.8.20260518; extra == 'dev'
Requires-Dist: types-urllib3; extra == 'dev'
Provides-Extra: doc
Requires-Dist: docutils<=0.23; extra == 'doc'
Requires-Dist: ipython<=9.18.1; extra == 'doc'
Requires-Dist: jinja2; extra == 'doc'
Requires-Dist: jupyter-client<=8.10.0; extra == 'doc'
Requires-Dist: jupyter-core<=5.9.1; extra == 'doc'
Requires-Dist: jupyter-sphinx; extra == 'doc'
Requires-Dist: myst-parser<=5.2.0; extra == 'doc'
Requires-Dist: nbconvert<=7.17.2; extra == 'doc'
Requires-Dist: nbsphinx<=0.9.8; extra == 'doc'
Requires-Dist: notebook; extra == 'doc'
Requires-Dist: pydata-sphinx-theme<=0.24.0; extra == 'doc'
Requires-Dist: sphinx; extra == 'doc'
Requires-Dist: sphinx-autobuild<=2025.8.25; extra == 'doc'
Requires-Dist: sphinx-autodoc-typehints; extra == 'doc'
Requires-Dist: sphinx-copybutton<=0.5.2; extra == 'doc'
Requires-Dist: sphinx-issues<=6.0.0; extra == 'doc'
Requires-Dist: sphinx-rtd-theme<3.2.0; extra == 'doc'
Requires-Dist: sphinx-togglebutton; extra == 'doc'
Requires-Dist: sphinxcontrib-bibtex<=2.7.0; extra == 'doc'
Requires-Dist: sphinxcontrib-mermaid<=2.1.1; extra == 'doc'
Requires-Dist: sphinxcontrib-programoutput; extra == 'doc'
Provides-Extra: fp-x-flux
Requires-Dist: numba>=0.59; extra == 'fp-x-flux'
Description-Content-Type: text/markdown

![OpenGHG logo](https://github.com/openghg/logo/raw/main/OpenGHG_Logo_Landscape.png)

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

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ![OpenGHG tests](https://github.com/openghg/openghg/workflows/OpenGHG%20tests/badge.svg?branch=master)

OpenGHG is a platform for collaboration and analysis of greenhouse gas (GHG) data, inspired by the [HUGS platform](https://github.com/hugs-cloud/hugs). It allows researchers to analyze and collaborate on large datasets using the scalability of the cloud.

For more information, please visit [our documentation](https://docs.openghg.org/).

---

## 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:

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

If `curl` is unavailable, use `wget`:

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

On macOS with Homebrew:

```bash
brew install pixi
```

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

```bash
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:

```bash
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 link`uv` (Recommended "robust, Python-independent"):
   - macOS/Linux:
     ```bash
     curl -LsSf https://astral.sh/uv/install.sh | sh
     ```

   2. Install from pip (Alternative "requires existing Python + pip"):
      ```bash
      pip install uv
      ```

2. **Create and activate an environment for OpenGHG:**
   ```bash
   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.
   ```bash
   uv venv openghg-env --python 3.12
   ```
   To activate:
   ```bash
   source openghg-env/bin/activate
   ```

3. **Install OpenGHG:**
   ```bash
   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:**
   ```bash
   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:**
   ```bash
   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:
```bash
openghg --quickstart
```

### Configure via Python:
```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:**
   ```bash
   git clone https://github.com/openghg/openghg.git
   cd openghg
   ```

2. **Install the development environment:**
   ```bash
   pixi install -e dev
   ```

   This installs the local OpenGHG repository in editable mode.

3. **Run checks:**
   ```bash
   pixi run -e dev test-storage
   pixi run -e dev lint
   ```

### Using `uv` for Development

1. **Clone the repository:**
   ```bash
   git clone https://github.com/openghg/openghg.git
   cd openghg
   ```

2. **Create and activate an environment for OpenGHG:**
   ```bash
   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.
   ```bash
   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:
      ```bash
      source .venv/bin/activate
      ```

3. **Install development dependencies and the package in editable mode:**
   ```bash
   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`:
   ```bash
   uv run python --version
   uv run pytest -v tests/
   ```

   For more details, please refer to the [UV Documentation (sync)](https://docs.astral.sh/uv/concepts/projects/sync/#syncing-the-environment).

### Using `conda` for Development

1. **Clone the repository:**
   ```bash
   git clone https://github.com/openghg/openghg.git
   cd openghg
   ```

2. **Create and activate a `conda` environment:**
   ```bash
   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:**
   ```bash
   pip install --upgrade pip wheel setuptools
   pip install -e ".[dev]"
   ```

---

### Building the Documentation

The [local documentation build guide](doc/source/development/python_devel.rst#documentation) 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:

```bash
# 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:

```bash
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:
   ```bash
   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:
   ```bash
   uv run pytest -v --run-icos tests/
   ```

If you encounter issues, please [open a GitHub issue](https://github.com/openghg/openghg/issues/new).

---

## 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:
  ```bash
  uv add xesmf

- For conda install of xesmf
  ```bash
  conda install -c conda-forge xesmf

For further details, refer to [our documentation](https://docs.openghg.org/).

---

## Community and Contributions

We encourage contributions and are happy to assist where needed. Raise issues and pull requests in [our repository](https://github.com/openghg/openghg).

For further information, check out [our documentation](https://docs.openghg.org/).
