Skip to main content

zip/buildings rest API for Berlin

Project description

PLZ Rest API

A simple rest API that exposes data related to zip codes and buildings in Berlin.

This project is the Python implementation of PLZ

The source dataset is published by Esri and is available here.

Motivations

Built as an exercise

Rest API

PLZ provides the following endpoints:

  • /status returns the status of the service
  • /zip/buildings returns the number of buildings aggregated by zip code
  • /zip/buildings/history returns the number of buildings aggregated by zip code and year
  • /zip/buildings/:code returns the number of buildings for a specific zip code
  • /zip/buildings/:code/history returns the number of buildings aggregated by zip code and year for a specific zip code

Usage

There are 2 ways to run the PLZ api service: using Docker(recommended) or via manual setup.

For best results with Docker please use the image from the go project as described here since the image is orders of magnitude smaller.

Manual setup

Those are the steps to run the project manually:

  1. Install the library
pip install plzpy
  1. Download the dataset linked above:
curl -L https://opendata.arcgis.com/datasets/273bf4ae7f6a460fbf3000d73f7b2f76_0.csv?outSR=%7B%22latestWkid%22%3A3857%2C%22wkid%22%3A102100%7D -o /tmp/src.csv
  1. Massage the dataset to produce an optimized json to be served via the Rest API
plzpy massage --in /tmp/src.csv --out rest.json
  1. Run the Rest API service
plzpy serve --data rest.json

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for plzpy, version 0.1.0a0
Filename, size File type Python version Upload date Hashes
Filename, size plzpy-0.1.0a0-py3-none-any.whl (6.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size plzpy-0.1.0a0.tar.gz (5.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page