Skip to main content

titiler.xarray

Adds support for Xarray Dataset (NetCDF/Zarr) in Titiler.

Installation

python -m pip install -U pip

# From Pypi
python -m pip install "titiler.xarray[full]"

# Or from sources
git clone https://github.com/developmentseed/titiler.git
cd titiler && python -m pip install -e src/titiler/core -e "src/titiler/xarray"

Installation options

Default installation for titiler.xarray DOES NOT include fsspec or any storage's specific dependencies (e.g s3fs) nor engine dependencies (zarr, h5netcdf). This is to ease the customization and deployment of user's applications. If you want to use the default's dataset reader you will need to at least use the [minimal] dependencies (e.g python -m pip install "titiler.xarray[minimal]").

Here is the list of available options:

  • fs: h5netcdf, fsspec, s3fs, aiohttp, gcsfs

Dependencies

Titiler.xarray follows SPEC 0, similar to xarray.

How To

from fastapi import FastAPI

from titiler.xarray.extensions import VariablesExtension
from titiler.xarray.factory import TilerFactory

app = FastAPI(
    openapi_url="/api",
    docs_url="/api.html",
    description="""Xarray based tiles server for MultiDimensional dataset (Zarr/NetCDF).

---

**Documentation**: <a href="https://developmentseed.org/titiler/" target="_blank">https://developmentseed.org/titiler/</a>

**Source Code**: <a href="https://github.com/developmentseed/titiler" target="_blank">https://github.com/developmentseed/titiler</a>

---
    """,
)

md = TilerFactory(
    router_prefix="/md",
    extensions=[
        VariablesExtension(),
    ],
)
app.include_router(md.router, prefix="/md", tags=["Multi Dimensional"])

Package structure

titiler/
 └── xarray/
    ├── tests/                   - Tests suite
    └── titiler/xarray/          - `xarray` namespace package
        ├── dependencies.py      - titiler-xarray dependencies
        ├── extensions.py        - titiler-xarray extensions
        ├── main.py              - main fastapi application
        ├── io.py                - titiler-xarray Readers
        └── factory.py           - endpoints factory

Custom Dataset Opener

A default Dataset IO is provided within titiler.xarray.io.Reader class with only support for Zarr dataset (via xarray+zarr-python).

For other dataset (e.g NetCDF), you can use titiler.xarray.io.FsReader which use the optional dependencies (fsspec, netcdf5).

python -m pip install "titiler.xarray[fs]"

Example of application with fsspec reader:

from fastapi import FastAPI
from titiler.xarray.extensions import VariablesExtension
from titiler.xarray.factory import TilerFactory
from titiler.xarray.io import FsReader

# Create FastAPI application
app = FastAPI(openapi_url="/api", docs_url="/api.html")

# Create custom endpoints with the FsReader
md = TilerFactory(
    reader=FsReader,
    router_prefix="/md",
    extensions=[
        # we also want to use the simple opener for the Extension
        VariablesExtension(dataset_opener=xarray.open_dataset),
    ],
)

app.include_router(md.router, prefix="/md", tags=["Multi Dimensional"])

Download files

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

Source Distribution

titiler_xarray-2.1.0.tar.gz (32.5 kB view details)

Uploaded Source

Built Distribution

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

titiler_xarray-2.1.0-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

Details for the file titiler_xarray-2.1.0.tar.gz.

File metadata

  • Download URL: titiler_xarray-2.1.0.tar.gz
  • Upload date:
  • Size: 32.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for titiler_xarray-2.1.0.tar.gz
Algorithm Hash digest
SHA256 2fb2b1fa7f1d62a2fd4a88b6d684732bf8d39c288a22c43f3c882424fe4d0688
MD5 1d04d1855a84343e6d57476f562c6a00
BLAKE2b-256 3f07fe931ec4ba0dd793b671c40c83d3fd09e6237a00961131fff3f1fcc2384a

See more details on using hashes here.

Provenance

The following attestation bundles were made for titiler_xarray-2.1.0.tar.gz:

Publisher: release.yml on developmentseed/titiler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file titiler_xarray-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: titiler_xarray-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 34.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for titiler_xarray-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7086ea21cd0387e589d7b367ad286e134ff4bb295e42ed553cfcaf4d30fbd6ad
MD5 6b8b9d65658d30d883c74e72a7837f66
BLAKE2b-256 c7c15e2ef41b3598334ffe631874912b18c652e29bd38adcba24b2bb16ca0d81

See more details on using hashes here.

Provenance

The following attestation bundles were made for titiler_xarray-2.1.0-py3-none-any.whl:

Publisher: release.yml on developmentseed/titiler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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