Metadata-Version: 2.4
Name: geomd
Version: 0.2.0
Summary: GeoMarkdown is a Markdown dialect for geodata. This package provides parsers and renderers that convert between GeoMarkdown and GeoJSON
Author: Sergei
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: geojson>=3.3.0
Requires-Dist: mistune>=3.3.4
Requires-Dist: requests>=2.34.2 ; extra == 'api'
Requires-Dist: fastapi>=0.141.1 ; extra == 'api'
Requires-Dist: uvicorn[standard]>=0.53.0 ; extra == 'api'
Requires-Dist: fastmcp>=4.0.10 ; extra == 'mcp'
Requires-Python: >=3.12
Project-URL: Homepage, https://github.com/spapulin/geomd
Project-URL: Repository, https://github.com/spapulin/geomd
Project-URL: Issues, https://github.com/spapulin/geomd/issues
Provides-Extra: api
Provides-Extra: mcp
Description-Content-Type: text/markdown

# geomd

[![Spec](https://img.shields.io/badge/spec-v0.1.0-blue)](SPEC.md)

GeoMarkdown is a Markdown dialect for geodata. This package provides parsers and renderers that convert between GeoMarkdown and GeoJSON

See the **[Specification](SPEC.md)** for the full notation.

## Quickstart

Walk through parsing and rendering in
[`notebooks/quickstart.ipynb`](notebooks/quickstart.ipynb).

Or, in three lines:

````python
import geomd as gmd

markdown_str = """
# Barcelona Tour

## Park Güell

<!--
field_mapping:
    - On map: geometry
-->

### Overview

A colorful park designed by Antoni Gaudí

### Address

Carrer d'Olot, Barcelona, Spain

### On map

```geometry
{"type": "Point", "coordinates": [2.1527, 41.4145]}
```
"""

# Convert from GeoMarkdown to GeoJSON
geojson_str = gmd.convert(
    text=markdown_str,
    src="geomd",
    dst="geojson"
)
print(geojson_str)
````

## Try it online

The quickest way to see `geomd` in action is the hosted demo:

**[https://geomd.onrender.com/?url=https://raw.githubusercontent.com/spapulin/geomd/refs/heads/main/assets/barcelona_tour.geojson&src=geojson&dst=html&auto_contents=true](https://geomd.onrender.com/?url=https://raw.githubusercontent.com/spapulin/geomd/refs/heads/main/assets/barcelona_tour.geojson&src=geojson&dst=html&auto_contents=true)**

The service takes a GeoJSON file, reads it, and renders it back as HTML. The example above uses [`barcelona_tour.geojson`](https://raw.githubusercontent.com/spapulin/geomd/refs/heads/main/assets/barcelona_tour.geojson)

The service accepts three query parameters:

| Parameter | Description | Example |
|-----------|-------------|---------|
| `url` | Public URL of the source file | `https://raw.githubusercontent.com/.../barcelona_tour.geojson` |
| `src` | Source format | `geojson` |
| `dst` | Target format | `html` |
| `auto_contents` | Auto-generate table of contents (`true`/`false`, default: `false`) | `true` |
| `contents_title` | Title of the table of contents (`str`, default: `"Contents"`) | `Table of Contents` |

The demo server also exposes an interactive **Swagger UI** where you can explore and test the available endpoints directly from your browser:

**[https://geomd.onrender.com/docs](https://geomd.onrender.com/docs)**

## Install

### As a library

With uv (recommended):

    uv add geomd

With pip:

    pip install geomd

### Development version

The latest unreleased code from `main`. May contain bugs, may
break without notice. Use only if you need a fix that hasn't
shipped to PyPI yet.

    uv add "geomd @ git+https://github.com/spapulin/geomd.git"
    pip install "geomd @ git+https://github.com/spapulin/geomd.git"

For reproducible installs, pin to a tag or commit:

    uv add "geomd @ git+https://github.com/spapulin/geomd.git@v0.1.0"

## Specification

GeoMarkdown is defined by **[Specification](SPEC.md)**. The spec is versioned independently of the package:

- Package: `geomd` is the Python implementation.
- Spec: `0.1.0` is the notation.

## License

[MIT](LICENSE)