xee


Namexee JSON
Version 0.0.19 PyPI version JSON
download
home_pageNone
SummaryA Google Earth Engine extension for Xarray.
upload_time2024-10-17 21:43:52
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Xee: Xarray + Google Earth Engine

![Xee Logo](https://raw.githubusercontent.com/google/Xee/main/docs/xee-logo.png)

_An Xarray extension for Google Earth Engine._

[![image](https://img.shields.io/pypi/v/xee.svg)](https://pypi.python.org/pypi/xee)
[![image](https://static.pepy.tech/badge/xee)](https://pepy.tech/project/xee)
[![Conda Recipe](https://img.shields.io/badge/recipe-xee-green.svg)](https://github.com/conda-forge/xee-feedstock)
[![image](https://img.shields.io/conda/vn/conda-forge/xee.svg)](https://anaconda.org/conda-forge/xee)
[![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/xee.svg)](https://anaconda.org/conda-forge/xee)

## How to use

Install with pip:

```shell
pip install --upgrade xee
```

Install with conda:

```shell
conda install -c conda-forge xee
```

Then, authenticate Earth Engine:

```shell
earthengine authenticate --quiet
```

Now, in your Python environment, make the following imports:

```python
import ee
import xarray
```

Next, initialize the EE client with the high volume API:

```python
ee.Initialize(opt_url='https://earthengine-highvolume.googleapis.com')
```

Open any Earth Engine ImageCollection by specifying the Xarray engine as `'ee'`:

```python
ds = xarray.open_dataset('ee://ECMWF/ERA5_LAND/HOURLY', engine='ee')
```

Open all bands in a specific projection (not the Xee default):

```python
ds = xarray.open_dataset('ee://ECMWF/ERA5_LAND/HOURLY', engine='ee',
                         crs='EPSG:4326', scale=0.25)
```

Open an ImageCollection (maybe, with EE-side filtering or processing):

```python
ic = ee.ImageCollection('ECMWF/ERA5_LAND/HOURLY').filterDate('1992-10-05', '1993-03-31')
ds = xarray.open_dataset(ic, engine='ee', crs='EPSG:4326', scale=0.25)
```

Open an ImageCollection with a specific EE projection or geometry:

```python
ic = ee.ImageCollection('ECMWF/ERA5_LAND/HOURLY').filterDate('1992-10-05', '1993-03-31')
leg1 = ee.Geometry.Rectangle(113.33, -43.63, 153.56, -10.66)
ds = xarray.open_dataset(
    ic,
    engine='ee',
    projection=ic.first().select(0).projection(),
    geometry=leg1
)
```

Open multiple ImageCollections into one `xarray.Dataset`, all with the same projection:

```python
ds = xarray.open_mfdataset(['ee://ECMWF/ERA5_LAND/HOURLY', 'ee://NASA/GDDP-CMIP6'],
                           engine='ee', crs='EPSG:4326', scale=0.25)
```

Open a single Image by passing it to an ImageCollection:

```python
i = ee.ImageCollection(ee.Image("LANDSAT/LC08/C02/T1_TOA/LC08_044034_20140318"))
ds = xarray.open_dataset(i, engine='ee')
```

Open any Earth Engine ImageCollection to match an existing transform:

```python
raster = rioxarray.open_rasterio(...) # assume crs + transform is set
ds = xr.open_dataset(
    'ee://ECMWF/ERA5_LAND/HOURLY',
    engine='ee',
    geometry=tuple(raster.rio.bounds()), # must be in EPSG:4326
    projection=ee.Projection(
        crs=str(raster.rio.crs), transform=raster.rio.transform()[:6]
    ),
)
```

See [examples](https://github.com/google/Xee/tree/main/examples) or [docs](https://github.com/google/Xee/tree/main/docs) for more uses and integrations.

## How to run integration tests

The Xee integration tests only pass on Xee branches (no forks). Please run the
integration tests locally before sending a PR. To run the tests locally,
authenticate using `earthengine authenticate` and run the following:

```bash
USE_ADC_CREDENTIALS=1 python -m unittest xee/ext_integration_test.py
```

## License

This is not an official Google product.

```
Copyright 2023 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "xee",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Google LLC <noreply@google.com>",
    "download_url": "https://files.pythonhosted.org/packages/9b/d4/183f82d6edb798fad6054cdc6a4be2635a6ccc21a2599ecd932164d9ae7e/xee-0.0.19.tar.gz",
    "platform": null,
    "description": "# Xee: Xarray + Google Earth Engine\n\n![Xee Logo](https://raw.githubusercontent.com/google/Xee/main/docs/xee-logo.png)\n\n_An Xarray extension for Google Earth Engine._\n\n[![image](https://img.shields.io/pypi/v/xee.svg)](https://pypi.python.org/pypi/xee)\n[![image](https://static.pepy.tech/badge/xee)](https://pepy.tech/project/xee)\n[![Conda Recipe](https://img.shields.io/badge/recipe-xee-green.svg)](https://github.com/conda-forge/xee-feedstock)\n[![image](https://img.shields.io/conda/vn/conda-forge/xee.svg)](https://anaconda.org/conda-forge/xee)\n[![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/xee.svg)](https://anaconda.org/conda-forge/xee)\n\n## How to use\n\nInstall with pip:\n\n```shell\npip install --upgrade xee\n```\n\nInstall with conda:\n\n```shell\nconda install -c conda-forge xee\n```\n\nThen, authenticate Earth Engine:\n\n```shell\nearthengine authenticate --quiet\n```\n\nNow, in your Python environment, make the following imports:\n\n```python\nimport ee\nimport xarray\n```\n\nNext, initialize the EE client with the high volume API:\n\n```python\nee.Initialize(opt_url='https://earthengine-highvolume.googleapis.com')\n```\n\nOpen any Earth Engine ImageCollection by specifying the Xarray engine as `'ee'`:\n\n```python\nds = xarray.open_dataset('ee://ECMWF/ERA5_LAND/HOURLY', engine='ee')\n```\n\nOpen all bands in a specific projection (not the Xee default):\n\n```python\nds = xarray.open_dataset('ee://ECMWF/ERA5_LAND/HOURLY', engine='ee',\n                         crs='EPSG:4326', scale=0.25)\n```\n\nOpen an ImageCollection (maybe, with EE-side filtering or processing):\n\n```python\nic = ee.ImageCollection('ECMWF/ERA5_LAND/HOURLY').filterDate('1992-10-05', '1993-03-31')\nds = xarray.open_dataset(ic, engine='ee', crs='EPSG:4326', scale=0.25)\n```\n\nOpen an ImageCollection with a specific EE projection or geometry:\n\n```python\nic = ee.ImageCollection('ECMWF/ERA5_LAND/HOURLY').filterDate('1992-10-05', '1993-03-31')\nleg1 = ee.Geometry.Rectangle(113.33, -43.63, 153.56, -10.66)\nds = xarray.open_dataset(\n    ic,\n    engine='ee',\n    projection=ic.first().select(0).projection(),\n    geometry=leg1\n)\n```\n\nOpen multiple ImageCollections into one `xarray.Dataset`, all with the same projection:\n\n```python\nds = xarray.open_mfdataset(['ee://ECMWF/ERA5_LAND/HOURLY', 'ee://NASA/GDDP-CMIP6'],\n                           engine='ee', crs='EPSG:4326', scale=0.25)\n```\n\nOpen a single Image by passing it to an ImageCollection:\n\n```python\ni = ee.ImageCollection(ee.Image(\"LANDSAT/LC08/C02/T1_TOA/LC08_044034_20140318\"))\nds = xarray.open_dataset(i, engine='ee')\n```\n\nOpen any Earth Engine ImageCollection to match an existing transform:\n\n```python\nraster = rioxarray.open_rasterio(...) # assume crs + transform is set\nds = xr.open_dataset(\n    'ee://ECMWF/ERA5_LAND/HOURLY',\n    engine='ee',\n    geometry=tuple(raster.rio.bounds()), # must be in EPSG:4326\n    projection=ee.Projection(\n        crs=str(raster.rio.crs), transform=raster.rio.transform()[:6]\n    ),\n)\n```\n\nSee [examples](https://github.com/google/Xee/tree/main/examples) or [docs](https://github.com/google/Xee/tree/main/docs) for more uses and integrations.\n\n## How to run integration tests\n\nThe Xee integration tests only pass on Xee branches (no forks). Please run the\nintegration tests locally before sending a PR. To run the tests locally,\nauthenticate using `earthengine authenticate` and run the following:\n\n```bash\nUSE_ADC_CREDENTIALS=1 python -m unittest xee/ext_integration_test.py\n```\n\n## License\n\nThis is not an official Google product.\n\n```\nCopyright 2023 Google LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    https://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "A Google Earth Engine extension for Xarray.",
    "version": "0.0.19",
    "project_urls": {
        "Homepage": "https://github.com/google/xee",
        "Issues": "https://github.com/google/Xee/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1711cb94cff77032b9a69c3cd48274c7dd15ee577ba549ffdbefe303f278c03f",
                "md5": "69d46d48b625471df23d39f8098831f4",
                "sha256": "70d594e1d547d2237262c2cd01502c82ce6b4bb0f133b360219e92b1c999eb89"
            },
            "downloads": -1,
            "filename": "xee-0.0.19-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "69d46d48b625471df23d39f8098831f4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 30211,
            "upload_time": "2024-10-17T21:43:51",
            "upload_time_iso_8601": "2024-10-17T21:43:51.441576Z",
            "url": "https://files.pythonhosted.org/packages/17/11/cb94cff77032b9a69c3cd48274c7dd15ee577ba549ffdbefe303f278c03f/xee-0.0.19-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9bd4183f82d6edb798fad6054cdc6a4be2635a6ccc21a2599ecd932164d9ae7e",
                "md5": "a85a461c768fc866c487c24315e366ab",
                "sha256": "87e3fef3da3a27fa3ba624fdc34661ed85226e2b45b4b86fd11d0eb4bd3542cf"
            },
            "downloads": -1,
            "filename": "xee-0.0.19.tar.gz",
            "has_sig": false,
            "md5_digest": "a85a461c768fc866c487c24315e366ab",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 57720,
            "upload_time": "2024-10-17T21:43:52",
            "upload_time_iso_8601": "2024-10-17T21:43:52.913012Z",
            "url": "https://files.pythonhosted.org/packages/9b/d4/183f82d6edb798fad6054cdc6a4be2635a6ccc21a2599ecd932164d9ae7e/xee-0.0.19.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-17 21:43:52",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "google",
    "github_project": "xee",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "xee"
}
        
Elapsed time: 0.33883s