Skip to content

Commit

Permalink
Merge pull request #1 from aakash0017/master
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
Nid989 authored Apr 27, 2021
2 parents fa5a699 + cfcad87 commit 405f98f
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 89 deletions.
111 changes: 111 additions & 0 deletions Notebooks Checkpoint/cms-queries.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{
"metadata": {
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
},
"orig_nbformat": 2,
"kernelspec": {
"name": "python385jvsc74a57bd00f9d6a5aaa2a7fee61cf68aafdfcdaf325adf07b0836eaa1104723ace1c314f3",
"display_name": "Python 3.8.5 64-bit ('base': conda)"
}
},
"nbformat": 4,
"nbformat_minor": 2,
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"import requests\n",
"\n",
"# url = 'http://localhost:1337/tests'\n",
"# myobj = {'Name': 'nidhir test1',\n",
"# 'Email': '[email protected]',\n",
"# 'Phoneno': 8384041898\n",
"# }\n",
"\n",
"# x = requests.post(url, data = myobj, headers = {\n",
"\n",
"# \"Authorization\": f\"Bearer {aakash_jwt}\"}\n",
"# )\n"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"aakash_jwt = \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYwODY1ZDUxMDZiZWQyZDhlYzZjNmJjNyIsImlhdCI6MTYxOTQxODU1OSwiZXhwIjoxNjIyMDEwNTU5fQ.Y52bTH80hazoVPomjX9jyE4LyyOKkEnZIRjAwgPeIuY\""
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"url = 'http://localhost:1337/tests'\n",
"myobj = {'Name': 'nidhir test1',\n",
" 'Email': '[email protected]',\n",
" 'Phoneno': 8384041898\n",
"}\n",
"\n",
"x = requests.get(url, headers = {\n",
"\n",
" \"Authorization\": f\"Bearer {aakash_jwt}\"}\n",
")\n"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"list"
]
},
"metadata": {},
"execution_count": 7
}
],
"source": [
"type(x.json())"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"myobj = {'Name': 'nidhir test1',\n",
" 'Email': '[email protected]',\n",
" 'Phoneno': 8384041898\n",
"}"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
]
}
Empty file removed cms-queries/get-data.py
Empty file.
Empty file removed cms-queries/post-data.py
Empty file.
18 changes: 18 additions & 0 deletions cms-queries/queries.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import requests

aakash_jwt = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYwODY1ZDUxMDZiZWQyZDhlYzZjNmJjNyIsImlhdCI6MTYxOTQxODU1OSwiZXhwIjoxNjIyMDEwNTU5fQ.Y52bTH80hazoVPomjX9jyE4LyyOKkEnZIRjAwgPeIuY"


def get_request(endpoint, environment = 'local', url = 'http://localhost:1337/'):

url = url + endpoint
res = requests.get(url, headers = {"Authorization": f"Bearer {aakash_jwt}"})
return res.json()


def post_request(endpoint, body, environment = 'local', url = 'http://localhost:1337/'):

url = url + endpoint
res = requests.post(url, data = body, headers = {"Authorization": f"Bearer {aakash_jwt}"} )
return res.json()

2 changes: 1 addition & 1 deletion user_utility/user_utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ def example():
dict_ = dict(zip(list_, [0]*len(list_)))
return update_dict(dict_, 'Oximeter')

# print(example())
print(example())
4 changes: 2 additions & 2 deletions utility/_utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ def most_similar(user_input, input_type):


def load_cities():
return np.load('../data/cities.npy', allow_pickle=True)
return np.load('data/cities.npy', allow_pickle=True)

def load_resources():
return np.load('../data/res.npy', allow_pickle=True)
return np.load('data/res.npy', allow_pickle=True)

print(take_input('res'))
86 changes: 0 additions & 86 deletions utility/utility.py

This file was deleted.

0 comments on commit 405f98f

Please sign in to comment.