Skip to content

Commit

Permalink
Sunday push β˜€οΈ
Browse files Browse the repository at this point in the history
almost done rebasing with the drivers and historical templates
  • Loading branch information
jravenel committed Feb 28, 2021
1 parent b8396e1 commit 75ce9cf
Show file tree
Hide file tree
Showing 54 changed files with 1,709 additions and 1,962 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,66 +2,36 @@
"cells": [
{
"cell_type": "markdown",
"id": "material-disney",
"id": "thermal-speed",
"metadata": {},
"source": [
"<img width=\"10%\" alt=\"Naas\" src=\"https://landen.imgix.net/jtci2pxwjczr/assets/5ice39g4.png?w=160\"/>\n",
"\n",
"# Cryto - Bitcoin - Calculate Support and resistance "
]
},
{
"cell_type": "markdown",
"id": "liberal-bosnia",
"metadata": {},
"source": [
"Prerequisite : get binance API Key"
]
},
{
"cell_type": "code",
"execution_count": 38,
"id": "departmental-washer",
"metadata": {
"execution": {
"iopub.execute_input": "2021-01-29T10:35:02.766006Z",
"iopub.status.busy": "2021-01-29T10:35:02.765667Z",
"iopub.status.idle": "2021-01-29T10:35:34.346228Z",
"shell.execute_reply": "2021-01-29T10:35:34.345393Z",
"shell.execute_reply.started": "2021-01-29T10:35:02.765970Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: trendln in /opt/conda/lib/python3.8/site-packages (0.1.10)\n",
"Collecting matplotlib==3.1.3\n",
" Using cached matplotlib-3.1.3-cp38-cp38-manylinux1_x86_64.whl (13.1 MB)\n",
"Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /opt/conda/lib/python3.8/site-packages (from matplotlib==3.1.3) (2.4.7)\n",
"Requirement already satisfied: cycler>=0.10 in /opt/conda/lib/python3.8/site-packages (from matplotlib==3.1.3) (0.10.0)\n",
"Requirement already satisfied: kiwisolver>=1.0.1 in /opt/conda/lib/python3.8/site-packages (from matplotlib==3.1.3) (1.3.1)\n",
"Requirement already satisfied: numpy>=1.11 in /opt/conda/lib/python3.8/site-packages (from matplotlib==3.1.3) (1.19.5)\n",
"Requirement already satisfied: python-dateutil>=2.1 in /opt/conda/lib/python3.8/site-packages (from matplotlib==3.1.3) (2.8.1)\n",
"Requirement already satisfied: six in /opt/conda/lib/python3.8/site-packages (from cycler>=0.10->matplotlib==3.1.3) (1.15.0)\n",
"Requirement already satisfied: pandas>=0.23.1 in /opt/conda/lib/python3.8/site-packages (from trendln) (1.2.1)\n",
"Requirement already satisfied: scikit-image>=0.14.0 in /opt/conda/lib/python3.8/site-packages (from trendln) (0.18.1)\n",
"Requirement already satisfied: findiff>=0.7.0 in /opt/conda/lib/python3.8/site-packages (from trendln) (0.8.7)\n",
"Requirement already satisfied: scipy in /opt/conda/lib/python3.8/site-packages (from findiff>=0.7.0->trendln) (1.6.0)\n",
"Requirement already satisfied: pytz>=2017.3 in /opt/conda/lib/python3.8/site-packages (from pandas>=0.23.1->trendln) (2020.5)\n",
"Requirement already satisfied: imageio>=2.3.0 in /home/ftp/.local/lib/python3.8/site-packages (from scikit-image>=0.14.0->trendln) (2.9.0)\n",
"Requirement already satisfied: PyWavelets>=1.1.1 in /opt/conda/lib/python3.8/site-packages (from scikit-image>=0.14.0->trendln) (1.1.1)\n",
"Requirement already satisfied: pillow!=7.1.0,!=7.1.1,>=4.3.0 in /opt/conda/lib/python3.8/site-packages (from scikit-image>=0.14.0->trendln) (8.1.0)\n",
"Requirement already satisfied: networkx>=2.0 in /opt/conda/lib/python3.8/site-packages (from scikit-image>=0.14.0->trendln) (2.5)\n",
"Requirement already satisfied: tifffile>=2019.7.26 in /opt/conda/lib/python3.8/site-packages (from scikit-image>=0.14.0->trendln) (2021.1.14)\n",
"Requirement already satisfied: decorator>=4.3.0 in /opt/conda/lib/python3.8/site-packages (from networkx>=2.0->scikit-image>=0.14.0->trendln) (4.4.2)\n",
"Installing collected packages: matplotlib\n",
"Successfully installed matplotlib-3.1.3\n",
"Note: you may need to restart the kernel to use updated packages.\n"
]
}
],
"execution_count": null,
"id": "sustainable-xerox",
"metadata": {},
"outputs": [],
"source": [
"pip install trendln matplotlib==3.1.3 --user"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "rational-scroll",
"id": "fifty-tackle",
"metadata": {
"execution": {
"iopub.execute_input": "2021-01-29T11:26:02.833155Z",
Expand All @@ -84,7 +54,7 @@
{
"cell_type": "code",
"execution_count": 2,
"id": "conditional-colors",
"id": "sublime-policy",
"metadata": {
"execution": {
"iopub.execute_input": "2021-01-29T11:26:04.853895Z",
Expand All @@ -106,7 +76,7 @@
{
"cell_type": "code",
"execution_count": 3,
"id": "individual-jimmy",
"id": "beautiful-banner",
"metadata": {
"execution": {
"iopub.execute_input": "2021-01-29T11:26:05.497791Z",
Expand Down Expand Up @@ -282,7 +252,7 @@
{
"cell_type": "code",
"execution_count": 47,
"id": "particular-insurance",
"id": "brown-consent",
"metadata": {
"execution": {
"iopub.execute_input": "2021-01-29T11:43:07.295709Z",
Expand Down Expand Up @@ -326,7 +296,7 @@
{
"cell_type": "code",
"execution_count": 48,
"id": "brazilian-channel",
"id": "chicken-banana",
"metadata": {
"execution": {
"iopub.execute_input": "2021-01-29T11:43:08.276428Z",
Expand Down Expand Up @@ -378,7 +348,7 @@
{
"cell_type": "code",
"execution_count": 49,
"id": "victorian-script",
"id": "developing-breathing",
"metadata": {
"execution": {
"iopub.execute_input": "2021-01-29T11:43:09.243390Z",
Expand Down Expand Up @@ -1736,7 +1706,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "industrial-advocacy",
"id": "developed-original",
"metadata": {},
"outputs": [],
"source": []
Expand Down

Large diffs are not rendered by default.

44 changes: 11 additions & 33 deletions Cityfalcon/Cityfalcon_Get_data_from_API.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,30 @@
"cells": [
{
"cell_type": "markdown",
"id": "arbitrary-federal",
"id": "congressional-lincoln",
"metadata": {},
"source": [
"# Cityfalcon - Get data from API"
"<img width=\"10%\" alt=\"Naas\" src=\"https://landen.imgix.net/jtci2pxwjczr/assets/5ice39g4.png?w=160\"/>"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "micro-extension",
"metadata": {
"execution": {
"iopub.execute_input": "2021-02-23T06:47:47.509680Z",
"iopub.status.busy": "2021-02-23T06:47:47.509413Z",
"iopub.status.idle": "2021-02-23T06:47:51.117258Z",
"shell.execute_reply": "2021-02-23T06:47:51.116261Z",
"shell.execute_reply.started": "2021-02-23T06:47:47.509610Z"
}
},
"outputs": [
{
"ename": "KeyError",
"evalue": "'stories'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mKeyError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-1-13ec0095affd>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mnaas_drivers\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mnaas_drivers\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcityfalcon\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mconnect\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"YOUR_API_KEY\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"TSLA\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m/opt/conda/lib/python3.8/site-packages/naas_drivers/input/cityfalcon.py\u001b[0m in \u001b[0;36mget\u001b[0;34m(self, action, fields, country, limit, min_score, paywall, identifier_type, time_filter, languages)\u001b[0m\n\u001b[1;32m 76\u001b[0m \u001b[0mreq\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mrequests\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0murl\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 77\u001b[0m \u001b[0mdict_news\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mreq\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjson\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 78\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mconvert_data_to_df\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdict_news\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfields\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlimit\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m/opt/conda/lib/python3.8/site-packages/naas_drivers/input/cityfalcon.py\u001b[0m in \u001b[0;36mconvert_data_to_df\u001b[0;34m(self, data, fields, limit)\u001b[0m\n\u001b[1;32m 18\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mconvert_data_to_df\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfields\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlimit\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mDataFrame\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 19\u001b[0m \u001b[0mnews\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 20\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0melement\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"stories\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 21\u001b[0m \u001b[0mnew_formated\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m{\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 22\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mfield\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mfields\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mKeyError\u001b[0m: 'stories'"
]
}
],
"cell_type": "markdown",
"id": "great-basket",
"metadata": {},
"source": [
"import naas_drivers\n",
"naas_drivers.cityfalcon.connect(\"YOUR_API_KEY\").get(\"TSLA\")"
"# Cityfalcon - Get data from API"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "english-witness",
"id": "tracked-cleaner",
"metadata": {},
"outputs": [],
"source": []
"source": [
"import naas_drivers\n",
"naas_drivers.cityfalcon.connect(\"YOUR_API_KEY\").get(\"TSLA\")"
]
}
],
"metadata": {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 75ce9cf

Please sign in to comment.