From 0c70b5c6842444cee8ec25f091a4b85ec378cc88 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Wed, 3 Apr 2019 16:23:51 +0530 Subject: Adding Files --- PyAto_navanchauhan.egg-info/PKG-INFO | 16 ++++++ PyAto_navanchauhan.egg-info/SOURCES.txt | 7 +++ PyAto_navanchauhan.egg-info/dependency_links.txt | 1 + PyAto_navanchauhan.egg-info/top_level.txt | 1 + __pycache__/pyato.cpython-37.pyc | Bin 0 -> 2025 bytes build/lib/PyAto/PyAto.py | 59 +++++++++++++++++++++++ build/lib/PyAto/__init__.py | 59 +++++++++++++++++++++++ dist/PyAto-navanchauhan-0.0.1.tar.gz | Bin 0 -> 1560 bytes dist/PyAto-navanchauhan-0.0.2.tar.gz | Bin 0 -> 1575 bytes dist/PyAto-navanchauhan-0.0.3.tar.gz | Bin 0 -> 1490 bytes dist/PyAto_navanchauhan-0.0.1-py3-none-any.whl | Bin 0 -> 2958 bytes dist/PyAto_navanchauhan-0.0.1-py3.7.egg | Bin 0 -> 3021 bytes dist/PyAto_navanchauhan-0.0.2-py3-none-any.whl | Bin 0 -> 3447 bytes dist/PyAto_navanchauhan-0.0.2-py3.7.egg | Bin 0 -> 4163 bytes dist/PyAto_navanchauhan-0.0.3-py3-none-any.whl | Bin 0 -> 3447 bytes pyato.py | 59 +++++++++++++++++++++++ setup.py | 22 +++++++++ 17 files changed, 224 insertions(+) create mode 100644 PyAto_navanchauhan.egg-info/PKG-INFO create mode 100644 PyAto_navanchauhan.egg-info/SOURCES.txt create mode 100644 PyAto_navanchauhan.egg-info/dependency_links.txt create mode 100644 PyAto_navanchauhan.egg-info/top_level.txt create mode 100644 __pycache__/pyato.cpython-37.pyc create mode 100644 build/lib/PyAto/PyAto.py create mode 100644 build/lib/PyAto/__init__.py create mode 100644 dist/PyAto-navanchauhan-0.0.1.tar.gz create mode 100644 dist/PyAto-navanchauhan-0.0.2.tar.gz create mode 100644 dist/PyAto-navanchauhan-0.0.3.tar.gz create mode 100644 dist/PyAto_navanchauhan-0.0.1-py3-none-any.whl create mode 100644 dist/PyAto_navanchauhan-0.0.1-py3.7.egg create mode 100644 dist/PyAto_navanchauhan-0.0.2-py3-none-any.whl create mode 100644 dist/PyAto_navanchauhan-0.0.2-py3.7.egg create mode 100644 dist/PyAto_navanchauhan-0.0.3-py3-none-any.whl create mode 100644 pyato.py create mode 100644 setup.py diff --git a/PyAto_navanchauhan.egg-info/PKG-INFO b/PyAto_navanchauhan.egg-info/PKG-INFO new file mode 100644 index 0000000..cfc6167 --- /dev/null +++ b/PyAto_navanchauhan.egg-info/PKG-INFO @@ -0,0 +1,16 @@ +Metadata-Version: 2.1 +Name: PyAto-navanchauhan +Version: 0.0.3 +Summary: Python Wrapper for Zomato API +Home-page: https://github.com/navanchauhan/PyAto +Author: Navan Chauhan +Author-email: navanchauhan@gmail.com +License: UNKNOWN +Description: # PyAto + A Python Wrapper for the Zomato API + +Platform: UNKNOWN +Classifier: Programming Language :: Python :: 3 +Classifier: License :: OSI Approved :: MIT License +Classifier: Operating System :: OS Independent +Description-Content-Type: text/markdown diff --git a/PyAto_navanchauhan.egg-info/SOURCES.txt b/PyAto_navanchauhan.egg-info/SOURCES.txt new file mode 100644 index 0000000..05ed769 --- /dev/null +++ b/PyAto_navanchauhan.egg-info/SOURCES.txt @@ -0,0 +1,7 @@ +README.md +setup.py +PyAto/__init__.py +PyAto_navanchauhan.egg-info/PKG-INFO +PyAto_navanchauhan.egg-info/SOURCES.txt +PyAto_navanchauhan.egg-info/dependency_links.txt +PyAto_navanchauhan.egg-info/top_level.txt \ No newline at end of file diff --git a/PyAto_navanchauhan.egg-info/dependency_links.txt b/PyAto_navanchauhan.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/PyAto_navanchauhan.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/PyAto_navanchauhan.egg-info/top_level.txt b/PyAto_navanchauhan.egg-info/top_level.txt new file mode 100644 index 0000000..904ab14 --- /dev/null +++ b/PyAto_navanchauhan.egg-info/top_level.txt @@ -0,0 +1 @@ +PyAto diff --git a/__pycache__/pyato.cpython-37.pyc b/__pycache__/pyato.cpython-37.pyc new file mode 100644 index 0000000..8b9262c Binary files /dev/null and b/__pycache__/pyato.cpython-37.pyc differ diff --git a/build/lib/PyAto/PyAto.py b/build/lib/PyAto/PyAto.py new file mode 100644 index 0000000..08d05f8 --- /dev/null +++ b/build/lib/PyAto/PyAto.py @@ -0,0 +1,59 @@ +import requests + +#We set the headers globally as the header remains the same for almmost all requests +def setAPIKey(secret): + apikey = secret + global headers + headers = { + 'Accept': 'application/json', + 'user-key': apikey, + } + + +# Get Categories Function + +def getCategories(): + response = requests.get('https://developers.zomato.com/api/v2.1/categories', headers=headers) + return response.json() + +# Get Cities function. Only takes City Name. Returns JSON + +def getCities(name): + params = (('q', name),) + response = requests.get('https://developers.zomato.com/api/v2.1/cities', headers=headers, params=params) + return response.json()['location_suggestions'][0] + +# Get Collections Function. Only takes City ID. Returns JSON + +def getCollections(city_id): + params = (('city_id', city_id),) + response = requests.get('https://developers.zomato.com/api/v2.1/collections', headers=headers, params=params) + return response.json() + +# Get Cuisines Function. Only takes City ID. Returns JSON + +def getCuisines(city_id): + params = (('city_id', city_id),) + response = requests.get('https://developers.zomato.com/api/v2.1/cuisines', headers=headers, params=params) + return response.json() + +# Get Establishments Function. Only takes City ID. Returns JSON + +def getEstablishments(city_id): + params = (('city_id', '1'),) + response = requests.get('https://developers.zomato.com/api/v2.1/establishments', headers=headers, params=params) + return response.json() + +# Geocoding Function. Takes Latitude and Longitude. Returns JSON + +def getGeocode(lat, lon): + params = (('lat', lat),('lon', lon),) + response = requests.get('https://developers.zomato.com/api/v2.1/geocode', headers=headers, params=params) + return response.json() + +# Gets the City ID, Takes City Name and returns integer + +def getCityID(name): + params = (('q', name),) + response = requests.get('https://developers.zomato.com/api/v2.1/cities', headers=headers, params=params) + return response.json()['location_suggestions'][0]['id'] diff --git a/build/lib/PyAto/__init__.py b/build/lib/PyAto/__init__.py new file mode 100644 index 0000000..4757eaf --- /dev/null +++ b/build/lib/PyAto/__init__.py @@ -0,0 +1,59 @@ +name = "PyAto" + +def setAPIKey(secret): + apikey = secret + global headers + headers = { + 'Accept': 'application/json', + 'user-key': apikey, + } + + +# Get Categories Function + +def getCategories(): + response = requests.get('https://developers.zomato.com/api/v2.1/categories', headers=headers) + return response.json() + +# Get Cities function. Only takes City Name. Returns JSON + +def getCities(name): + params = (('q', name),) + response = requests.get('https://developers.zomato.com/api/v2.1/cities', headers=headers, params=params) + return response.json()['location_suggestions'][0] + +# Get Collections Function. Only takes City ID. Returns JSON + +def getCollections(city_id): + params = (('city_id', city_id),) + response = requests.get('https://developers.zomato.com/api/v2.1/collections', headers=headers, params=params) + return response.json() + +# Get Cuisines Function. Only takes City ID. Returns JSON + +def getCuisines(city_id): + params = (('city_id', city_id),) + response = requests.get('https://developers.zomato.com/api/v2.1/cuisines', headers=headers, params=params) + return response.json() + +# Get Establishments Function. Only takes City ID. Returns JSON + +def getEstablishments(city_id): + params = (('city_id', '1'),) + response = requests.get('https://developers.zomato.com/api/v2.1/establishments', headers=headers, params=params) + return response.json() + +# Geocoding Function. Takes Latitude and Longitude. Returns JSON + +def getGeocode(lat, lon): + params = (('lat', lat),('lon', lon),) + response = requests.get('https://developers.zomato.com/api/v2.1/geocode', headers=headers, params=params) + return response.json() + +# Gets the City ID, Takes City Name and returns integer + +def getCityID(name): + params = (('q', name),) + response = requests.get('https://developers.zomato.com/api/v2.1/cities', headers=headers, params=params) + return response.json()['location_suggestions'][0]['id'] + diff --git a/dist/PyAto-navanchauhan-0.0.1.tar.gz b/dist/PyAto-navanchauhan-0.0.1.tar.gz new file mode 100644 index 0000000..1930746 Binary files /dev/null and b/dist/PyAto-navanchauhan-0.0.1.tar.gz differ diff --git a/dist/PyAto-navanchauhan-0.0.2.tar.gz b/dist/PyAto-navanchauhan-0.0.2.tar.gz new file mode 100644 index 0000000..c378f0b Binary files /dev/null and b/dist/PyAto-navanchauhan-0.0.2.tar.gz differ diff --git a/dist/PyAto-navanchauhan-0.0.3.tar.gz b/dist/PyAto-navanchauhan-0.0.3.tar.gz new file mode 100644 index 0000000..3049e34 Binary files /dev/null and b/dist/PyAto-navanchauhan-0.0.3.tar.gz differ diff --git a/dist/PyAto_navanchauhan-0.0.1-py3-none-any.whl b/dist/PyAto_navanchauhan-0.0.1-py3-none-any.whl new file mode 100644 index 0000000..8b2ca14 Binary files /dev/null and b/dist/PyAto_navanchauhan-0.0.1-py3-none-any.whl differ diff --git a/dist/PyAto_navanchauhan-0.0.1-py3.7.egg b/dist/PyAto_navanchauhan-0.0.1-py3.7.egg new file mode 100644 index 0000000..da02a54 Binary files /dev/null and b/dist/PyAto_navanchauhan-0.0.1-py3.7.egg differ diff --git a/dist/PyAto_navanchauhan-0.0.2-py3-none-any.whl b/dist/PyAto_navanchauhan-0.0.2-py3-none-any.whl new file mode 100644 index 0000000..d64149d Binary files /dev/null and b/dist/PyAto_navanchauhan-0.0.2-py3-none-any.whl differ diff --git a/dist/PyAto_navanchauhan-0.0.2-py3.7.egg b/dist/PyAto_navanchauhan-0.0.2-py3.7.egg new file mode 100644 index 0000000..2d2d96b Binary files /dev/null and b/dist/PyAto_navanchauhan-0.0.2-py3.7.egg differ diff --git a/dist/PyAto_navanchauhan-0.0.3-py3-none-any.whl b/dist/PyAto_navanchauhan-0.0.3-py3-none-any.whl new file mode 100644 index 0000000..c5b6922 Binary files /dev/null and b/dist/PyAto_navanchauhan-0.0.3-py3-none-any.whl differ diff --git a/pyato.py b/pyato.py new file mode 100644 index 0000000..08d05f8 --- /dev/null +++ b/pyato.py @@ -0,0 +1,59 @@ +import requests + +#We set the headers globally as the header remains the same for almmost all requests +def setAPIKey(secret): + apikey = secret + global headers + headers = { + 'Accept': 'application/json', + 'user-key': apikey, + } + + +# Get Categories Function + +def getCategories(): + response = requests.get('https://developers.zomato.com/api/v2.1/categories', headers=headers) + return response.json() + +# Get Cities function. Only takes City Name. Returns JSON + +def getCities(name): + params = (('q', name),) + response = requests.get('https://developers.zomato.com/api/v2.1/cities', headers=headers, params=params) + return response.json()['location_suggestions'][0] + +# Get Collections Function. Only takes City ID. Returns JSON + +def getCollections(city_id): + params = (('city_id', city_id),) + response = requests.get('https://developers.zomato.com/api/v2.1/collections', headers=headers, params=params) + return response.json() + +# Get Cuisines Function. Only takes City ID. Returns JSON + +def getCuisines(city_id): + params = (('city_id', city_id),) + response = requests.get('https://developers.zomato.com/api/v2.1/cuisines', headers=headers, params=params) + return response.json() + +# Get Establishments Function. Only takes City ID. Returns JSON + +def getEstablishments(city_id): + params = (('city_id', '1'),) + response = requests.get('https://developers.zomato.com/api/v2.1/establishments', headers=headers, params=params) + return response.json() + +# Geocoding Function. Takes Latitude and Longitude. Returns JSON + +def getGeocode(lat, lon): + params = (('lat', lat),('lon', lon),) + response = requests.get('https://developers.zomato.com/api/v2.1/geocode', headers=headers, params=params) + return response.json() + +# Gets the City ID, Takes City Name and returns integer + +def getCityID(name): + params = (('q', name),) + response = requests.get('https://developers.zomato.com/api/v2.1/cities', headers=headers, params=params) + return response.json()['location_suggestions'][0]['id'] diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..2c64dd5 --- /dev/null +++ b/setup.py @@ -0,0 +1,22 @@ +import setuptools + +with open("README.md", "r") as fh: + long_description = fh.read() + +setuptools.setup( + name="PyAto-navanchauhan", + version="0.0.3", + author="Navan Chauhan", + author_email="navanchauhan@gmail.com", + description="Python Wrapper for Zomato API", + long_description=long_description, + long_description_content_type="text/markdown", + url="https://github.com/navanchauhan/PyAto", + packages=setuptools.find_packages(), + classifiers=[ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + ], +) + -- cgit v1.2.3