Coder Social home page Coder Social logo

nyc_parking_violations's Introduction

Using NYC Open Parking and Camera Violations API

Requirements

This project uses NYC Parking Violations data from NYC Open Data. The data is pulled from Open Parking and Camera Violations (OPCV) API, which is made available via Socrata Open Data API. The app_token is necessary to access NYC Open Data APIs.

Docker Image for Accessing the API

The docker image for retrieving data from OPCV API can be pulled from this dockerhub profile, under nyc_parking_violations repository. The following command line can be used to access OPCV API data.

Using the API

$ docker run -e APP_KEY=YOUR_APP_TOKEN -t nyc_parking_violations:1.0 python -m main --page_size=1000 --page_num=4 --output=results.json

--page_size: This is a required command line argument that specified the number of results per page.

--page_num: This argument is optional, if not provided the API will return all of the available content.

--output: This argument is optional, if not included results will be printed to stdout.

Loading NYC Open Parking and Camera Violations API Results into Elasticsearch Using Docker-Compose

Loading Data into Elastic Search

The docker-compose.yml file was used here to configure three services. The main.py was altered to load data into elasticsearch.

The docker image for retrieving data from OPCV API and loading it into elasticsearch can be pulled from this dockerhub profile, under nyc_parking_violations_elasticsearch_kibana repository.

$ docker-compose run -e APP_KEY=YOUR_APP_TOKEN pyth python -m main --page_size=100 --page_num=1000

$ docker-compose run -e APP_KEY=YOUR_APP_TOKEN pyth python -m main --page_size=100 --page_num=1000 --output=results.json

100,000 of 48 million OPCV API rows of data were loaded into elasticsearch, the data can then be further processed in Kibana dev tools.

Kibana Visualizations

The following images were created in Kibana using the 100,000 rows from OPCV API that were loaded into the elasticsearch.

Ten most popular parking violations.

The average fine reduction amount by county.

The below table contains county data for median fine amount, count of parking violations, and maximum fine reduction.

Parking violations per year over a 10 year period.

nyc_parking_violations's People

Contributors

asyakhl avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.