Useful links: Installation | Source Repository | Issue Tracker | Q&A Support | Slack Channel

PyPI Conda PyPI - Python Version Binder

GitHub Workflow Status Documentation Status pre-commit.ci status

Xpublish is#

A quick way to serve a single Xarray dataset over HTTP using FastAPI

Get started with ds.rest.serve() to explore serving data with Xpublish

An extendable core of a dataset server

By building a server based around Xarray datasets, we can build on top of the rapid progress of Xarray and the greater PyData ecosystem.

A community and ecosystem of plugins, servers, and their builders and users

Explore the Xpublish ecosystem.

I want to#

Getting started

New to Xpublish? Check out the getting started guides. They contain an introduction to Xpublish’s main concepts.

User guide

The user guide contains in-depth information on the key concepts of Xpublish with useful background information and explanation.

API Reference

The reference guide contains a detailed description of the Xpublish API/ The reference describes how the methods work and which parameters can be used. It assumes that you have an an understanding of the key concepts.

Developer guide

Saw a typo in the documentation? Want to improve existing functionalities? The contributing guidelines will guide you through the process of improving Xpublish.

A quick intro#

You can run a short example application in a live session here: Binder

On the server-side, one or more datasets can be published using the xpublish.Rest class or the xarray.Dataset.rest accessor, e.g.,

ds.rest.serve(host="", port=9000)

The published datasets can be accessed from various kinds of client applications, e.g., from within Python using Zarr and fsspec.

import xarray as xr
import zarr
from fsspec.implementations.http import HTTPFileSystem

fs = HTTPFileSystem()
http_map = fs.get_mapper("")

# open as a zarr group
zg = zarr.open_consolidated(http_map, mode="r")

# or open as another Xarray Dataset
ds = xr.open_zarr(http_map, consolidated=True)

Or to explore other access methods, open in a browser.


If you encounter any errors or problems with Xpublish, please open an issue on GitHub, or ask questions in Github Discussions or on our Slack Channel.