aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--PyAto_navanchauhan.egg-info/PKG-INFO16
-rw-r--r--PyAto_navanchauhan.egg-info/SOURCES.txt7
-rw-r--r--PyAto_navanchauhan.egg-info/dependency_links.txt1
-rw-r--r--PyAto_navanchauhan.egg-info/top_level.txt1
-rw-r--r--__pycache__/pyato.cpython-37.pycbin0 -> 2025 bytes
-rw-r--r--build/lib/PyAto/PyAto.py59
-rw-r--r--build/lib/PyAto/__init__.py59
-rw-r--r--dist/PyAto-navanchauhan-0.0.1.tar.gzbin0 -> 1560 bytes
-rw-r--r--dist/PyAto-navanchauhan-0.0.2.tar.gzbin0 -> 1575 bytes
-rw-r--r--dist/PyAto-navanchauhan-0.0.3.tar.gzbin0 -> 1490 bytes
-rw-r--r--dist/PyAto_navanchauhan-0.0.1-py3-none-any.whlbin0 -> 2958 bytes
-rw-r--r--dist/PyAto_navanchauhan-0.0.1-py3.7.eggbin0 -> 3021 bytes
-rw-r--r--dist/PyAto_navanchauhan-0.0.2-py3-none-any.whlbin0 -> 3447 bytes
-rw-r--r--dist/PyAto_navanchauhan-0.0.2-py3.7.eggbin0 -> 4163 bytes
-rw-r--r--dist/PyAto_navanchauhan-0.0.3-py3-none-any.whlbin0 -> 3447 bytes
-rw-r--r--pyato.py59
-rw-r--r--setup.py22
17 files changed, 224 insertions, 0 deletions
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
--- /dev/null
+++ b/__pycache__/pyato.cpython-37.pyc
Binary files 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
--- /dev/null
+++ b/dist/PyAto-navanchauhan-0.0.1.tar.gz
Binary files 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
--- /dev/null
+++ b/dist/PyAto-navanchauhan-0.0.2.tar.gz
Binary files 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
--- /dev/null
+++ b/dist/PyAto-navanchauhan-0.0.3.tar.gz
Binary files 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
--- /dev/null
+++ b/dist/PyAto_navanchauhan-0.0.1-py3-none-any.whl
Binary files 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
--- /dev/null
+++ b/dist/PyAto_navanchauhan-0.0.1-py3.7.egg
Binary files 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
--- /dev/null
+++ b/dist/PyAto_navanchauhan-0.0.2-py3-none-any.whl
Binary files 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
--- /dev/null
+++ b/dist/PyAto_navanchauhan-0.0.2-py3.7.egg
Binary files 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
--- /dev/null
+++ b/dist/PyAto_navanchauhan-0.0.3-py3-none-any.whl
Binary files 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",
+ ],
+)
+