map_nl


Namemap_nl JSON
Version 0.0.5 PyPI version JSON
download
home_pagehttps://github.com/fpgmaas/map-nl
SummaryQuickly create maps of the Netherlands in Python
upload_time2023-12-02 09:42:01
maintainer
docs_urlNone
authorFlorian Maas
requires_python>=3.9,<3.12
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <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 a lot easier. It automatically downloads the geojson files, so all you need to provide is a dataset with 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.

For an example map created with _map-nl_, see [here](https://fpgmaas.github.io/map-nl/static/choropleth.html).

---

<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.0001).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).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/fpgmaas/map-nl",
    "name": "map_nl",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<3.12",
    "maintainer_email": "",
    "keywords": "",
    "author": "Florian Maas",
    "author_email": "ffpgmaas@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/0b/42/c031c1e1c355ecb5378a63378b77e5f93c130fd521ef78e832ccb6379c93/map_nl-0.0.5.tar.gz",
    "platform": null,
    "description": "<p align=\"center\" style=\"margin: 30px 30px 40px 30px;\">\n  <img alt=\"map nl\" height=\"150\" src=\"https://github.com/fpgmaas/map-nl/blob/main/docs/static/nl.png?raw=true\">\n</p>\n\n# map-nl\n\n[![Release](https://img.shields.io/github/v/release/fpgmaas/map-nl)](https://img.shields.io/github/v/release/fpgmaas/map-nl)\n[![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)\n[![codecov](https://codecov.io/gh/fpgmaas/map-nl/branch/main/graph/badge.svg)](https://codecov.io/gh/fpgmaas/map-nl)\n[![Commit activity](https://img.shields.io/github/commit-activity/m/fpgmaas/map-nl)](https://img.shields.io/github/commit-activity/m/fpgmaas/map-nl)\n[![License](https://img.shields.io/github/license/fpgmaas/map-nl)](https://img.shields.io/github/license/fpgmaas/map-nl)\n\n_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 a lot easier. It automatically downloads the geojson files, so all you need to provide is a dataset with 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.\n\nFor an example map created with _map-nl_, see [here](https://fpgmaas.github.io/map-nl/static/choropleth.html).\n\n---\n\n<p align=\"center\">\n  <a href=\"https://fpgmaas.github.io/map-nl\">Documentation</a> - <a href=\"https://fpgmaas.github.io/map-nl/contributing/\">Contributing</a>\n</p>\n\n---\n\n## Quickstart\n\n### Installation\n\nTo add _map-nl_ to your project, run one of the following commands:\n\n```shell\n# Install with poetry\npoetry add map-nl\n\n# Install with pip\npip install map-nl\n```\n\n### Usage\n\nTo create a choropleth map of the average WOZ-value in the Netherlands, you could run the following:\n\n```py\nimport pandas as pd\nfrom map_nl import ChoroplethMapNL\n\ndf = pd.read_csv(\"https://raw.githubusercontent.com/fpgmaas/map-nl/main/data/woz-pc4.csv\")\n\nm = ChoroplethMapNL(geojson_simplify_tolerance=0.0001).plot(\n    df, pc4_column_name=\"pc4\", value_column_name=\"WOZ\", legend_name=\"Average WOZ Value\"\n)\nm.save(\"map.html\")\n```\n\nThis 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.\n\nFor more details, see [the documentation](https://fpgmaas.github.io/map-nl).\n\n---\n\nRepository initiated with [fpgmaas/cookiecutter-poetry](https://github.com/fpgmaas/cookiecutter-poetry).\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Quickly create maps of the Netherlands in Python",
    "version": "0.0.5",
    "project_urls": {
        "Documentation": "https://fpgmaas.github.io/map-nl/",
        "Homepage": "https://github.com/fpgmaas/map-nl",
        "Repository": "https://github.com/fpgmaas/map-nl"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e8f36981c51b7d17d06cda40c84d6ce6e16db3381ef00b4f303c03a30754e02d",
                "md5": "1aef8c645d867b7ad62775bbe5e76446",
                "sha256": "32af9f8b1c0a02126fc692764d7d4eb06b91a816bbc14b09796ca3fc563649b7"
            },
            "downloads": -1,
            "filename": "map_nl-0.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1aef8c645d867b7ad62775bbe5e76446",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<3.12",
            "size": 11314,
            "upload_time": "2023-12-02T09:41:59",
            "upload_time_iso_8601": "2023-12-02T09:41:59.906510Z",
            "url": "https://files.pythonhosted.org/packages/e8/f3/6981c51b7d17d06cda40c84d6ce6e16db3381ef00b4f303c03a30754e02d/map_nl-0.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0b42c031c1e1c355ecb5378a63378b77e5f93c130fd521ef78e832ccb6379c93",
                "md5": "9426d9283346b043549a32bc092f34c6",
                "sha256": "1207eb8c1a5e12c5f8a86b0ee29d340a969a97d278adb293a76837e5e235bfc3"
            },
            "downloads": -1,
            "filename": "map_nl-0.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "9426d9283346b043549a32bc092f34c6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<3.12",
            "size": 9291,
            "upload_time": "2023-12-02T09:42:01",
            "upload_time_iso_8601": "2023-12-02T09:42:01.812822Z",
            "url": "https://files.pythonhosted.org/packages/0b/42/c031c1e1c355ecb5378a63378b77e5f93c130fd521ef78e832ccb6379c93/map_nl-0.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-02 09:42:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "fpgmaas",
    "github_project": "map-nl",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "map_nl"
}
        
Elapsed time: 2.98540s