Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ryankanno/nyc-restaurant-inspections-api
NYC Restaurant Inspection API
https://github.com/ryankanno/nyc-restaurant-inspections-api
Last synced: 11 days ago
JSON representation
NYC Restaurant Inspection API
- Host: GitHub
- URL: https://github.com/ryankanno/nyc-restaurant-inspections-api
- Owner: ryankanno
- License: bsd-3-clause
- Archived: true
- Created: 2012-07-14T20:14:21.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2015-08-08T08:24:52.000Z (over 9 years ago)
- Last Synced: 2024-08-02T14:12:27.592Z (4 months ago)
- Language: Python
- Homepage:
- Size: 36 MB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES
- License: LICENSE
Awesome Lists containing this project
README
.. image:: https://travis-ci.org/ryankanno/nyc-restaurant-inspections-api.svg?branch=master
:target: https://travis-ci.org/ryankanno/nyc-restaurant-inspections-api.. image:: https://coveralls.io/repos/ryankanno/nyc-restaurant-inspections-api/badge.svg?branch=master&service=github
:target: https://coveralls.io/github/ryankanno/nyc-restaurant-inspections-api?branch=masterAPI for NYC restaurant inspections
==================================A Flask + Redis weekend project that returns NYC restaurant inspection data.
Data courtesy of https://data.cityofnewyork.us/Health/DOHMH-New-York-City-Restaurant-Inspection-Results/xx67-kt59
Install
=======* Install redis-server (sudo port install redis-server, brew install redis)
* Install the requirements by running `pip install -r requirements.txt`Download the Socrata data
-------------------------To download the socrata, run the following command:
.. code:: python
python manage.py download_data
Make sure to remember the output file path (or pass in a path of your own)
.. code:: python
python manage.py download_data --help
Create the database
-------------------To create the database, run the following command:
.. code:: python
python manage.py create_db
Seed the database
-----------------To seed the database, run the following command:
.. code:: python
python manage.py seed_db -f
Run Server
----------To run the server, run the following command:
.. code:: python
python manage.py runserver
Drop the database
-----------------After you're done playing with this magical goodness,
to drop the database, run the following command:.. code:: python
python manage.py drop_db
Examples
========Here are some curl commands to play around with the api:
**Finding all restaurants (and inspections) with Japanese in their name**
.. code::
curl -s -H "Accept: application/json" -d "name=Japanese" http://localhost:5000/restaurants/by_name | python -mjson.tool
**Finding all restaurants (and inspections) with Japanese cuisine**
.. code::
curl -s -H "Accept: application/json" -d "cuisine=Japanese" http://localhost:5000/restaurants/by_cuisine | python -mjson.tool
**Finding restaurant with id 10**
.. code::
curl -s -H "Accept: application/json" http://localhost:5000/restaurants/10 | python -mjson.tool
TODO
====License
=======
MIT