Metadata-Version: 2.1
Name: map_nl
Version: 0.0.3
Summary: Quickly create maps of the Netherlands in Python
Home-page: https://github.com/fpgmaas/map-nl
Author: Florian Maas
Author-email: ffpgmaas@gmail.com
Requires-Python: >=3.9,<4.0
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
Requires-Dist: folium (>=0.15.0,<0.16.0)
Requires-Dist: geopandas (>=0.14.1,<0.15.0)
Requires-Dist: matplotlib (>=3.8.2,<4.0.0)
Requires-Dist: shapely (>=2.0.2,<3.0.0)
Requires-Dist: topojson (>=1.7,<2.0)
Requires-Dist: tqdm (>=4.66.1,<5.0.0)
Project-URL: Documentation, https://fpgmaas.github.io/map-nl/
Project-URL: Repository, https://github.com/fpgmaas/map-nl
Description-Content-Type: text/markdown

<p align="center" style="margin: 30px 30px 40px 30px;">
  <img alt="map nl" height="150" src="https://github.com/fpgmaas/map-nl/blob/main/docs/static/nl.png?raw=true">
</p>

# map-nl

[![Release](https://img.shields.io/github/v/release/fpgmaas/map-nl)](https://img.shields.io/github/v/release/fpgmaas/map-nl)
[![Build status](https://img.shields.io/github/actions/workflow/status/fpgmaas/map-nl/main.yml?branch=main)](https://github.com/fpgmaas/map-nl/actions/workflows/main.yml?query=branch%3Amain)
[![codecov](https://codecov.io/gh/fpgmaas/map-nl/branch/main/graph/badge.svg)](https://codecov.io/gh/fpgmaas/map-nl)
[![Commit activity](https://img.shields.io/github/commit-activity/m/fpgmaas/map-nl)](https://img.shields.io/github/commit-activity/m/fpgmaas/map-nl)
[![License](https://img.shields.io/github/license/fpgmaas/map-nl)](https://img.shields.io/github/license/fpgmaas/map-nl)

_map-nl_ is a Python package to help you quickly create [PC4](https://public.opendatasoft.com/explore/dataset/georef-netherlands-postcode-pc4/table/) maps of the Netherlands. While that is already possible without _map-nl_, this package aims to make the process as simple as possible. It automatically downloads the geojson files, so all you need to provide is a dataset wtih two columns: One containing PC4 codes and one with a related value to plot on the map. \_map_nl then uses [folium](https://github.com/python-visualization/folium) to plot the map.

---

<p align="center">
  <a href="https://fpgmaas.github.io/map-nl">Documentation</a> - <a href="https://fpgmaas.github.io/map-nl/contributing/">Contributing</a>
</p>

---

## Quickstart

### Installation

To add _map-nl_ to your project, run one of the following commands:

```shell
# Install with poetry
poetry add map-nl

# Install with pip
pip install map-nl
```

### Usage

To create a choropleth map of the average WOZ-value in the Netherlands, you could run the following:

```py
import pandas as pd
from map_nl import ChoroplethMapNL

df = pd.read_csv("https://raw.githubusercontent.com/fpgmaas/map-nl/main/data/woz-pc4.csv")

m = ChoroplethMapNL(geojson_simplify_tolerance=0.001).plot(
    df, pc4_column_name="pc4", value_column_name="WOZ", legend_name="Average WOZ Value"
)
m.save("map.html")
```

This will download the geojson file to the `.map_nl` directory, simplify the geojson file to reduce the disk size of the plot, plot the map and save it to disk.

For more details, see [the documentation](https://fpgmaas.github.io/map-nl).

---

Repository initiated with [fpgmaas/cookiecutter-poetry](https://github.com/fpgmaas/cookiecutter-poetry).

