Metadata-Version: 2.4
Name: geeviz
Version: 2026.11.2
Summary: A package to help with GEE data processing, analysis, and visualization
Author: Ian Housman
Author-email: ian.housman@gmail.com
License: Apache
Project-URL: Repository, https://github.com/gee-community/geeviz
Project-URL: Documentation, https://geeviz.org/
Keywords: google earth engine earthengine gee remote sensing landsat sentinel sentinel-2 modis forestry forest land cover use change detection nlcd mcp stac
Classifier: Programming Language :: Python :: 3
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Development Status :: 4 - Beta
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: earthengine-api
Requires-Dist: oauth2client
Requires-Dist: google-cloud-storage
Requires-Dist: google-cloud-monitoring
Requires-Dist: google-auth
Requires-Dist: georest<0.7,>=0.6.2
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: geemap
Requires-Dist: matplotlib
Requires-Dist: IPython
Requires-Dist: requests
Requires-Dist: httpx
Requires-Dist: httplib2
Requires-Dist: fastapi
Requires-Dist: uvicorn
Requires-Dist: folium
Requires-Dist: simpledbf
Requires-Dist: plotly<7
Requires-Dist: markdown
Requires-Dist: mcp<2.0,>=1.26
Requires-Dist: Pillow
Requires-Dist: kaleido>=1.1
Provides-Extra: mcp
Requires-Dist: websocket-client; extra == "mcp"
Requires-Dist: scipy<2,>=1.11; extra == "mcp"
Requires-Dist: scikit-learn<2,>=1.4; extra == "mcp"
Requires-Dist: statsmodels<1,>=0.14; extra == "mcp"
Requires-Dist: seaborn<1,>=0.13; extra == "mcp"
Requires-Dist: tabulate<1,>=0.9; extra == "mcp"
Requires-Dist: geopandas<2,>=1.0; extra == "mcp"
Requires-Dist: pyproj<4,>=3.6; extra == "mcp"
Requires-Dist: pyogrio<1,>=0.7; extra == "mcp"
Requires-Dist: playwright<2,>=1.40; extra == "mcp"
Provides-Extra: segmentation
Requires-Dist: torch; extra == "segmentation"
Requires-Dist: torchvision; extra == "segmentation"
Requires-Dist: transformers; extra == "segmentation"
Provides-Extra: gemini
Requires-Dist: google-genai; extra == "gemini"
Provides-Extra: hrrr
Requires-Dist: rasterio>=1.3; extra == "hrrr"
Requires-Dist: tqdm; extra == "hrrr"
Provides-Extra: all
Requires-Dist: geopandas<2,>=1.0; extra == "all"
Requires-Dist: google-genai; extra == "all"
Requires-Dist: playwright<2,>=1.40; extra == "all"
Requires-Dist: pyogrio<1,>=0.7; extra == "all"
Requires-Dist: pyproj<4,>=3.6; extra == "all"
Requires-Dist: rasterio>=1.3; extra == "all"
Requires-Dist: scikit-learn<2,>=1.4; extra == "all"
Requires-Dist: scipy<2,>=1.11; extra == "all"
Requires-Dist: seaborn<1,>=0.13; extra == "all"
Requires-Dist: statsmodels<1,>=0.14; extra == "all"
Requires-Dist: tabulate<1,>=0.9; extra == "all"
Requires-Dist: torch; extra == "all"
Requires-Dist: torchvision; extra == "all"
Requires-Dist: tqdm; extra == "all"
Requires-Dist: transformers; extra == "all"
Requires-Dist: websocket-client; extra == "all"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: project-url
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: summary

<p align="center">
  <a href="https://geeviz.org/">
    <img src="https://geeviz.org/_static/images/geeviz-logo-light.png" alt="geeViz logo" height="120">
  </a>
</p>

<h1 align="center">geeViz</h1>
<p align="center"><b>The Earth Engine Visualization Toolkit for Python</b></p>

<p align="center">
  <a href="https://pypi.org/project/geeViz/"><img src="https://img.shields.io/pypi/v/geeViz?color=blue" alt="PyPI version"></a>
  <a href="https://github.com/gee-community/geeViz"><img src="https://img.shields.io/github/stars/gee-community/geeViz?logo=github" alt="GitHub stars"></a>
  <a href="https://geeviz.org/">Docs</a>
  <a href="https://earthengine.google.com/">Google Earth Engine</a>
</p>

---

**geeViz** makes exploring, visualizing, and analyzing Earth Engine data and geospatial imagery easy in Python. Whether you’re an analyst, scientist, or just getting started, geeViz offers interactive mapping, time series, and advanced charting—without the JavaScript overhead.

Developed by [RedCastle Resources](https://www.redcastleresources.com/), geeViz features a powerful, customizable map viewer and Pythonic interfaces for working with [Google Earth Engine (GEE)](https://earthengine.google.com/).

---

## Key Features

- Interactive Map Viewer (launches in your browser)
- Layer toggling, opacity, visualization tools, querying, & area charting
- Dynamic time-lapse creation from GEE `ImageCollections`
- Built-in charting & analysis tools (point/polygon, time series, area stats)
- **Inline zonal summary & charting** (`geeViz.outputLib.charts`, formerly `geeViz.chartingLib`) — run zonal stats and produce Plotly charts (time series, bar, grouped bar, donut, scatter, per-feature time series subplots, Sankey) directly in notebooks
- **Summary area retrieval** (`geeViz.getSummaryAreasLib`) — 15 functions returning filtered `ee.FeatureCollection` objects for political boundaries, USFS units, census geographies, buildings, roads, and protected areas
- **Keyless Earth Engine authentication** (`geeViz.eeAuth`) — discovers whatever credentials you already have (persistent `earthengine authenticate`, gcloud ADC, or an attached service account), and runs a small local proxy so the map viewer never receives an access token. Also mints workload tags so EE compute can be attributed per user/session
- **Forest Service data services** (`geeViz.fsInsights`) — FIA and LCMS behind one interface. FIA answers *what is in the forest, and how much, with a standard error*; LCMS answers *what changed, and where*. Neither needs authentication, and FIA's 752 estimate attributes, 96 grouping variables and 1,143 evaluations are searchable offline from bundled catalogs
- **Wildland fire modeling** (`geeViz.fireLib`) — fuels, terrain, Rothermel surface fire behavior and cost-distance spread, all pixel-wise in Earth Engine. Draws an explicit line at what a stateless tile engine can do: propagation via `ee.Image.cumulativeCost` needs no timestep loop, and the real simulators (FSim, FlamMap, FARSITE) stay outside
- Jupyter/Colab support and standalone scripting
- Supports Landsat, Sentinel-2, MODIS, LCMS, LCMAP, and more
- Extensive examples and ready-to-run wrappers
- Built-in [MCP server](https://modelcontextprotocol.io/) for AI coding assistants (Cursor, Claude Code, VS Code Github Copilot, Windsurf, AntiGravity, etc...)

---

## Quick Links

- **PyPI:** [pypi.org/project/geeViz](https://pypi.org/project/geeViz/)
- **Docs/Home:** [geeviz.org](https://geeviz.org/)
- **Notebooks & Scripts:** [`examples/`](examples)
- **Community Repo:** [github.com/gee-community/geeViz](https://github.com/gee-community/geeViz)
- **Forest Service GitHub:** [code.fs.usda.gov/forest-service/geeViz](https://code.fs.usda.gov/forest-service/geeViz)

<details>
  <summary><b>JavaScript Version & Related Links</b></summary>

- [GEE Playground Module](https://earthengine.googlesource.com/users/aaronkamoske/GTAC-Modules)  
- [JS Modules on GitHub](https://github.com/rcr-usfs/gtac-rcr-gee-js-modules.git)  
- [Forest Service JS Repo](https://code.fs.usda.gov/forest-service/gtac-gee-js-modules.git)
</details>

---

## Documentation & Help

- [geeViz Documentation and API Reference](https://geeviz.org/)
- See [`examples/`](examples) for Jupyter/Colab notebooks and scripts.
- [`eeCatalogHelpers` guide](docs/eecataloghelpers.md): offline catalog planning, manifest previews, strict GCS upload and asset promotion.
- Need help? Email us at [info@geeviz.org](mailto:info@geeviz.org).

---

## Installation

The fastest way to get started:

1. **Sign up for [Google Earth Engine](https://signup.earthengine.google.com/#!/)**
2. **Install geeViz via pip:**
    ```sh
    pip install geeViz
    ```
3. **Authenticate your Google account with Earth Engine:**
    ```sh
    earthengine authenticate
    ```

That is the only auth step most users need. From there `geeViz.eeAuth`
takes over: it discovers those credentials on import, and if it can't
find them it falls back to gcloud ADC or an attached service account
rather than failing. See the [eeAuth docs](https://geeviz.org/) for the
proxy, tenancy, and workload-tagging details.

---

<details>
  <summary><b>Manual / Advanced Installation</b></summary>

1. Install the Earth Engine Python API if not present:
    ```sh
    pip install earthengine-api
    ```

2. Clone this repository:
    ```sh
    git clone https://github.com/gee-community/geeViz
    ```

3. Optionally, add or symlink the `geeViz` folder to your Python site-packages.

4. To update to the latest version:
    ```sh
    pip install geeViz --upgrade
    ```
    or, if installed via Git:
    ```sh
    git pull origin master
    ```

_geeViz is also mirrored at [code.fs.usda.gov/forest-service/geeViz](https://code.fs.usda.gov/forest-service/geeViz)._
</details>

---

### Optional: API Keys for Google Maps & Gemini

Some geeViz features (`googleMapsLib`, `outputLib.reports` LLM narratives) require API keys from Google Cloud. These are **optional** — core GEE functionality works without them.

**Gemini API Key** (for AI-generated report narratives and image interpretation):
1. Go to [Google AI Studio](https://aistudio.google.com/apikey)
2. Click **Create API Key** → select a project → copy the key

**Google Maps Platform API Key** (for geocoding, Street View, places, elevation, air quality, solar):
1. Go to [Google Cloud Console](https://console.cloud.google.com/) → select/create a project
2. Navigate to **APIs & Services** → **Credentials** → **Create Credentials** → **API Key**
3. (Recommended) Restrict the key to: Geocoding, Street View Static, Places (New), Elevation, Air Quality, Solar, Roads, Maps Static

**Store your keys** in a `.env` file in your geeViz package directory (alongside `geeView.py`):

```sh
# .env file in your geeViz package directory
GEMINI_API_KEY=your_gemini_api_key_here
GOOGLE_MAPS_PLATFORM_API_KEY=your_maps_platform_key_here
```

You can also set these as environment variables. The `.env` file is loaded automatically by `googleMapsLib` and `outputLib.reports` on import.

| Key | Used by | How to get |
|---|---|---|
| `GEMINI_API_KEY` | `googleMapsLib.interpret_image()`, `googleMapsLib.label_streetview()`, `outputLib.reports` LLM narratives | [Google AI Studio](https://aistudio.google.com/apikey) |
| `GOOGLE_MAPS_PLATFORM_API_KEY` | `googleMapsLib.geocode()`, `streetview_*()`, `search_places()`, `get_elevation()`, `get_air_quality()`, `get_solar_insights()`, etc. | [Google Cloud Console](https://console.cloud.google.com/apis/credentials) |

**Optional pip extras:**

```sh
pip install geeViz[gemini]         # Adds google-genai for AI features
pip install geeViz[segmentation]   # Adds torch + transformers for SegFormer
pip install geeViz[all]            # Everything
```

---

## AI-Assisted Development (MCP)

geeViz includes a built-in [MCP (Model Context Protocol)](https://modelcontextprotocol.io/) server with **12 tools** that give AI coding assistants live access to geeViz and Google Earth Engine. Instead of generating code from training data (which is often wrong or outdated), your AI assistant can look up real function signatures, read actual example scripts, execute and test code, inspect assets, export data, and more.

Works with **Cursor**, **Claude Code**, **VS Code with GitHub Copilot**, **Windsurf**, and any MCP-compatible client. The `mcp` SDK is included as a dependency — no extra install needed.

### Quick setup

1. Add a config file for your editor (see [MCP Server docs](https://geeviz.org/mcp.html)):
    ```json
    {
      "mcpServers": {
        "geeviz": {
          "command": "python",
          "args": ["-m", "geeViz.mcp.server"]
        }
      }
    }
    ```
2. Copy the agent instructions from `geeViz/mcp/agent-instructions.md` into your editor's instructions file (`.github/copilot-instructions.md`, `.cursorrules`, `CLAUDE.md`, or `.windsurfrules`).

### What the MCP server can do

The tools are organized into categories:

| Category | Tools |
|----------|-------|
| **Code Execution** | `run_code` — persistent REPL with `ee`, `Map`, `gv`, `gil`, `sal`, `edw`, `tl`, `rl`, `cl`, `palettes`, `pd`/`pandas`, `np`/`numpy` pre-loaded (plus `gm` when the optional Google Maps dep is installed); `save_session` — export as `.py` or `.ipynb`, with backward slicing to drop dead code by default |
| **API Introspection** | `search_codebase` — unified search across function signatures, module members, reference dictionaries, and example scripts (AST-indexed for geeViz, live for `ee` / `pandas` / `numpy` and anything else the REPL has loaded, zero import cost) |
| **Dataset Discovery** | `search_datasets` — keyword search across official & community catalogs |
| **Asset Inspection** | `inspect_asset` — bands, CRS, scale, date range, properties |
| **Map Control** | `map_control` — view, export, preview per-layer tiles, list layers, or clear the interactive map |
| **Exports & Asset Management** | `export_image` — to asset / Drive / Cloud Storage; `manage_asset` — delete / copy / move / create / update ACL |
| **Forest Service Data** | `search_fia` — find FIA attributes, grouping variables, or evaluations offline; `fia_estimate` — a design-based estimate with its sampling error; `lcms_summary` — LCMS land cover / land use / change areas |
| **Environment** | `env_info` — versions, namespace, project info; `view_output` — read back a saved raster (PNG/GIF/JPEG/WebP) as an inline image |

Charting (`cl.summarize_and_chart()`), thumbnails (`tl.generate_thumbs()`), report generation (`rl.*`), EDW queries (`edwLib.*`), and Google Maps helpers (`gm.geocode()`, `gm.search_places()`, `gm.streetview_*`, `gm.interpret_image()`, `gm.label_image()`, etc.) are accessed via `run_code` — one execution primitive plus a rich pre-loaded namespace beats a proliferation of narrow wrappers.

For the complete tool reference, architecture details, and usage examples, see the **[MCP Server README](mcp/README.md)** and the [online MCP Server guide](https://geeviz.org/mcp.html).

---

## Getting Started

geeViz comes with ready-to-run examples and templates for fast onboarding.

<table>
<tr><td>

### Example: Launch in Python

Authenticate and then try:
```python
from geeViz.examples import geeViewExample
```

Explore other examples:
```python
from geeViz.examples import timeLapseExample
from geeViz.examples import getLandsatWrapper
from geeViz.examples import getSentinel2Wrapper
from geeViz.examples import getCombinedLandsatSentinel2Wrapper
from geeViz.examples import harmonicRegressionWrapper
from geeViz.examples import LANDTRENDRWrapper
from geeViz.examples import LANDTRENDRViz
from geeViz.examples import CCDCViz
from geeViz.examples import lcmsViewerExample
from geeViz.examples import LCMAP_and_LCMS_Viewer
from geeViz.examples import phEEnoVizWrapper
from geeViz.examples import GFSTimeLapse
```
</td></tr>
</table>

---

### Use with Jupyter & Colab

- Interactive notebooks are in the [`examples/`](examples) directory ([see docs ➔](https://geeviz.org/tutorials/getting-started/)).
- The geeViz map viewer also works directly inside Jupyter and [Google Colab](https://colab.research.google.com/).

---

### Features at a Glance

- **One line mapping:** Map any GEE image or collection instantly
- **Interactive:** Toggle layers, set opacity, area/point query, and chart
- **Dynamic Time-Lapses:** Animate temporal stacks and export GIFs
- **No JavaScript required:** Pure Python interface

---

## Contributing

We love contributions and new users!

- Share a GEE script, notebook, or suggestion?  
  [info@geeviz.org](mailto:info@geeviz.org)
- Pull requests & feature requests:  
  [github.com/gee-community/geeViz](https://github.com/gee-community/geeViz)

---

## License

geeViz is released under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0).  
See the [LICENSE](LICENSE) file for details.
