Skip to content

Commit

Permalink
changes to the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Lakshay-sethi committed Apr 23, 2021
1 parent ba2801a commit 7b201eb
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
12 changes: 10 additions & 2 deletions docs/source/user_guide/connector/query.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,15 @@
"```\n",
"df = await dc.query(\"tweets\", _q=\"COVID-19\", _count=50)\n",
"```\n",
"This query searches 50 results for tweets related to COVID-19 from Twitter search API."
"This query searches 50 results for tweets related to COVID-19 from Twitter search API.\n",
"\n",
"\n",
"* **Covid Tracking**\n",
"\n",
"```\n",
"df = await dc.query(\"state_historical\", state = \"mi\")\n",
"```\n",
"This query searches for Historical COVID-19 data in Michigan"
]
}
],
Expand All @@ -106,4 +114,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}
23 changes: 18 additions & 5 deletions examples/DataConnector_CovidTracking.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,32 @@
{
"source": [
"### Dynamic Url Creation\n",
"The Url genration method allows the user to create a url in which url can be chnaged to allow on the spot modification. The parameters passed from the query must meet the requirements as indicated in url for the operation to run.\n",
"The Url genration method allows the user to create a url in which url can be changed to allow on the spot modification. The parameters passed from the query must meet the requirements as indicated in url for the operation to run.\n",
"\n",
"For Example:\n",
"\n",
"http://api.covidtracking.com/v2/states/{state}/daily.json to http://api.covidtracking.com/v2/states/ny/daily.json \n",
"We have the following url, here you can see that, we have the ability to modify the url with any state we want.\n",
"http://api.covidtracking.com/v2/states/{state}/current.json \n",
"\n",
"where the state parameter is replaced by ny (Abbr. New York)\n",
"Lets suppose we want to retrieve data for New York. We would just inter-exchange the {state} variable with ny (Abbr. for New York)\n",
"http://api.covidtracking.com/v2/states/ny/current.json\n",
"\n",
"Now, let's try to get Historical COVID-19 data for a state in US from Covid Data API."
"Now seeing this you may be asking where do we pass the data we want to replace. This can be achived from by pacing the data as a parameter in the query function.\n",
"\n",
"Example:\n",
"\n",
"await dc.query(\"states\",state = \"ny\")\n",
"\n",
"Now, let's try to get Current COVID-19 data for a state in US from Covid Data API."
],
"cell_type": "markdown",
"metadata": {}
},
{
"source": [],
"cell_type": "markdown",
"metadata": {}
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -122,7 +135,7 @@
"metadata": {},
"source": [
"# That's all for now. \n",
"If you are interested in writing your own configuration file or modify an existing one, refer to the [Example folder](https://github.com/sfu-db/DataConnectorConfigs>). Change the link"
"If you are interested in writing your own configuration file or modify an existing one, refer to the [Example folder](<https://github.com/sfu-db/APIConnectors/tree/examples/examples>)."
]
}
],
Expand Down

0 comments on commit 7b201eb

Please sign in to comment.