Skip to main content

Xarray accessors for publishing datasets as web applications

Project description

GitHub Workflow Status Documentation Status Binder

xpublish

Publish Xarray Datasets via a Zarr compatible REST API

Server side: Publish a xarray dataset as a rest API

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

Client side: Connect to a published dataset

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

fs = HTTPFileSystem()
http_map = fs.get_mapper('http://0.0.0.0:9000')

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

# open as another xarray dataset
xr.open_zarr(http_map, consolidated=True)

Why?

xpublish lets you serve/share/publish xarray datasets via a web application. The data in the xarray datasets (on the server side) can be backed by dask to facilitate on-demand computation via a simple REST API. We are exploring applications of xpublish that include:

  • publish on-demand derived data products

  • turning xarray objects into streaming services (e.g. OPENDAP)

How?

Under the hood, xpublish is using a web app (FastAPI) that is exposing a minimal Zarr compatible REST-like API. Key attributes of the API are:

  • serves a Zarr store API from the root of the dataset

  • provides Zarr metadata keys (.zmetadata) as json strings.

  • provides access to data keys (e.g. var/0.0.0) as binary strings.

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

xpublish-0.0.2.tar.gz (22.5 kB view details)

Uploaded Source

Built Distribution

xpublish-0.0.2-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file xpublish-0.0.2.tar.gz.

File metadata

  • Download URL: xpublish-0.0.2.tar.gz
  • Upload date:
  • Size: 22.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.0.post20191124 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.3

File hashes

Hashes for xpublish-0.0.2.tar.gz
Algorithm Hash digest
SHA256 0707933f0034f208639d0abd3a9b55ad44e70c4fc85091db9d4468ad58721a2e
MD5 01923343064580bb489dc72d1f24299c
BLAKE2b-256 0a18720854bbaa24e3a00b830a0e1ebe9271f6dfe54061e89ba70441b8c81f87

See more details on using hashes here.

File details

Details for the file xpublish-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: xpublish-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.0.post20191124 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.3

File hashes

Hashes for xpublish-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 93edb4ab505b4f58bc4322cbf02e446ef47a444dd5c7d7257dc8404ae00b0dc6
MD5 b15b50035d0bdde6c76e977405d26292
BLAKE2b-256 7c0314f63c7641e5eaedb755539c5a08b8e49f75594cf816a0ed0933838e1be8

See more details on using hashes here.

Supported by

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