Metadata-Version: 2.4
Name: maply
Version: 0.1.0
Summary: A Jupyter notebook widget for interactively drawing shapes and converting them to shapely / WKT.
Project-URL: Homepage, https://github.com/austinbreunig/maply
Project-URL: Repository, https://github.com/austinbreunig/maply
Project-URL: Issues, https://github.com/austinbreunig/maply/issues
Author: Austin Breunig
License: MIT License
        
        Copyright (c) 2026 maply contributors
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: drawing,geospatial,gis,jupyter,shapely,widget,wkt
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Jupyter
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: GIS
Requires-Python: >=3.9
Requires-Dist: ipycanvas>=0.13
Requires-Dist: ipywidgets>=8.0
Requires-Dist: shapely>=2.0
Provides-Extra: dev
Requires-Dist: geopandas>=0.13; extra == 'dev'
Requires-Dist: ipyleaflet>=0.18; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Provides-Extra: geo
Requires-Dist: ipyleaflet>=0.18; extra == 'geo'
Provides-Extra: geopandas
Requires-Dist: geopandas>=0.13; extra == 'geopandas'
Description-Content-Type: text/markdown

# maply

**maply** is a Jupyter notebook widget for quickly *drawing* shapes on a blank
XY canvas and converting them into [shapely](https://shapely.readthedocs.io/)
geometries, WKT strings, GeoJSON, or a GeoDataFrame.

It is built for geospatial engineers who need to prototype and test spatial
algorithms, and want a fast way to hand-craft geometry for minimal reproducible
examples — without typing out coordinate tuples by hand.

## Features

- Draw **points, lines, polygons (with holes), rectangles, and circles** on an
  abstract XY canvas.
- Build **multipart** geometries / collections.
- Pull results straight into Python:
  - `canvas.geometries` → list of shapely geometries
  - `canvas.wkt` → WKT strings
  - `canvas.geojson` → GeoJSON dict
  - `canvas.to_geodataframe()` → geopandas `GeoDataFrame` (optional dependency)
- Or draw on a **real interactive map** with `GeoCanvas` (ipyleaflet), including
  pushing Python geometry back onto the map to inspect and edit it.

## Install

```bash
pip install -e .              # core
pip install -e ".[geopandas]" # + GeoDataFrame export
pip install -e ".[geo]"       # + GeoCanvas interactive map (ipyleaflet)
pip install -e ".[dev]"       # + test / lint tooling
```

## Quick start

```python
from maply import MaplyCanvas

canvas = MaplyCanvas(width=600, height=400)
canvas          # draw shapes interactively in the output cell

canvas.wkt          # -> ['POLYGON ((...))', 'POINT (...)']
canvas.geometries   # -> [<shapely Polygon>, <shapely Point>]
```

### Draw on a real map

`GeoCanvas` wraps an [ipyleaflet](https://ipyleaflet.readthedocs.io) map (pan,
zoom, basemaps, draw/edit toolbar) and connects it to the same conversion layer
— in **both directions**:

```python
from shapely.geometry import Polygon
from maply import GeoCanvas

geo = GeoCanvas(center=(37.77, -122.42), zoom=12)

# Python -> map: inspect / edit a geometry on the map
geo.add_geometry(Polygon([(-122.45, 37.75), (-122.40, 37.75),
                          (-122.40, 37.79), (-122.45, 37.79)]))
geo

# map -> Python (after drawing/editing)
geo.wkt
geo.to_geodataframe(crs="EPSG:3857")   # optional reprojection
```

See [`examples/quickstart.ipynb`](examples/quickstart.ipynb) for a full walkthrough.

## Status

Alpha. `MaplyCanvas` uses planar XY (no CRS). `GeoCanvas` draws in lon/lat
(EPSG:4326) on a live map and is available with the `geo` extra.

