Skip to content

Commit

Permalink
Add conda-forge badge and installation (#16)
Browse files Browse the repository at this point in the history
Add the conda-forge packages. Closes #9 
https://anaconda.org/conda-forge/dask-ee
  • Loading branch information
giswqs authored Jun 25, 2024
1 parent 549927a commit 9b27135
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,26 @@ _Google Earth Engine Feature Collections via Dask DataFrames._
[![ci](https://github.com/alxmrs/dask-ee/actions/workflows/ci-build.yml/badge.svg)](https://github.com/alxmrs/dask-ee/actions/workflows/ci-build.yml)
[![PyPi Version](https://img.shields.io/pypi/v/dask-ee.svg)](https://pypi.python.org/pypi/dask-ee)
[![Downloads](https://static.pepy.tech/badge/dask-ee)](https://pepy.tech/project/dask-ee)
[![Conda Recipe](https://img.shields.io/badge/recipe-dask--ee-green.svg)](https://anaconda.org/conda-forge/dask-ee)
[![Conda Version](https://img.shields.io/conda/vn/conda-forge/dask-ee.svg)](https://anaconda.org/conda-forge/dask-ee)
[![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/dask-ee.svg)](https://anaconda.org/conda-forge/dask-ee)

## How to use

Install with pip:

```shell
pip install dask-ee
```

Install with conda:

```shell
conda install -c conda-forge dask-ee
```

Then, authenticate Earth Engine:

```shell
earthengine authenticate
```
Expand All @@ -26,18 +37,22 @@ import dask_ee
```

You'll need to initialize Earth Engine before working with data:

```python
ee.Initialize()
```

From here, you can read Earth Engine FeatureCollections like they are DataFrames:

```python
df = dask_ee.read_ee("WRI/GPPD/power_plants")
df.head()
```

These work like Pandas DataFrames, but they are lazily evaluated via [Dask](https://dask.org/).

Feel free to do any analysis you wish. For example:

```python
# Thanks @aazuspan, https://www.aazuspan.dev/blog/dask_featurecollection
(
Expand All @@ -53,9 +68,10 @@ Feel free to do any analysis you wish. For example:
.plot()
)
```

![Coal vs Wind in the US since 1940](https://raw.githubusercontent.com/alxmrs/dask-ee/main/demo.png)

There are a few other useful things you can do.
There are a few other useful things you can do.

For one, you may pass in a pre-processed `ee.FeatureCollection`. This allows full utilization
of the Earth Engine API.
Expand All @@ -71,6 +87,7 @@ df = dask_ee.read_ee(fc)

In addition, you may change the `chunksize`, which controls how many rows are included in each
Dask partition.

```python
df = dask_ee.read_ee("WRI/GPPD/power_plants", chunksize=7_000)
df.head()
Expand All @@ -81,12 +98,14 @@ df.head()
Contributions are welcome. A good way to start is to check out open [issues](https://github.com/alxmrs/dask-ee/issues)
or file a new one. We're happy to review pull requests, too.

Before writing code, please install the development dependencies (after cloning the repo):
Before writing code, please install the development dependencies (after cloning the repo):

```shell
pip install -e ".[dev]"
```

## License

```
Copyright 2024 Alexander S Merose
Expand Down

0 comments on commit 9b27135

Please sign in to comment.