Skip to content

XArray accessor #183

Description

@ahuang11

Would be nice to monkeypatch / have an xarray accessor on import:

  1. to_xql
import xarray as xr
import xarray_sql as xql

ds = xr.tutorial.open_dataset("air_temperature")
ds["air_x2"] = ds["air"] * 2
ds.to_xql("era5")
# create table air and air_x2
  1. or directly call xql with accessor https://tutorial.xarray.dev/advanced/accessors/01_accessor_examples.html?
import xarray as xr
import xarray_sql as xql

ds = xr.tutorial.open_dataset("air_temperature")
ds.xql.execute("SELECT * FROM air")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions