diff --git a/examples/README.md b/examples/README.md index d12e8626fb8..1d5f487e5c7 100644 --- a/examples/README.md +++ b/examples/README.md @@ -59,3 +59,7 @@ This notebook demonstrates how to fetch and work with options chains data. - Calculate and visualize the Net Delta Exposure, in dollars, by strike and expiration. - Visualize the term structure of the implied volatility skew. - Get tables with multiple single-leg options strategies. + +### googleColabInstallation + +This notebook demonstrates how to install the OpenBB SDK within Google Colab. diff --git a/examples/googleColabInstallation.ipynb b/examples/googleColabInstallation.ipynb new file mode 100644 index 00000000000..78d3f1532f5 --- /dev/null +++ b/examples/googleColabInstallation.ipynb @@ -0,0 +1,2491 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "provenance": [] + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + }, + "widgets": { + "application/vnd.jupyter.widget-state+json": { + "1c14db4b3fa04b67a7265adda2672f58": { + "model_module": "@jupyter-widgets/controls", + "model_name": "DropdownModel", + "model_module_version": "2.0.0", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "2.0.0", + "_model_name": "DropdownModel", + "_options_labels": [ + "Cash and cash equivalents", + "Other short-term investments", + "Total cash", + "Net receivables", + "Inventory", + "Other current assets", + "Total current assets", + "Gross property plant and equipment", + "Accumulated depreciation", + "Net property plant and equipment", + "Equity and other investments", + "Other long-term assets", + "Total non-current assets", + "Total assets", + "Current debt", + "Accounts payable", + "Deferred revenues", + "Other current liabilities", + "Total current liabilities", + "Long-term debt", + "Other long-term liabilities", + "Total non-current liabilities", + "Total liabilities", + "Common stock", + "Retained earnings", + "Accumulated other comprehensive income", + "Total stockholders' equity", + "Total liabilities and stockholders' equity" + ], + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "2.0.0", + "_view_name": "DropdownView", + "description": "", + "description_allow_html": false, + "disabled": false, + "index": 2, + "layout": "IPY_MODEL_5038c42252f245e4906d27a68f23d7cd", + "style": "IPY_MODEL_ce2de0778cf24736b3ed515792072c94", + "tabbable": null, + "tooltip": null + } + }, + "5038c42252f245e4906d27a68f23d7cd": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "model_module_version": "2.0.0", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "2.0.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "2.0.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border_bottom": null, + "border_left": null, + "border_right": null, + "border_top": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "ce2de0778cf24736b3ed515792072c94": { + "model_module": "@jupyter-widgets/controls", + "model_name": "DescriptionStyleModel", + "model_module_version": "2.0.0", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "2.0.0", + "_model_name": "DescriptionStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "2.0.0", + "_view_name": "StyleView", + "description_width": "" + } + } + } + } + }, + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "LNE5BHdkQ6cY" + }, + "outputs": [], + "source": [ + "# You can ignore the red warning messages.\n", + "# The nightly distribution is built from the develop branch on GitHub every night, and will contain bug fixes not available on PyPI.\n", + "# To not use the nightly distribution, run `!pip install openbb`\n", + "# To install locally, follow the instructions here: https://docs.openbb.co/terminal/installation/source\n", + "\n", + "!pip install openbb-nightly" + ] + }, + { + "cell_type": "code", + "source": [ + "# First, restart the runtime by clicking the button.\n", + "\n", + "# Import statements - for many scenarios, the only import needed will be `from openbb_terminal.sdk import openbb`\n", + "\n", + "from IPython.display import display\n", + "from IPython.display import clear_output\n", + "import ipywidgets as widgets\n", + "import numpy as np\n", + "import pandas as pd\n", + "import pandas_ta as ta\n", + "from datetime import datetime\n", + "\n", + "from openbb_terminal.sdk import openbb\n", + "from openbb_terminal import OpenBBFigure\n", + "\n", + "pd.options.plotting.backend = \"plotly\"\n", + "\n", + "# The output of this block can be ignored. The forecast components are not currently compatible with CoLabs.\n", + "# Documentation is found here: https://docs.openbb.co/sdk/usage/basics\n", + "# For additional example notebooks, see: https://my.openbb.co/app/sdk/examples\n", + "# Enter API credentials and generate a personal access token to login remotely: https://my.openbb.co/app/sdk/api-keys" + ], + "metadata": { + "id": "YqSodJvmQ87R" + }, + "execution_count": 3, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "# Login with:\n", + "\n", + "#openbb.login(token=\"REPLACE_WITH_PAT\")" + ], + "metadata": { + "id": "KkwFZdBqpmvr" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "symbol= \"AAPL\"" + ], + "metadata": { + "id": "oWTfr457h470" + }, + "execution_count": 2, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "data = openbb.stocks.load(symbol)[\"Close\"].pct_change(21)\n", + "data.tail(2)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 107 + }, + "id": "Kwc9TSwXd8jm", + "outputId": "9453751b-5dd1-4961-ab48-8850e89660ef" + }, + "execution_count": 4, + "outputs": [ + { + "output_type": "display_data", + "data": { + "text/plain": [ + "Loading Daily data for AAPL with starting period 2020-08-04.\n" + ], + "text/html": [ + "
Loading Daily data for AAPL with starting period 2020-08-04.\n",
+              "
\n" + ] + }, + "metadata": {} + }, + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "date\n", + "2023-08-08 -0.046710\n", + "2023-08-09 -0.045613\n", + "Name: Close, dtype: float64" + ] + }, + "metadata": {}, + "execution_count": 4 + } + ] + }, + { + "cell_type": "code", + "source": [ + "# Generate output without loading to a variable.\n", + "\n", + "openbb.stocks.load(symbol)[\"Close\"].pct_change(21).plot()" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 559 + }, + "id": "BgmixSVBYd_N", + "outputId": "bdcb310f-027f-43f9-9fa2-d63114326ebd" + }, + "execution_count": 5, + "outputs": [ + { + "output_type": "display_data", + "data": { + "text/plain": [ + "Loading Daily data for AAPL with starting period 2020-08-04.\n" + ], + "text/html": [ + "
Loading Daily data for AAPL with starting period 2020-08-04.\n",
+              "
\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/html": [ + "\n", + "\n", + "\n", + "
\n", + "
\n", + "\n", + "" + ] + }, + "metadata": {} + } + ] + }, + { + "cell_type": "code", + "source": [ + "# This loads the complete options chain for a symbol, and binds class methods to the response object.\n", + "\n", + "options = openbb.stocks.options.load_options_chains(symbol)\n", + "\n", + "options.get_strategies()" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 1000 + }, + "id": "Qrv_m3gTh0XE", + "outputId": "1aaf4a3c-d0a3-4268-f134-33c5e5141415" + }, + "execution_count": 6, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + " Expiration DTE Strategy Underlying Price Strike 1 Strike 2 \\\n", + "0 2023-08-11 2 Long Straddle 179.42 180.0 180.0 \n", + "1 2023-08-18 9 Long Straddle 179.42 180.0 180.0 \n", + "2 2023-08-25 16 Long Straddle 179.42 180.0 180.0 \n", + "3 2023-09-01 23 Long Straddle 179.42 180.0 180.0 \n", + "4 2023-09-08 30 Long Straddle 179.42 180.0 180.0 \n", + "5 2023-09-15 37 Long Straddle 179.42 180.0 180.0 \n", + "6 2023-09-22 44 Long Straddle 179.42 180.0 180.0 \n", + "7 2023-10-20 72 Long Straddle 179.42 180.0 180.0 \n", + "8 2023-11-17 100 Long Straddle 179.42 180.0 180.0 \n", + "9 2023-12-15 128 Long Straddle 179.42 180.0 180.0 \n", + "10 2024-01-19 163 Long Straddle 179.42 180.0 180.0 \n", + "11 2024-03-15 219 Long Straddle 179.42 180.0 180.0 \n", + "12 2024-06-21 317 Long Straddle 179.42 180.0 180.0 \n", + "13 2024-09-20 408 Long Straddle 179.42 180.0 180.0 \n", + "14 2024-12-20 499 Long Straddle 179.42 180.0 180.0 \n", + "15 2025-01-17 527 Long Straddle 179.42 180.0 180.0 \n", + "16 2025-06-20 681 Long Straddle 179.42 180.0 180.0 \n", + "17 2025-12-19 863 Long Straddle 179.42 180.0 180.0 \n", + "\n", + " Strike 1 Premium Strike 2 Premium Cost Cost Percent Breakeven Upper \\\n", + "0 1.02 1.77 2.79 1.555 182.79 \n", + "1 2.08 2.67 4.75 2.6474 184.75 \n", + "2 2.97 3.4 6.37 3.5503 186.37 \n", + "3 3.7 3.9 7.6 4.2359 187.6 \n", + "4 4.25 4.25 8.5 4.7375 188.5 \n", + "5 4.95 4.75 9.7 5.4063 189.7 \n", + "6 5.55 5.15 10.7 5.9637 190.7 \n", + "7 7.45 6.35 13.8 7.6915 193.8 \n", + "8 9.55 7.85 17.4 9.6979 197.4 \n", + "9 11.0 8.65 19.65 10.952 199.65 \n", + "10 12.8 9.55 22.35 12.4568 202.35 \n", + "11 15.85 11.3 27.15 15.1321 207.15 \n", + "12 20.15 13.55 33.7 18.7827 213.7 \n", + "13 23.7 15.35 39.05 21.7646 219.05 \n", + "14 27.05 17.1 44.15 24.6071 224.15 \n", + "15 27.95 17.45 45.4 25.3038 225.4 \n", + "16 32.55 19.9 52.45 29.2331 232.45 \n", + "17 37.3 22.3 59.6 33.2181 239.6 \n", + "\n", + " Breakeven Upper Percent Breakeven Lower Breakeven Lower Percent Max Profit \\\n", + "0 1.8783 177.21 -1.2317 inf \n", + "1 2.9707 175.25 -2.3242 inf \n", + "2 3.8736 173.63 -3.2271 inf \n", + "3 4.5591 172.4 -3.9126 inf \n", + "4 5.0608 171.5 -4.4142 inf \n", + "5 5.7296 170.3 -5.083 inf \n", + "6 6.2869 169.3 -5.6404 inf \n", + "7 8.0147 166.2 -7.3682 inf \n", + "8 10.0212 162.6 -9.3747 inf \n", + "9 11.2752 160.35 -10.6287 inf \n", + "10 12.7801 157.65 -12.1335 inf \n", + "11 15.4554 152.85 -14.8088 inf \n", + "12 19.106 146.3 -18.4595 inf \n", + "13 22.0878 140.95 -21.4413 inf \n", + "14 24.9303 135.85 -24.2838 inf \n", + "15 25.627 134.6 -24.9805 inf \n", + "16 29.5563 127.55 -28.9098 inf \n", + "17 33.5414 120.4 -32.8949 inf \n", + "\n", + " Max Loss Payoff Ratio \n", + "0 -2.79 inf \n", + "1 -4.75 inf \n", + "2 -6.37 inf \n", + "3 -7.6 inf \n", + "4 -8.5 inf \n", + "5 -9.7 inf \n", + "6 -10.7 inf \n", + "7 -13.8 inf \n", + "8 -17.4 inf \n", + "9 -19.65 inf \n", + "10 -22.35 inf \n", + "11 -27.15 inf \n", + "12 -33.7 inf \n", + "13 -39.05 inf \n", + "14 -44.15 inf \n", + "15 -45.4 inf \n", + "16 -52.45 inf \n", + "17 -59.6 inf " + ], + "text/html": [ + "\n", + "\n", + "
\n", + "
\n", + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
ExpirationDTEStrategyUnderlying PriceStrike 1Strike 2Strike 1 PremiumStrike 2 PremiumCostCost PercentBreakeven UpperBreakeven Upper PercentBreakeven LowerBreakeven Lower PercentMax ProfitMax LossPayoff Ratio
02023-08-112Long Straddle179.42180.0180.01.021.772.791.555182.791.8783177.21-1.2317inf-2.79inf
12023-08-189Long Straddle179.42180.0180.02.082.674.752.6474184.752.9707175.25-2.3242inf-4.75inf
22023-08-2516Long Straddle179.42180.0180.02.973.46.373.5503186.373.8736173.63-3.2271inf-6.37inf
32023-09-0123Long Straddle179.42180.0180.03.73.97.64.2359187.64.5591172.4-3.9126inf-7.6inf
42023-09-0830Long Straddle179.42180.0180.04.254.258.54.7375188.55.0608171.5-4.4142inf-8.5inf
52023-09-1537Long Straddle179.42180.0180.04.954.759.75.4063189.75.7296170.3-5.083inf-9.7inf
62023-09-2244Long Straddle179.42180.0180.05.555.1510.75.9637190.76.2869169.3-5.6404inf-10.7inf
72023-10-2072Long Straddle179.42180.0180.07.456.3513.87.6915193.88.0147166.2-7.3682inf-13.8inf
82023-11-17100Long Straddle179.42180.0180.09.557.8517.49.6979197.410.0212162.6-9.3747inf-17.4inf
92023-12-15128Long Straddle179.42180.0180.011.08.6519.6510.952199.6511.2752160.35-10.6287inf-19.65inf
102024-01-19163Long Straddle179.42180.0180.012.89.5522.3512.4568202.3512.7801157.65-12.1335inf-22.35inf
112024-03-15219Long Straddle179.42180.0180.015.8511.327.1515.1321207.1515.4554152.85-14.8088inf-27.15inf
122024-06-21317Long Straddle179.42180.0180.020.1513.5533.718.7827213.719.106146.3-18.4595inf-33.7inf
132024-09-20408Long Straddle179.42180.0180.023.715.3539.0521.7646219.0522.0878140.95-21.4413inf-39.05inf
142024-12-20499Long Straddle179.42180.0180.027.0517.144.1524.6071224.1524.9303135.85-24.2838inf-44.15inf
152025-01-17527Long Straddle179.42180.0180.027.9517.4545.425.3038225.425.627134.6-24.9805inf-45.4inf
162025-06-20681Long Straddle179.42180.0180.032.5519.952.4529.2331232.4529.5563127.55-28.9098inf-52.45inf
172025-12-19863Long Straddle179.42180.0180.037.322.359.633.2181239.633.5414120.4-32.8949inf-59.6inf
\n", + "
\n", + " \n", + "\n", + "\n", + "\n", + "
\n", + " \n", + "
\n", + "\n", + "\n", + "\n", + " \n", + "\n", + " \n", + " \n", + "\n", + " \n", + "
\n", + "
\n" + ] + }, + "metadata": {}, + "execution_count": 6 + } + ] + }, + { + "cell_type": "code", + "source": [ + "print(f\"Last Price of Underlying: {options.last_price}\")\n", + "options.get_skew()" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 442 + }, + "id": "qKxdTqbKienM", + "outputId": "e50cf906-5904-4bf1-af82-6cd3867cd7b9" + }, + "execution_count": 7, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Last Price of Underlying: 179.42\n" + ] + }, + { + "output_type": "execute_result", + "data": { + "text/plain": [ + " Expiration Strike Option Type IV ATM IV Skew\n", + "0 2023-08-11 50.0 put 5.1895 0.2470 4.9425\n", + "1 2023-08-11 60.0 put 4.4677 0.2470 4.2207\n", + "2 2023-08-11 65.0 put 4.1514 0.2470 3.9044\n", + "3 2023-08-11 70.0 put 3.8588 0.2470 3.6118\n", + "4 2023-08-11 75.0 put 3.5865 0.2470 3.3395\n", + "... ... ... ... ... ... ...\n", + "1508 2025-12-19 290.0 put 0.3132 0.2666 0.0466\n", + "1509 2025-12-19 300.0 call 0.2225 0.2708 -0.0483\n", + "1510 2025-12-19 300.0 put 0.3366 0.2666 0.0700\n", + "1511 2025-12-19 310.0 call 0.2211 0.2708 -0.0497\n", + "1512 2025-12-19 310.0 put 0.3460 0.2666 0.0794\n", + "\n", + "[1513 rows x 6 columns]" + ], + "text/html": [ + "\n", + "\n", + "
\n", + "
\n", + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
ExpirationStrikeOption TypeIVATM IVSkew
02023-08-1150.0put5.18950.24704.9425
12023-08-1160.0put4.46770.24704.2207
22023-08-1165.0put4.15140.24703.9044
32023-08-1170.0put3.85880.24703.6118
42023-08-1175.0put3.58650.24703.3395
.....................
15082025-12-19290.0put0.31320.26660.0466
15092025-12-19300.0call0.22250.2708-0.0483
15102025-12-19300.0put0.33660.26660.0700
15112025-12-19310.0call0.22110.2708-0.0497
15122025-12-19310.0put0.34600.26660.0794
\n", + "

1513 rows × 6 columns

\n", + "
\n", + " \n", + "\n", + "\n", + "\n", + "
\n", + " \n", + "
\n", + "\n", + "\n", + "\n", + " \n", + "\n", + " \n", + " \n", + "\n", + " \n", + "
\n", + "
\n" + ] + }, + "metadata": {}, + "execution_count": 7 + } + ] + }, + { + "cell_type": "code", + "source": [ + "# The data for the chains is stored as a class property, `chains`.\n", + "\n", + "options.chains" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 487 + }, + "id": "CBJeBoq-nurT", + "outputId": "e1c52a4b-f69f-4071-b3cb-9d77b7cbc171" + }, + "execution_count": 8, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + " expiration strike optionType contractSymbol bid bidSize \\\n", + "0 2023-08-11 50.0 call AAPL230811C00050000 129.30 1 \n", + "1 2023-08-11 50.0 put AAPL230811P00050000 0.00 0 \n", + "2 2023-08-11 60.0 call AAPL230811C00060000 119.30 1 \n", + "3 2023-08-11 60.0 put AAPL230811P00060000 0.00 0 \n", + "4 2023-08-11 65.0 call AAPL230811C00065000 114.30 1 \n", + "... ... ... ... ... ... ... \n", + "1797 2025-12-19 290.0 put AAPL251219P00290000 109.10 90 \n", + "1798 2025-12-19 300.0 call AAPL251219C00300000 4.05 107 \n", + "1799 2025-12-19 300.0 put AAPL251219P00300000 119.30 2 \n", + "1800 2025-12-19 310.0 call AAPL251219C00310000 3.25 130 \n", + "1801 2025-12-19 310.0 put AAPL251219P00310000 129.05 59 \n", + "\n", + " ask askSize impliedVolatility openInterest ... change open \\\n", + "0 129.45 1 0.0000 4 ... 0.000 0.0 \n", + "1 0.01 624 5.1895 1 ... 0.000 0.0 \n", + "2 119.45 1 0.0000 1 ... 0.000 0.0 \n", + "3 0.01 624 4.4677 0 ... 0.000 0.0 \n", + "4 114.45 1 0.0000 0 ... 0.000 0.0 \n", + "... ... ... ... ... ... ... ... \n", + "1797 112.50 102 0.3132 0 ... 0.000 0.0 \n", + "1798 4.20 340 0.2225 5130 ... -0.150 4.1 \n", + "1799 122.40 102 0.3366 1 ... 2.000 121.0 \n", + "1800 3.45 150 0.2211 3419 ... -0.075 3.3 \n", + "1801 132.45 100 0.3460 0 ... 0.000 0.0 \n", + "\n", + " high low tick lastTradePrice lastTradeTimestamp \\\n", + "0 0.00 0.00 up 129.30 2023-08-08T14:18:27 \n", + "1 0.00 0.00 up 0.01 2023-08-08T10:36:09 \n", + "2 0.00 0.00 down 118.85 2023-08-07T10:50:09 \n", + "3 0.00 0.00 no_change 0.00 None \n", + "4 0.00 0.00 no_change 0.00 None \n", + "... ... ... ... ... ... \n", + "1797 0.00 0.00 down 101.00 2023-06-28T10:34:27 \n", + "1798 4.10 3.90 no_change 4.05 2023-08-09T13:49:34 \n", + "1799 122.00 121.00 up 122.00 2023-08-09T11:06:30 \n", + "1800 3.35 3.15 up 3.35 2023-08-09T14:24:11 \n", + "1801 0.00 0.00 up 125.50 2023-08-04T14:01:04 \n", + "\n", + " changePercent previousClose dte \n", + "0 0.00 130.03 2 \n", + "1 0.00 0.00 2 \n", + "2 0.00 120.02 2 \n", + "3 0.00 0.00 2 \n", + "4 0.00 115.02 2 \n", + "... ... ... ... \n", + "1797 0.00 110.05 863 \n", + "1798 -3.57 4.20 863 \n", + "1799 1.67 120.00 863 \n", + "1800 -2.19 3.42 863 \n", + "1801 0.00 130.05 863 \n", + "\n", + "[1802 rows x 27 columns]" + ], + "text/html": [ + "\n", + "\n", + "
\n", + "
\n", + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
expirationstrikeoptionTypecontractSymbolbidbidSizeaskaskSizeimpliedVolatilityopenInterest...changeopenhighlowticklastTradePricelastTradeTimestampchangePercentpreviousClosedte
02023-08-1150.0callAAPL230811C00050000129.301129.4510.00004...0.0000.00.000.00up129.302023-08-08T14:18:270.00130.032
12023-08-1150.0putAAPL230811P000500000.0000.016245.18951...0.0000.00.000.00up0.012023-08-08T10:36:090.000.002
22023-08-1160.0callAAPL230811C00060000119.301119.4510.00001...0.0000.00.000.00down118.852023-08-07T10:50:090.00120.022
32023-08-1160.0putAAPL230811P000600000.0000.016244.46770...0.0000.00.000.00no_change0.00None0.000.002
42023-08-1165.0callAAPL230811C00065000114.301114.4510.00000...0.0000.00.000.00no_change0.00None0.00115.022
..................................................................
17972025-12-19290.0putAAPL251219P00290000109.1090112.501020.31320...0.0000.00.000.00down101.002023-06-28T10:34:270.00110.05863
17982025-12-19300.0callAAPL251219C003000004.051074.203400.22255130...-0.1504.14.103.90no_change4.052023-08-09T13:49:34-3.574.20863
17992025-12-19300.0putAAPL251219P00300000119.302122.401020.33661...2.000121.0122.00121.00up122.002023-08-09T11:06:301.67120.00863
18002025-12-19310.0callAAPL251219C003100003.251303.451500.22113419...-0.0753.33.353.15up3.352023-08-09T14:24:11-2.193.42863
18012025-12-19310.0putAAPL251219P00310000129.0559132.451000.34600...0.0000.00.000.00up125.502023-08-04T14:01:040.00130.05863
\n", + "

1802 rows × 27 columns

\n", + "
\n", + " \n", + "\n", + "\n", + "\n", + "
\n", + " \n", + "
\n", + "\n", + "\n", + "\n", + " \n", + "\n", + " \n", + " \n", + "\n", + " \n", + "
\n", + "
\n" + ] + }, + "metadata": {}, + "execution_count": 8 + } + ] + }, + { + "cell_type": "code", + "source": [ + "# The source for the data can be defined by using the `source` argument.\n", + "# Instructions for obtaining and entering API keys are found here: https://docs.openbb.co/sdk/usage/guides/api-keys\n", + "\n", + "balance_sheet_growth = openbb.stocks.fa.balance(symbol, ratios = True).transpose()\n", + "\n", + "balance_sheet_growth" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 337 + }, + "id": "nC2Iy_kTYqnf", + "outputId": "d01644ab-fe22-4d48-ded9-8d3f298810a9" + }, + "execution_count": 9, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "Breakdown Cash and cash equivalents Other short-term investments \\\n", + "2022-09-30 -0.323240 -0.109787 \n", + "2021-09-30 -0.080913 -0.476657 \n", + "2020-09-30 -0.221685 0.023476 \n", + "2019-09-30 0.000000 0.000000 \n", + "\n", + "Breakdown Total cash Net receivables Inventory Other current assets \\\n", + "2022-09-30 -0.228851 0.072532 -0.248328 0.504004 \n", + "2021-09-30 -0.311228 0.630149 0.620291 0.252752 \n", + "2020-09-30 -0.095607 -0.296868 -0.010960 -0.088083 \n", + "2019-09-30 0.000000 0.000000 0.000000 0.000000 \n", + "\n", + "Breakdown Total current assets Gross property plant and equipment \\\n", + "2022-09-30 0.004220 0.043145 \n", + "2021-09-30 -0.061769 0.059859 \n", + "2020-09-30 -0.117345 0.078879 \n", + "2019-09-30 0.000000 0.000000 \n", + "\n", + "Breakdown Accumulated depreciation Net property plant and equipment ... \\\n", + "2022-09-30 0.029267 0.067875 ... \n", + "2021-09-30 0.052771 0.072730 ... \n", + "2020-09-30 0.139658 -0.016373 ... \n", + "2019-09-30 0.000000 0.000000 ... \n", + "\n", + "Breakdown Total current liabilities Long-term debt \\\n", + "2022-09-30 0.227134 -0.093001 \n", + "2021-09-30 0.190612 0.105800 \n", + "2020-09-30 -0.003084 0.074722 \n", + "2019-09-30 0.000000 0.000000 \n", + "\n", + "Breakdown Other long-term liabilities Total non-current liabilities \\\n", + "2022-09-30 -0.078444 -0.088222 \n", + "2021-09-30 -0.021380 0.060552 \n", + "2020-09-30 0.078946 0.076221 \n", + "2019-09-30 0.000000 0.000000 \n", + "\n", + "Breakdown Total liabilities Common stock Retained earnings \\\n", + "2022-09-30 0.049220 0.130463 -1.551600 \n", + "2021-09-30 0.113568 0.129699 -0.628358 \n", + "2020-09-30 0.042419 0.124076 -0.673929 \n", + "2019-09-30 0.000000 0.000000 0.000000 \n", + "\n", + "Breakdown Accumulated other comprehensive income \\\n", + "2022-09-30 -69.153374 \n", + "2021-09-30 -1.401478 \n", + "2020-09-30 -0.304795 \n", + "2019-09-30 0.000000 \n", + "\n", + "Breakdown Total stockholders' equity \\\n", + "2022-09-30 -0.196830 \n", + "2021-09-30 -0.034420 \n", + "2020-09-30 -0.277926 \n", + "2019-09-30 0.000000 \n", + "\n", + "Breakdown Total liabilities and stockholders' equity \n", + "2022-09-30 0.004994 \n", + "2021-09-30 0.083714 \n", + "2020-09-30 -0.043212 \n", + "2019-09-30 0.000000 \n", + "\n", + "[4 rows x 28 columns]" + ], + "text/html": [ + "\n", + "\n", + "
\n", + "
\n", + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
BreakdownCash and cash equivalentsOther short-term investmentsTotal cashNet receivablesInventoryOther current assetsTotal current assetsGross property plant and equipmentAccumulated depreciationNet property plant and equipment...Total current liabilitiesLong-term debtOther long-term liabilitiesTotal non-current liabilitiesTotal liabilitiesCommon stockRetained earningsAccumulated other comprehensive incomeTotal stockholders' equityTotal liabilities and stockholders' equity
2022-09-30-0.323240-0.109787-0.2288510.072532-0.2483280.5040040.0042200.0431450.0292670.067875...0.227134-0.093001-0.078444-0.0882220.0492200.130463-1.551600-69.153374-0.1968300.004994
2021-09-30-0.080913-0.476657-0.3112280.6301490.6202910.252752-0.0617690.0598590.0527710.072730...0.1906120.105800-0.0213800.0605520.1135680.129699-0.628358-1.401478-0.0344200.083714
2020-09-30-0.2216850.023476-0.095607-0.296868-0.010960-0.088083-0.1173450.0788790.139658-0.016373...-0.0030840.0747220.0789460.0762210.0424190.124076-0.673929-0.304795-0.277926-0.043212
2019-09-300.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.000000...0.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.000000
\n", + "

4 rows × 28 columns

\n", + "
\n", + " \n", + "\n", + "\n", + "\n", + "
\n", + " \n", + "
\n", + "\n", + "\n", + "\n", + " \n", + "\n", + " \n", + " \n", + "\n", + " \n", + "
\n", + "
\n" + ] + }, + "metadata": {}, + "execution_count": 9 + } + ] + }, + { + "cell_type": "code", + "source": [ + "# Select a metric to display (note that YahooFinance has limited financial statement history)\n", + "\n", + "clear_output(wait = False)\n", + "\n", + "growth_choices = balance_sheet_growth.columns.tolist()\n", + "growth_selection = widgets.Dropdown(\n", + " options = growth_choices,\n", + " value = None,\n", + ")\n", + "output = widgets.Output()\n", + "\n", + "def generate_growth_figure(growth_choice):\n", + " growth_fig = OpenBBFigure()\n", + " growth_fig.add_bar(\n", + " y = balance_sheet_growth[growth_choice][balance_sheet_growth[growth_choice] > 0].values,\n", + " x = balance_sheet_growth[growth_choice][balance_sheet_growth[growth_choice] > 0].index,\n", + " name = growth_choice + \" Growth\",\n", + " marker = dict(color = \"blue\"),\n", + " )\n", + " growth_fig.add_bar(\n", + " y = balance_sheet_growth[growth_choice][balance_sheet_growth[growth_choice] < 0].values,\n", + " x = balance_sheet_growth[growth_choice][balance_sheet_growth[growth_choice] < 0].index,\n", + " name = growth_choice + \" Growth\",\n", + " marker = dict(color = \"red\")\n", + " )\n", + " growth_fig.update_layout(\n", + " showlegend=False,\n", + " width=600,\n", + " height=200,\n", + " title = dict(\n", + " text=f\"{symbol} {growth_choice} Growth\",\n", + " xanchor = \"center\",\n", + " x = 0.5,\n", + " font = dict(size = 12)\n", + " ),\n", + " barmode=\"overlay\",\n", + " bargap=0,\n", + " bargroupgap=0,\n", + " yaxis = dict(\n", + " title = \"% Growth\",\n", + " title_font = dict(size = 12),\n", + " ),\n", + " xaxis = dict(\n", + " showgrid = False,\n", + " title_font = dict(size = 9)\n", + " )\n", + " )\n", + " growth_fig.update_xaxes(type=\"category\")\n", + " return growth_fig\n", + "\n", + "def on_value_change(change):\n", + " clear_output(wait = True)\n", + " display(growth_selection)\n", + " with output:\n", + " growth_selection.value\n", + "\n", + "growth_selection.observe(on_value_change, names=\"value\")\n", + "display(growth_selection)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 49, + "referenced_widgets": [ + "1c14db4b3fa04b67a7265adda2672f58", + "5038c42252f245e4906d27a68f23d7cd", + "ce2de0778cf24736b3ed515792072c94" + ] + }, + "id": "lx9Tglgqackd", + "outputId": "55757848-ee92-4f56-ad2c-dc4dd2499a3f" + }, + "execution_count": 12, + "outputs": [ + { + "output_type": "display_data", + "data": { + "text/plain": [ + "Dropdown(index=2, options=('Cash and cash equivalents', 'Other short-term investments', 'Total cash', 'Net rec…" + ], + "application/vnd.jupyter.widget-view+json": { + "version_major": 2, + "version_minor": 0, + "model_id": "1c14db4b3fa04b67a7265adda2672f58" + } + }, + "metadata": {} + } + ] + }, + { + "cell_type": "code", + "source": [ + "# Play the cell to update to the selection.\n", + "\n", + "if not growth_selection.value is None:\n", + "\n", + " generate_growth_figure(growth_selection.value).show()" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 217 + }, + "id": "oWmne07cb6-Z", + "outputId": "c4b48906-187f-4d5c-ad11-4f1ef0b55986" + }, + "execution_count": 14, + "outputs": [ + { + "output_type": "display_data", + "data": { + "text/html": [ + "\n", + "\n", + "\n", + "
\n", + "
\n", + "\n", + "" + ] + }, + "metadata": {} + } + ] + }, + { + "cell_type": "code", + "source": [ + "# Momentum Score\n", + "\n", + "def get_momentum(symbol) -> pd.DataFrame:\n", + " \"\"\"\n", + " Momentum Factor Exposure is calculated as the log trailing 12-month return minus trailing one-month return. Higher values indicate larger, positive momentum exposure.\n", + "\n", + " Momentum = ln(1 + r12) - ln(1 + r1)\n", + "\n", + " Parameters\n", + " ----------\n", + " symbol: Ticker\n", + " The Ticker object\n", + "\n", + " Returns\n", + " -------\n", + " pd.DataFrame\n", + " Pandas DataFrame with the calculated historical momentum factor exposure score.\n", + " \"\"\"\n", + " monthly = openbb.stocks.load(symbol, monthly=True, start_date = \"1900-01-01\")[[\"Close\"]]\n", + " monthly[\"12 Month Log Return\"] = np.log( 1 + monthly[[\"Close\"]].pct_change(12))\n", + " monthly[\"1 Month Log Return\"] = np.log(1 + monthly[[\"Close\"]].pct_change(1))\n", + " monthly = monthly.dropna()\n", + " monthly[\"Momentum\"] = monthly[\"12 Month Log Return\"] - monthly[\"1 Month Log Return\"]\n", + "\n", + " return monthly\n", + "\n", + "momentum = get_momentum(symbol)\n", + "print(f\"Momentum Score: {momentum.Momentum.iloc[-1]}\")\n", + "momentum[\"Momentum\"].plot()" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 577 + }, + "id": "STTnGHZTcOfP", + "outputId": "72861dee-6522-40d1-b733-841c49184c18" + }, + "execution_count": 15, + "outputs": [ + { + "output_type": "display_data", + "data": { + "text/plain": [ + "Loading Monthly data for AAPL with starting period 1985-01-01.\n" + ], + "text/html": [ + "
Loading Monthly data for AAPL with starting period 1985-01-01.\n",
+              "
\n" + ] + }, + "metadata": {} + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Momentum Score: 0.22871522034849812\n" + ] + }, + { + "output_type": "display_data", + "data": { + "text/html": [ + "\n", + "\n", + "\n", + "
\n", + "
\n", + "\n", + "" + ] + }, + "metadata": {} + } + ] + } + ] +} \ No newline at end of file diff --git a/openbb_terminal/common/behavioural_analysis/twitter_model.py b/openbb_terminal/common/behavioural_analysis/twitter_model.py deleted file mode 100644 index 034cc834113..00000000000 --- a/openbb_terminal/common/behavioural_analysis/twitter_model.py +++ /dev/null @@ -1,212 +0,0 @@ -"""Twitter Model""" -__docformat__ = "numpy" - -import logging -from datetime import datetime, timedelta -from typing import Optional - -import pandas as pd -from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer - -from openbb_terminal.core.session.current_user import get_current_user -from openbb_terminal.decorators import check_api_key, log_start_end -from openbb_terminal.helper_funcs import clean_tweet, get_data, request -from openbb_terminal.rich_config import console - -logger = logging.getLogger(__name__) - -analyzer = SentimentIntensityAnalyzer() - - -@log_start_end(log=logger) -@check_api_key(["API_TWITTER_BEARER_TOKEN"]) -def load_analyze_tweets( - symbol: str, - limit: int = 100, - start_date: Optional[str] = "", - end_date: Optional[str] = "", -) -> pd.DataFrame: - """Load tweets from twitter API and analyzes using VADER. - - Parameters - ---------- - symbol: str - Ticker symbol to search twitter for - limit: int - Number of tweets to analyze - start_date: Optional[str] - If given, the start time to get tweets from - end_date: Optional[str] - If given, the end time to get tweets from - - Returns - ------- - df_tweet: pd.DataFrame - Dataframe of tweets and sentiment - """ - params = { - "query": rf"(\${symbol}) (lang:en)", - "max_results": str(limit), - "tweet.fields": "created_at,lang", - } - - if start_date: - # Assign from and to datetime parameters for the API - params["start_time"] = start_date - if end_date: - params["end_time"] = end_date - - # Request Twitter API - response = request( - "https://api.twitter.com/2/tweets/search/recent", - params=params, # type: ignore - headers={ - "authorization": "Bearer " - + get_current_user().credentials.API_TWITTER_BEARER_TOKEN - }, - ) - - # Create dataframe - df_tweets = pd.DataFrame() - - # Check that the API response was successful - if response.status_code == 200: - tweets = [] - for tweet in response.json()["data"]: - row = get_data(tweet) - tweets.append(row) - df_tweets = pd.DataFrame(tweets) - elif response.status_code == 401: - console.print("Twitter API Key provided is incorrect\n") - return pd.DataFrame() - elif response.status_code == 400: - console.print( - """ - Status Code 400. - This means you are requesting data from beyond the API's 7 day limit""" - ) - return pd.DataFrame() - elif response.status_code == 403: - console.print( - f""" - Status code 403. - It seems you're twitter credentials are invalid - {response.text} - """ - ) - return pd.DataFrame() - else: - console.print( - f""" - Status code {response.status_code}. - Something went wrong - {response.text} - """ - ) - return pd.DataFrame() - - sentiments = [] - pos = [] - neg = [] - neu = [] - - for s_tweet in df_tweets["text"].to_list(): - tweet = clean_tweet(s_tweet, symbol) - sentiments.append(analyzer.polarity_scores(tweet)["compound"]) - pos.append(analyzer.polarity_scores(tweet)["pos"]) - neg.append(analyzer.polarity_scores(tweet)["neg"]) - neu.append(analyzer.polarity_scores(tweet)["neu"]) - # Add sentiments to tweets dataframe - df_tweets["sentiment"] = sentiments - df_tweets["positive"] = pos - df_tweets["negative"] = neg - df_tweets["neutral"] = neu - - return df_tweets - - -@log_start_end(log=logger) -def get_sentiment( - symbol: str, - n_tweets: int = 15, - n_days_past: int = 2, -) -> pd.DataFrame: - """Get sentiments from symbol. - - Parameters - ---------- - symbol: str - Stock ticker symbol to get sentiment for - n_tweets: int - Number of tweets to get per hour - n_days_past: int - Number of days to extract tweets for - - Returns - ------- - df_sentiment: pd.DataFrame - Dataframe of sentiment - """ - # Date format string required by twitter - dt_format = "%Y-%m-%dT%H:%M:%SZ" - - # Algorithm to extract - dt_recent = datetime.utcnow() - timedelta(seconds=20) - dt_old = dt_recent - timedelta(days=n_days_past) - console.print( - f"From {dt_recent.date()} retrieving {n_tweets*24} tweets ({n_tweets} tweets/hour)" - ) - - df_tweets = pd.DataFrame( - columns=[ - "created_at", - "text", - "sentiment", - "positive", - "negative", - "neutral", - ] - ) - while True: - # Iterate until we haven't passed the old number of days - if dt_recent < dt_old: - break - # Update past datetime - dt_past = dt_recent - timedelta(minutes=60) - - temp = load_analyze_tweets( - symbol, - n_tweets, - start_date=dt_past.strftime(dt_format), - end_date=dt_recent.strftime(dt_format), - ) - - if (isinstance(temp, pd.DataFrame) and temp.empty) or ( - not isinstance(temp, pd.DataFrame) and not temp - ): - return pd.DataFrame() - - df_tweets = pd.concat([df_tweets, temp]) - - if dt_past.day < dt_recent.day: - console.print( - f"From {dt_past.date()} retrieving {n_tweets*24} tweets ({n_tweets} tweets/hour)" - ) - - # Update recent datetime - dt_recent = dt_past - - # Sort tweets per date - df_tweets.sort_index(ascending=False, inplace=True) - df_tweets["cumulative_compound"] = df_tweets["sentiment"].cumsum() - df_tweets["prob_sen"] = 1 - - # df_tweets.to_csv(r'notebooks/tweets.csv', index=False) - df_tweets.reset_index(inplace=True) - df_tweets["Month"] = pd.to_datetime(df_tweets["created_at"]).apply( - lambda x: x.month - ) - df_tweets["Day"] = pd.to_datetime(df_tweets["created_at"]).apply(lambda x: x.day) - df_tweets["date"] = pd.to_datetime(df_tweets["created_at"]) - df_tweets = df_tweets.sort_values(by="date") - df_tweets["cumulative_compound"] = df_tweets["sentiment"].cumsum() - - return df_tweets diff --git a/openbb_terminal/common/behavioural_analysis/twitter_view.py b/openbb_terminal/common/behavioural_analysis/twitter_view.py deleted file mode 100644 index fba72770628..00000000000 --- a/openbb_terminal/common/behavioural_analysis/twitter_view.py +++ /dev/null @@ -1,197 +0,0 @@ -"""Twitter view.""" -__docformat__ = "numpy" - -import logging -import os -from typing import Optional, Union - -import numpy as np -import pandas as pd -from dateutil import parser as dparse - -from openbb_terminal import OpenBBFigure, theme -from openbb_terminal.common.behavioural_analysis import twitter_model -from openbb_terminal.decorators import log_start_end -from openbb_terminal.helper_funcs import export_data, get_closing_price -from openbb_terminal.rich_config import console - -logger = logging.getLogger(__name__) - - -@log_start_end(log=logger) -def display_inference( - symbol: str, limit: int = 100, export: str = "", sheet_name: Optional[str] = None -): - """Prints Inference sentiment from past n tweets. - - Parameters - ---------- - symbol: str - Stock ticker symbol - limit: int - Number of tweets to analyze - sheet_name: str - Optionally specify the name of the sheet the data is exported to. - export: str - Format to export tweet dataframe - """ - df_tweets = twitter_model.load_analyze_tweets(symbol, limit) - - if (isinstance(df_tweets, pd.DataFrame) and df_tweets.empty) or ( - not isinstance(df_tweets, pd.DataFrame) and not df_tweets - ): - return - - # Parse tweets - dt_from = dparse.parse(df_tweets["created_at"].values[-1]) - dt_to = dparse.parse(df_tweets["created_at"].values[0]) - console.print(f"From: {dt_from.strftime('%Y-%m-%d %H:%M:%S')}") - console.print(f"To: {dt_to.strftime('%Y-%m-%d %H:%M:%S')}") - - console.print(f"{len(df_tweets)} tweets were analyzed.") - dt_delta = dt_to - dt_from - n_freq = dt_delta.total_seconds() / len(df_tweets) - console.print(f"Frequency of approx 1 tweet every {round(n_freq)} seconds.") - - pos = df_tweets["positive"] - neg = df_tweets["negative"] - - percent_pos = len(np.where(pos > neg)[0]) / len(df_tweets) - percent_neg = len(np.where(pos < neg)[0]) / len(df_tweets) - total_sent = np.round(np.sum(df_tweets["sentiment"]), 2) - mean_sent = np.round(np.mean(df_tweets["sentiment"]), 2) - console.print(f"The summed compound sentiment of {symbol} is: {total_sent}") - console.print(f"The average compound sentiment of {symbol} is: {mean_sent}") - console.print( - f"Of the last {len(df_tweets)} tweets, {100*percent_pos:.2f} % had a higher positive sentiment" - ) - console.print( - f"Of the last {len(df_tweets)} tweets, {100*percent_neg:.2f} % had a higher negative sentiment" - ) - - export_data( - export, - os.path.dirname(os.path.abspath(__file__)), - "infer", - df_tweets, - sheet_name, - ) - - -@log_start_end(log=logger) -def display_sentiment( - symbol: str, - n_tweets: int = 15, - n_days_past: int = 2, - compare: bool = False, - export: str = "", - sheet_name: Optional[str] = None, - external_axes: bool = False, -) -> Union[OpenBBFigure, None]: - """Plots sentiments from symbol - - Parameters - ---------- - symbol: str - Stock ticker symbol to get sentiment for - n_tweets: int - Number of tweets to get per hour - n_days_past: int - Number of days to extract tweets for - compare: bool - Show corresponding change in stock price - sheet_name: str - Optionally specify the name of the sheet the data is exported to. - export: str - Format to export tweet dataframe - external_axes: bool, optional - Whether to return the figure object or not, by default False - """ - - df_tweets = twitter_model.get_sentiment(symbol, n_tweets, n_days_past) - - if df_tweets.empty: - return None - - if compare: - plots_kwargs = dict( - rows=3, - cols=1, - shared_xaxes=True, - vertical_spacing=0.05, - row_heights=[0.2, 0.6, 0.2], - ) - else: - plots_kwargs = dict( - rows=2, - cols=1, - shared_xaxes=True, - vertical_spacing=0.05, - row_heights=[0.6, 0.4], - ) - - fig = OpenBBFigure.create_subplots(**plots_kwargs) # type: ignore - - fig.add_scatter( - x=pd.to_datetime(df_tweets["created_at"]), - y=df_tweets["cumulative_compound"].values, - row=1, - col=1, - ) - - fig.set_yaxis_title("
Cumulative
VADER Sentiment", row=1, col=1) - - for _, day_df in df_tweets.groupby(by="Day"): - day_df["time"] = pd.to_datetime(day_df["created_at"]) - day_df = day_df.sort_values(by="time") - fig.add_scatter( - x=day_df["time"], - y=day_df["sentiment"].cumsum(), - row=1, - col=1, - ) - fig.add_bar( - x=df_tweets["date"], - y=df_tweets["positive"], - row=2, - col=1, - marker_color=theme.up_color, - ) - - fig.add_bar( - x=df_tweets["date"], - y=-1 * df_tweets["negative"], - row=2, - col=1, - marker_color=theme.down_color, - ) - fig.set_yaxis_title("VADER Polarity Scores", row=2, col=1) - - if compare: - # get stock end price for each corresponding day if compare == True - closing_price_df = get_closing_price(symbol, n_days_past) - fig.add_scatter( - x=closing_price_df["Date"], - y=closing_price_df["Close"], - name=pd.to_datetime(closing_price_df["Date"]).iloc[0].strftime("%Y-%m-%d"), - row=3, - col=1, - ) - fig.set_yaxis_title("Stock Price", row=3, col=1) - - fig.update_layout( - title=f"Twitter's {symbol} total compound sentiment over time is {round(np.sum(df_tweets['sentiment']), 2)}", - xaxis=dict(type="date"), - showlegend=False, - ) - - export_data( - export, - os.path.dirname(os.path.abspath(__file__)), - "sentiment", - df_tweets, - sheet_name, - fig, - ) - - return fig.show(external=external_axes) diff --git a/openbb_terminal/core/sdk/controllers/stocks_sdk_controller.py b/openbb_terminal/core/sdk/controllers/stocks_sdk_controller.py index 676362d2e6e..4ddbb03f5a6 100644 --- a/openbb_terminal/core/sdk/controllers/stocks_sdk_controller.py +++ b/openbb_terminal/core/sdk/controllers/stocks_sdk_controller.py @@ -42,8 +42,6 @@ class StocksController(model.StocksRoot): `getdd`: Get due diligence posts from list of subreddits [Source: reddit].\n `headlines`: Gets Sentiment analysis provided by FinBrain's API [Source: finbrain].\n `headlines_chart`: Plots Sentiment analysis from FinBrain. Prints table if raw is True. [Source: FinBrain]\n - `infer`: Load tweets from twitter API and analyzes using VADER.\n - `infer_chart`: Prints Inference sentiment from past n tweets.\n `mentions`: Get interest over time from google api [Source: google].\n `mentions_chart`: Plots weekly bars of stock's interest over time. other users watchlist. [Source: Google].\n `messages`: Get last messages for a given ticker [Source: stocktwits].\n @@ -55,8 +53,6 @@ class StocksController(model.StocksRoot): `regions`: Get interest by region from google api [Source: google].\n `regions_chart`: Plots bars of regions based on stock's interest. [Source: Google].\n `rise`: Get top rising related queries with this stock's query [Source: google].\n - `sentiment`: Get sentiments from symbol.\n - `sentiment_chart`: Plots sentiments from symbol\n `snews`: Get headlines sentiment using VADER model over time. [Source: Finnhub]\n `snews_chart`: Display stock price and headlines sentiment using VADER model over time. [Source: Finnhub]\n `stalker`: Gets messages from given user [Source: stocktwits].\n diff --git a/openbb_terminal/core/sdk/models/crypto_sdk_model.py b/openbb_terminal/core/sdk/models/crypto_sdk_model.py index 1c0f1bba4e3..2db93f2f659 100644 --- a/openbb_terminal/core/sdk/models/crypto_sdk_model.py +++ b/openbb_terminal/core/sdk/models/crypto_sdk_model.py @@ -285,10 +285,6 @@ class CryptoDeFi(Category): ) self.newsletters = lib.crypto_defi_substack_model.get_newsletters self.newsletters_chart = lib.crypto_defi_substack_view.display_newsletters - self.pairs = lib.crypto_defi_graph_model.get_uniswap_pool_recently_added - self.pairs_chart = lib.crypto_defi_graph_view.display_recently_added - self.pools = lib.crypto_defi_graph_model.get_uni_pools_by_volume - self.pools_chart = lib.crypto_defi_graph_view.display_uni_pools self.sinfo = lib.crypto_defi_terramoney_fcd_model.get_staking_account_info self.sinfo_chart = ( lib.crypto_defi_terramoney_fcd_view.display_account_staking_info @@ -301,14 +297,8 @@ class CryptoDeFi(Category): self.sreturn_chart = ( lib.crypto_defi_terramoney_fcd_view.display_staking_returns_history ) - self.stats = lib.crypto_defi_graph_model.get_uniswap_stats - self.stats_chart = lib.crypto_defi_graph_view.display_uni_stats self.stvl = lib.crypto_defi_llama_model.get_defi_tvl self.stvl_chart = lib.crypto_defi_llama_view.display_defi_tvl - self.swaps = lib.crypto_defi_graph_model.get_last_uni_swaps - self.swaps_chart = lib.crypto_defi_graph_view.display_last_uni_swaps - self.tokens = lib.crypto_defi_graph_model.get_uni_tokens - self.tokens_chart = lib.crypto_defi_graph_view.display_uni_tokens self.validators = lib.crypto_defi_terramoney_fcd_model.get_validators self.validators_chart = lib.crypto_defi_terramoney_fcd_view.display_validators self.vaults = lib.crypto_defi_coindix_model.get_defi_vaults diff --git a/openbb_terminal/core/sdk/models/keys_sdk_model.py b/openbb_terminal/core/sdk/models/keys_sdk_model.py index 0572e6d3ded..0ccee257bd4 100644 --- a/openbb_terminal/core/sdk/models/keys_sdk_model.py +++ b/openbb_terminal/core/sdk/models/keys_sdk_model.py @@ -42,7 +42,6 @@ class KeysRoot(Category): `stocksera`: Set Stocksera key.\n `tokenterminal`: Set Token Terminal key.\n `tradier`: Set Tradier key\n - `twitter`: Set Twitter key\n `ultima`: Set Ultima Insights key\n `walert`: Set Walert key\n """ @@ -84,6 +83,5 @@ class KeysRoot(Category): self.stocksera = lib.keys_model.set_stocksera_key self.tokenterminal = lib.keys_model.set_tokenterminal_key self.tradier = lib.keys_model.set_tradier_key - self.twitter = lib.keys_model.set_twitter_key self.ultima = lib.keys_model.set_ultima_key self.walert = lib.keys_model.set_walert_key diff --git a/openbb_terminal/core/sdk/models/stocks_sdk_model.py b/openbb_terminal/core/sdk/models/stocks_sdk_model.py index f0e4c74c4ac..193caf164e9 100644 --- a/openbb_terminal/core/sdk/models/stocks_sdk_model.py +++ b/openbb_terminal/core/sdk/models/stocks_sdk_model.py @@ -42,8 +42,6 @@ class StocksBehavioralAnalysis(Category): `getdd`: Get due diligence posts from list of subreddits [Source: reddit].\n `headlines`: Gets Sentiment analysis provided by FinBrain's API [Source: finbrain].\n `headlines_chart`: Plots Sentiment analysis from FinBrain. Prints table if raw is True. [Source: FinBrain]\n - `infer`: Load tweets from twitter API and analyzes using VADER.\n - `infer_chart`: Prints Inference sentiment from past n tweets.\n `mentions`: Get interest over time from google api [Source: google].\n `mentions_chart`: Plots weekly bars of stock's interest over time. other users watchlist. [Source: Google].\n `messages`: Get last messages for a given ticker [Source: stocktwits].\n @@ -55,8 +53,6 @@ class StocksBehavioralAnalysis(Category): `regions`: Get interest by region from google api [Source: google].\n `regions_chart`: Plots bars of regions based on stock's interest. [Source: Google].\n `rise`: Get top rising related queries with this stock's query [Source: google].\n - `sentiment`: Get sentiments from symbol.\n - `sentiment_chart`: Plots sentiments from symbol\n `snews`: Get headlines sentiment using VADER model over time. [Source: Finnhub]\n `snews_chart`: Display stock price and headlines sentiment using VADER model over time. [Source: Finnhub]\n `stalker`: Gets messages from given user [Source: stocktwits].\n @@ -74,8 +70,6 @@ class StocksBehavioralAnalysis(Category): self.getdd = lib.stocks_ba_reddit_model.get_due_dilligence self.headlines = lib.stocks_ba_finbrain_model.get_sentiment self.headlines_chart = lib.stocks_ba_finbrain_view.display_sentiment_analysis - self.infer = lib.stocks_ba_twitter_model.load_analyze_tweets - self.infer_chart = lib.stocks_ba_twitter_view.display_inference self.mentions = lib.stocks_ba_google_model.get_mentions self.mentions_chart = lib.stocks_ba_google_view.display_mentions self.messages = lib.stocks_ba_stocktwits_model.get_messages @@ -87,8 +81,6 @@ class StocksBehavioralAnalysis(Category): self.regions = lib.stocks_ba_google_model.get_regions self.regions_chart = lib.stocks_ba_google_view.display_regions self.rise = lib.stocks_ba_google_model.get_rise - self.sentiment = lib.stocks_ba_twitter_model.get_sentiment - self.sentiment_chart = lib.stocks_ba_twitter_view.display_sentiment self.snews = lib.stocks_ba_finnhub_model.get_headlines_sentiment self.snews_chart = ( lib.stocks_ba_finnhub_view.display_stock_price_headlines_sentiment diff --git a/openbb_terminal/core/sdk/sdk_init.py b/openbb_terminal/core/sdk/sdk_init.py index 571269da415..66050033423 100644 --- a/openbb_terminal/core/sdk/sdk_init.py +++ b/openbb_terminal/core/sdk/sdk_init.py @@ -121,8 +121,6 @@ from openbb_terminal.common.behavioural_analysis import ( reddit_view as stocks_ba_reddit_view, stocktwits_model as stocks_ba_stocktwits_model, stocktwits_view as stocks_ba_stocktwits_view, - twitter_model as stocks_ba_twitter_model, - twitter_view as stocks_ba_twitter_view, ) @@ -170,8 +168,6 @@ from openbb_terminal.cryptocurrency.defi import ( coindix_view as crypto_defi_coindix_view, cryptosaurio_model as crypto_defi_cryptosaurio_model, cryptosaurio_view as crypto_defi_cryptosaurio_view, - graph_model as crypto_defi_graph_model, - graph_view as crypto_defi_graph_view, llama_model as crypto_defi_llama_model, llama_view as crypto_defi_llama_view, smartstake_model as crypto_defi_smartstake_model, diff --git a/openbb_terminal/core/sdk/trail_map.csv b/openbb_terminal/core/sdk/trail_map.csv index a7e369182cd..1f62a953e00 100644 --- a/openbb_terminal/core/sdk/trail_map.csv +++ b/openbb_terminal/core/sdk/trail_map.csv @@ -75,15 +75,10 @@ crypto.defi.gov_proposals,crypto_defi_terramoney_fcd_model.get_proposals,crypto_ crypto.defi.ldapps,crypto_defi_llama_model.get_defi_protocols,crypto_defi_llama_view.display_defi_protocols crypto.defi.luna_supply,crypto_defi_smartstake_model.get_luna_supply_stats,crypto_defi_smartstake_view.display_luna_circ_supply_change crypto.defi.newsletters,crypto_defi_substack_model.get_newsletters,crypto_defi_substack_view.display_newsletters -crypto.defi.pairs,crypto_defi_graph_model.get_uniswap_pool_recently_added,crypto_defi_graph_view.display_recently_added -crypto.defi.pools,crypto_defi_graph_model.get_uni_pools_by_volume,crypto_defi_graph_view.display_uni_pools crypto.defi.sinfo,crypto_defi_terramoney_fcd_model.get_staking_account_info,crypto_defi_terramoney_fcd_view.display_account_staking_info crypto.defi.sratio,crypto_defi_terramoney_fcd_model.get_staking_ratio_history,crypto_defi_terramoney_fcd_view.display_staking_ratio_history crypto.defi.sreturn,crypto_defi_terramoney_fcd_model.get_staking_returns_history,crypto_defi_terramoney_fcd_view.display_staking_returns_history -crypto.defi.stats,crypto_defi_graph_model.get_uniswap_stats,crypto_defi_graph_view.display_uni_stats crypto.defi.stvl,crypto_defi_llama_model.get_defi_tvl,crypto_defi_llama_view.display_defi_tvl -crypto.defi.swaps,crypto_defi_graph_model.get_last_uni_swaps,crypto_defi_graph_view.display_last_uni_swaps -crypto.defi.tokens,crypto_defi_graph_model.get_uni_tokens,crypto_defi_graph_view.display_uni_tokens crypto.defi.validators,crypto_defi_terramoney_fcd_model.get_validators,crypto_defi_terramoney_fcd_view.display_validators crypto.defi.vaults,crypto_defi_coindix_model.get_defi_vaults,crypto_defi_coindix_view.display_defi_vaults crypto.disc.categories_keys,crypto_disc_pycoingecko_model.get_categories_keys, @@ -317,7 +312,6 @@ keys.smartstake,keys_model.set_smartstake_key, keys.stocksera,keys_model.set_stocksera_key, keys.tokenterminal,keys_model.set_tokenterminal_key, keys.tradier,keys_model.set_tradier_key, -keys.twitter,keys_model.set_twitter_key, keys.ultima,keys_model.set_ultima_key, keys.walert,keys_model.set_walert_key, login,sdk_session.login, @@ -389,7 +383,6 @@ stocks.ba.bullbear,stocks_ba_stocktwits_model.get_bullbear, stocks.ba.cnews,stocks_ba_finnhub_model.get_company_news, stocks.ba.getdd,stocks_ba_reddit_model.get_due_dilligence, stocks.ba.headlines,stocks_ba_finbrain_model.get_sentiment,stocks_ba_finbrain_view.display_sentiment_analysis -stocks.ba.infer,stocks_ba_twitter_model.load_analyze_tweets,stocks_ba_twitter_view.display_inference stocks.ba.mentions,stocks_ba_google_model.get_mentions,stocks_ba_google_view.display_mentions stocks.ba.messages,stocks_ba_stocktwits_model.get_messages, stocks.ba.ns,stocks_ba_news_sentiment_model.get_data,stocks_ba_news_sentiment_view.display_articles_data @@ -398,7 +391,6 @@ stocks.ba.queries,stocks_ba_google_model.get_queries, stocks.ba.redditsent,stocks_ba_reddit_model.get_posts_about, stocks.ba.regions,stocks_ba_google_model.get_regions,stocks_ba_google_view.display_regions stocks.ba.rise,stocks_ba_google_model.get_rise, -stocks.ba.sentiment,stocks_ba_twitter_model.get_sentiment,stocks_ba_twitter_view.display_sentiment stocks.ba.snews,stocks_ba_finnhub_model.get_headlines_sentiment,stocks_ba_finnhub_view.display_stock_price_headlines_sentiment stocks.ba.stalker,stocks_ba_stocktwits_model.get_stalker, stocks.ba.text_sent,stocks_ba_reddit_model.get_sentiment, diff --git a/openbb_terminal/cryptocurrency/defi/defi_controller.py b/openbb_terminal/cryptocurrency/defi/defi_controller.py index 300d093ae1f..4ef44805445 100644 --- a/openbb_terminal/cryptocurrency/defi/defi_controller.py +++ b/openbb_terminal/cryptocurrency/defi/defi_controller.py @@ -12,8 +12,6 @@ from openbb_terminal.cryptocurrency.defi import ( coindix_model, coindix_view, cryptosaurio_view, - graph_model, - graph_view, llama_model, llama_view, smartstake_view, @@ -45,11 +43,6 @@ class DefiController(BaseController): "stvl", "dtvl", "newsletter", - "tokens", - "pairs", - "pools", - "swaps", - "stats", "vaults", "sinfo", "validators", @@ -76,11 +69,6 @@ class DefiController(BaseController): mt = MenuText("crypto/defi/") mt.add_cmd("newsletter") mt.add_cmd("vaults") - mt.add_cmd("tokens") - mt.add_cmd("stats") - mt.add_cmd("pairs") - mt.add_cmd("pools") - mt.add_cmd("swaps") mt.add_cmd("ldapps") mt.add_cmd("gdapps") mt.add_cmd("stvl") @@ -551,299 +539,9 @@ class DefiController(BaseController): else None, ) - @log_start_end(log=logger) - def call_tokens(self, other_args: List[str]): - """Process tokens command""" - parser = argparse.ArgumentParser( - add_help=False, - formatter_class=argparse.ArgumentDefaultsHelpFormatter, - prog="tokens", - description=""" - Display tokens trade-able on Uniswap DEX - [Source: https://thegraph.com/en/] - """, - ) - - parser.add_argument( - "--skip", - dest="skip", - type=check_positive, - help="Number of records to skip", - default=0, - choices=range(1, 1000), - metavar="SKIP", - ) - parser.add_argument( - "--limit", - dest="limit", - type=check_positive, - help="Number of records to display", - default=20, - ) - parser.add_argument( - "-s", - "--sort", - dest="sortby", - type=str, - help="Sort by given column. Default: index", - default="index", - choices=graph_model.TOKENS_FILTERS, - ) - parser.add_argument( - "-r", - "--reverse", - action="store_true", - dest="reverse", - default=False, - help=( - "Data is sorted in descending order by default. " - "Reverse flag will sort it in an ascending way. " - "Only works when raw data is displayed." - ), - ) - ns_parser = self.parse_known_args_and_warn( - parser, other_args, EXPORT_ONLY_RAW_DATA_ALLOWED - ) - if ns_parser: - graph_view.display_uni_tokens( - skip=ns_parser.skip, - limit=ns_parser.limit, - sortby=ns_parser.sortby, - ascend=ns_parser.reverse, - export=ns_parser.export, - sheet_name=" ".join(ns_parser.sheet_name) - if ns_parser.sheet_name - else None, - ) - - @log_start_end(log=logger) - def call_stats(self, other_args: List[str]): - """Process stats command""" - parser = argparse.ArgumentParser( - add_help=False, - formatter_class=argparse.ArgumentDefaultsHelpFormatter, - prog="stats", - description=""" - Display base statistics about Uniswap DEX. - [Source: https://thegraph.com/en/] - """, - ) - - ns_parser = self.parse_known_args_and_warn( - parser, other_args, EXPORT_ONLY_RAW_DATA_ALLOWED - ) - - if ns_parser: - graph_view.display_uni_stats( - export=ns_parser.export, - sheet_name=" ".join(ns_parser.sheet_name) - if ns_parser.sheet_name - else None, - ) - - @log_start_end(log=logger) - def call_pairs(self, other_args: List[str]): - """Process pairs command""" - parser = argparse.ArgumentParser( - add_help=False, - formatter_class=argparse.ArgumentDefaultsHelpFormatter, - prog="pairs", - description=""" - Displays Lastly added pairs on Uniswap DEX. - [Source: https://thegraph.com/en/] - """, - ) - parser.add_argument( - "-l", - "--limit", - dest="limit", - type=check_positive, - help="Number of records to display", - default=10, - ) - parser.add_argument( - "-v", - "--vol", - dest="vol", - type=check_positive, - help="Minimum trading volume", - default=100, - choices=range(1, 1000), - metavar="VOL", - ) - parser.add_argument( - "-tx", - "--tx", - dest="tx", - type=check_positive, - help="Minimum number of transactions", - default=100, - choices=range(1, 1000), - metavar="TX", - ) - parser.add_argument( - "--days", - dest="days", - type=check_positive, - help="Number of days the pair has been active,", - default=10, - choices=range(1, 1000), - metavar="DAY", - ) - parser.add_argument( - "-s", - "--sort", - dest="sortby", - type=str, - help="Sort by given column. Default: created", - default="created", - choices=graph_model.PAIRS_FILTERS, - ) - parser.add_argument( - "-r", - "--reverse", - action="store_true", - dest="reverse", - default=False, - help=( - "Data is sorted in descending order by default. " - "Reverse flag will sort it in an ascending way. " - "Only works when raw data is displayed." - ), - ) - ns_parser = self.parse_known_args_and_warn( - parser, other_args, EXPORT_ONLY_RAW_DATA_ALLOWED - ) - - if ns_parser: - graph_view.display_recently_added( - limit=ns_parser.limit, - days=ns_parser.days, - min_volume=ns_parser.vol, - min_tx=ns_parser.tx, - sortby=ns_parser.sortby, - ascend=ns_parser.reverse, - export=ns_parser.export, - sheet_name=" ".join(ns_parser.sheet_name) - if ns_parser.sheet_name - else None, - ) - - @log_start_end(log=logger) - def call_pools(self, other_args: List[str]): - """Process pools command""" - parser = argparse.ArgumentParser( - add_help=False, - formatter_class=argparse.ArgumentDefaultsHelpFormatter, - prog="pairs", - description=""" - Display uniswap pools by volume. - [Source: https://thegraph.com/en/] - """, - ) - parser.add_argument( - "-l", - "--limit", - dest="limit", - type=check_positive, - help="Number of records to display", - default=10, - ) - parser.add_argument( - "-s", - "--sort", - dest="sortby", - type=str, - help="Sort by given column. Default: volumeUSD", - default="volumeUSD", - choices=graph_model.POOLS_FILTERS, - ) - parser.add_argument( - "-r", - "--reverse", - action="store_true", - dest="reverse", - default=False, - help=( - "Data is sorted in descending order by default. " - "Reverse flag will sort it in an ascending way. " - "Only works when raw data is displayed." - ), - ) - ns_parser = self.parse_known_args_and_warn( - parser, other_args, EXPORT_ONLY_RAW_DATA_ALLOWED - ) - - if ns_parser: - graph_view.display_uni_pools( - limit=ns_parser.limit, - sortby=ns_parser.sortby, - ascend=ns_parser.reverse, - export=ns_parser.export, - sheet_name=" ".join(ns_parser.sheet_name) - if ns_parser.sheet_name - else None, - ) - - @log_start_end(log=logger) - def call_swaps(self, other_args: List[str]): - """Process swaps command""" - parser = argparse.ArgumentParser( - add_help=False, - formatter_class=argparse.ArgumentDefaultsHelpFormatter, - prog="pairs", - description=""" - Display last swaps done on Uniswap DEX. - [Source: https://thegraph.com/en/] - """, - ) - parser.add_argument( - "-l", - "--limit", - dest="limit", - type=check_positive, - help="Number of records to display", - default=10, - ) - parser.add_argument( - "-s", - "--sort", - dest="sortby", - type=str, - help="Sort by given column. Default: timestamp", - default="Datetime", - choices=graph_model.SWAPS_FILTERS, - ) - parser.add_argument( - "-r", - "--reverse", - action="store_true", - dest="reverse", - default=False, - help=( - "Data is sorted in descending order by default. " - "Reverse flag will sort it in an ascending way. " - "Only works when raw data is displayed." - ), - ) - ns_parser = self.parse_known_args_and_warn( - parser, other_args, EXPORT_ONLY_RAW_DATA_ALLOWED - ) - - if ns_parser: - graph_view.display_last_uni_swaps( - limit=ns_parser.limit, - sortby=ns_parser.sortby, - ascend=ns_parser.reverse, - export=ns_parser.export, - sheet_name=" ".join(ns_parser.sheet_name) - if ns_parser.sheet_name - else None, - ) - @log_start_end(log=logger) def call_vaults(self, other_args: List[str]): - """Process swaps command""" + """Process vaults command""" parser = argparse.ArgumentParser( add_help=False, formatter_class=argparse.ArgumentDefaultsHelpFormatter, diff --git a/openbb_terminal/cryptocurrency/defi/graph_model.py b/openbb_terminal/cryptocurrency/defi/graph_model.py deleted file mode 100644 index f839430d505..00000000000 --- a/openbb_terminal/cryptocurrency/defi/graph_model.py +++ /dev/null @@ -1,356 +0,0 @@ -"""The Graph model""" -__docformat__ = "numpy" - -import datetime -import logging - -import pandas as pd - -from openbb_terminal.cryptocurrency.dataframe_helpers import ( - lambda_very_long_number_formatter, -) -from openbb_terminal.decorators import log_start_end -from openbb_terminal.helper_funcs import request -from openbb_terminal.rich_config import console - -# pylint: disable=unsupported-assignment-operation - -logger = logging.getLogger(__name__) -# pylint: disable=unsupported-assignment-operation - -UNI_URL = "https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2" - -SWAPS_FILTERS = ["Datetime", "USD", "From", "To"] - -POOLS_FILTERS = [ - "volumeUSD", - "token0.name", - "token0.symbol", - "token1.name", - "token1.symbol", - "volumeUSD", - "txCount", -] - -TOKENS_FILTERS = [ - "index", - "symbol", - "name", - "tradeVolumeUSD", - "totalLiquidity", - "txCount", -] - -PAIRS_FILTERS = [ - "created", - "pair", - "token0", - "token1", - "volumeUSD", - "txCount", - "totalSupply", -] - -# TODO: convert USD values to int. otherwise sort by these columns won't work - - -@log_start_end(log=logger) -def query_graph(url: str, query: str) -> dict: - """Helper methods for querying graphql api. [Source: https://thegraph.com/en/] - - Parameters - ---------- - url: str - Endpoint url - query: str - Graphql query - - Returns - ------- - dict: - Dictionary with response data - """ - - response = request(url, method="POST", json={"query": query}) - if response.status_code == 200: - return response.json()["data"] - return {} - - -@log_start_end(log=logger) -def get_uni_tokens( - skip: int = 0, limit: int = 100, sortby: str = "index", ascend: bool = False -) -> pd.DataFrame: - """Get list of tokens trade-able on Uniswap DEX. [Source: https://thegraph.com/en/] - - Parameters - ---------- - skip: int - Skip n number of records. - limit: int - Show n number of records. - sortby: str - The column to sort by - ascend: bool - Whether to sort in ascending order - - Returns - ------- - pd.DataFrame - Uniswap tokens with trading volume, transaction count, liquidity. - """ - - limit = min(limit, 1000) - query = f""" - {{ - tokens(first: {limit}, skip:{skip}) {{ - symbol - name - tradeVolumeUSD - totalLiquidity - txCount - }} - }} - """ - - data = query_graph(UNI_URL, query) - if not data: - return pd.DataFrame() - df = pd.DataFrame(data["tokens"]).reset_index() - return df.sort_values(by=sortby, ascending=ascend) - - -@log_start_end(log=logger) -def get_uniswap_stats() -> pd.DataFrame: - """Get base statistics about Uniswap DEX. [Source: https://thegraph.com/en/] - - uniswapFactory id: 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f - ethereum address on which Uniswap Factory - smart contract was deployed. The factory contract is deployed once from the off-chain source code, and it contains - functions that make it possible to create exchange contracts for any ERC20 token that does not already have one. - It also functions as a registry of ERC20 tokens that have been added to the system, and the exchange with which they - are associated. More: https://docs.uniswap.org/protocol/V1/guides/connect-to-uniswap - We use 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f address to fetch all smart contracts that were - created with usage of this factory. - - - Returns - ------- - pd.DataFrame - Uniswap DEX statistics like liquidity, volume, number of pairs, number of transactions. - """ - - query = """ - { - uniswapFactory(id: "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f"){ - totalVolumeUSD - totalLiquidityUSD - pairCount - txCount - totalLiquidityUSD - totalLiquidityETH - } - } - """ - data = query_graph(UNI_URL, query) - if not data: - return pd.DataFrame() - df = pd.Series(data["uniswapFactory"]).reset_index() - df.columns = ["Metric", "Value"] - df["Value"] = df["Value"].apply(lambda x: lambda_very_long_number_formatter(x)) - return df - - -@log_start_end(log=logger) -def get_uniswap_pool_recently_added( - last_days: int = 14, - min_volume: int = 100, - min_liquidity: int = 0, - min_tx: int = 100, -) -> pd.DataFrame: - """Get lastly added trade-able pairs on Uniswap with parameters like: - * number of days the pair has been active, - * minimum trading volume, - * minimum liquidity, - * number of transactions. - - [Source: https://thegraph.com/en/] - - Parameters - ---------- - last_days: int - How many days back to look for added pairs. - min_volume: int - Minimum volume - min_liquidity: int - Minimum liquidity - min_tx: int - Minimum number of transactions done in given pool. - - Returns - ------- - pd.DataFrame - Lastly added pairs on Uniswap DEX. - """ - - days = int( - (datetime.datetime.now() - datetime.timedelta(days=last_days)).timestamp() - ) - query = f""" - {{ - pairs(first: 1000, - where: {{createdAtTimestamp_gt: "{days}", volumeUSD_gt: "{min_volume}", reserveUSD_gt: "{min_liquidity}", - txCount_gt: "{min_tx}" }}, - orderBy: createdAtTimestamp, orderDirection: desc) {{ - token0 {{ - symbol - name - }} - token1 {{ - symbol - name - }} - reserveUSD - volumeUSD - createdAtTimestamp - totalSupply - txCount - }} - }} - """ - - data = query_graph(UNI_URL, query) - if not data: - return pd.DataFrame() - - df = pd.json_normalize(data["pairs"]) - df["createdAtTimestamp"] = df["createdAtTimestamp"].apply( - lambda x: datetime.datetime.fromtimestamp(int(x)) - ) - - df["pair"] = df["token0.symbol"] + "/" + df["token1.symbol"] - df.rename( - columns={ - "createdAtTimestamp": "created", - "token0.name": "token0", - "token1.name": "token1", - }, - inplace=True, - ) - return df[ - [ - "created", - "pair", - "token0", - "token1", - "volumeUSD", - "txCount", - "totalSupply", - ] - ] - - -@log_start_end(log=logger) -def get_uni_pools_by_volume() -> pd.DataFrame: - """Get uniswap pools by volume. [Source: https://thegraph.com/en/] - - Returns - ------- - pd.DataFrame - Trade-able pairs listed on Uniswap by top volume. - """ - - query = """ - { - pairs(first: 1000, where: {reserveUSD_gt: "1000", volumeUSD_gt: "10000"}, - orderBy: volumeUSD, orderDirection: desc) { - token0 { - symbol - name - } - token1 { - symbol - name - } - volumeUSD - txCount - } - } - """ - data = query_graph(UNI_URL, query) - if not data: - return pd.DataFrame() - df = pd.json_normalize(data["pairs"]) - return df[ - [ - "token0.name", - "token0.symbol", - "token1.name", - "token1.symbol", - "volumeUSD", - "txCount", - ] - ] - - -@log_start_end(log=logger) -def get_last_uni_swaps( - limit: int = 100, sortby: str = "timestamp", ascend: bool = False -) -> pd.DataFrame: - """Get the last 100 swaps done on Uniswap [Source: https://thegraph.com/en/] - - Parameters - ---------- - limit: int - Number of swaps to return. Maximum possible number: 1000. - sortby: str - Key by which to sort data. The table can be sorted by every of its columns - (see https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2). - ascend: bool - Flag to sort data descending - - Returns - ------- - pd.DataFrame - Last 100 swaps on Uniswap - """ - - limit = min(limit, 1000) - - query = f""" - {{ - swaps(first: {limit}, orderBy: timestamp, orderDirection: desc) {{ - timestamp - pair {{ - token0 {{ - symbol - }} - token1 {{ - symbol - }} - }} - amountUSD - }} - }} - """ - - data = query_graph(UNI_URL, query) - if not data: - return pd.DataFrame() - df = pd.json_normalize(data["swaps"]) - - df["timestamp"] = df["timestamp"].apply( - lambda x: datetime.datetime.fromtimestamp(int(x)) - ) - df["amountUSD"] = df["amountUSD"].apply(lambda x: round(float(x), 2)) - to_rename = { - "timestamp": "Datetime", - "amountUSD": "USD", - "pair.token0.symbol": "From", - "pair.token1.symbol": "To", - } - df = df.rename(columns=to_rename) - if sortby in df.columns: - df = df.sort_values(by=sortby, ascending=ascend) - else: - console.print(f"[red]Dataframe does not have column {sortby}[/red]\n") - return df diff --git a/openbb_terminal/cryptocurrency/defi/graph_view.py b/openbb_terminal/cryptocurrency/defi/graph_view.py deleted file mode 100644 index 1d6e5fd89fc..00000000000 --- a/openbb_terminal/cryptocurrency/defi/graph_view.py +++ /dev/null @@ -1,280 +0,0 @@ -"""The Graph view""" -__docformat__ = "numpy" - -import logging -import os -from typing import Optional - -from openbb_terminal import rich_config -from openbb_terminal.core.session.current_user import get_current_user -from openbb_terminal.cryptocurrency.dataframe_helpers import ( - lambda_very_long_number_formatter, -) -from openbb_terminal.cryptocurrency.defi import graph_model -from openbb_terminal.decorators import log_start_end -from openbb_terminal.helper_funcs import export_data, print_rich_table - -logger = logging.getLogger(__name__) - -# pylint: disable=too-many-arguments - - -@log_start_end(log=logger) -def display_uni_tokens( - skip: int = 0, - limit: int = 20, - sortby: str = "index", - ascend: bool = False, - export: str = "", - sheet_name: Optional[str] = None, -) -> None: - """Prints table showing tokens trade-able on Uniswap DEX. - [Source: https://thegraph.com/en/] - - Parameters - ---------- - skip: int - Number of records to skip - limit: int - Number of records to display - sortby: str - Key by which to sort data - ascend: bool - Flag to sort data descending - export : str - Export dataframe data to csv,json,xlsx file - """ - - df = graph_model.get_uni_tokens(skip=skip) - df_data = df.copy() - - # Converting these to float - df["tradeVolumeUSD"] = df["tradeVolumeUSD"].astype(float) - df["totalLiquidity"] = df["totalLiquidity"].astype(float) - df["txCount"] = df["txCount"].astype(float) - - df = df.sort_values(by=sortby, ascending=ascend) - - if rich_config.USE_COLOR and not get_current_user().preferences.USE_INTERACTIVE_DF: - df[["totalLiquidity", "tradeVolumeUSD"]] = df[ - ["totalLiquidity", "tradeVolumeUSD"] - ].applymap(lambda x: lambda_very_long_number_formatter(x)) - - print_rich_table( - df, - headers=list(df.columns), - show_index=False, - title="UniSwarp DEX Trade-able Tokens", - export=bool(export), - limit=limit, - ) - - export_data( - export, - os.path.dirname(os.path.abspath(__file__)), - "tokens", - df_data, - sheet_name, - ) - - -@log_start_end(log=logger) -def display_uni_stats(export: str = "", sheet_name: Optional[str] = None) -> None: - """Prints table showing base statistics about Uniswap DEX. [Source: https://thegraph.com/en/] - [Source: https://thegraph.com/en/] - - Parameters - ---------- - - export : str - Export dataframe data to csv,json,xlsx file - """ - - df = graph_model.get_uniswap_stats() - df_data = df.copy() - - print_rich_table( - df, - headers=list(df.columns), - show_index=False, - title="Uniswap DEX Base Statistics", - export=bool(export), - ) - - export_data( - export, - os.path.dirname(os.path.abspath(__file__)), - "stats", - df_data, - sheet_name, - ) - - -@log_start_end(log=logger) -def display_recently_added( - limit: int = 20, - days: int = 7, - min_volume: int = 20, - min_liquidity: int = 0, - min_tx: int = 100, - sortby: str = "created", - ascend: bool = False, - export: str = "", - sheet_name: Optional[str] = None, -) -> None: - """Prints table showing Lastly added pairs on Uniswap DEX. - [Source: https://thegraph.com/en/] - - Parameters - ---------- - limit: int - Number of records to display - days: int - Number of days the pair has been active, - min_volume: int - Minimum trading volume, - min_liquidity: int - Minimum liquidity - min_tx: int - Minimum number of transactions - sortby: str - Key by which to sort data - ascend: bool - Flag to sort data descending - export : str - Export dataframe data to csv,json,xlsx file - """ - - df = graph_model.get_uniswap_pool_recently_added( - last_days=days, - min_volume=min_volume, - min_liquidity=min_liquidity, - min_tx=min_tx, - ) - df_data = df.copy() - - # Converting these to float - df["volumeUSD"] = df["volumeUSD"].astype(float) - df["txCount"] = df["txCount"].astype(float) - df["totalSupply"] = df["totalSupply"].astype(float) - - df = df.sort_values(by=sortby, ascending=ascend) - - df[["volumeUSD", "totalSupply"]] = df[["volumeUSD", "totalSupply"]].applymap( - lambda x: lambda_very_long_number_formatter(x) - ) - - print_rich_table( - df, - headers=list(df.columns), - show_index=False, - title="Latest Added Pairs on Uniswap DEX", - export=bool(export), - limit=limit, - ) - - export_data( - export, - os.path.dirname(os.path.abspath(__file__)), - "pairs", - df_data, - sheet_name, - ) - - -@log_start_end(log=logger) -def display_uni_pools( - limit: int = 20, - sortby: str = "volumeUSD", - ascend: bool = True, - export: str = "", - sheet_name: Optional[str] = None, -) -> None: - """Prints table showing uniswap pools by volume. - [Source: https://thegraph.com/en/] - - Parameters - ---------- - limit: int - Number of records to display - sortby: str - Key by which to sort data. The table can be sorted by every of its columns - (see https://bit.ly/3ORagr1 then press ctrl-enter or execute the query). - ascend: bool - Flag to sort data descending - export : str - Export dataframe data to csv,json,xlsx file - """ - - df = graph_model.get_uni_pools_by_volume() - - # Converting these to float - df["volumeUSD"] = df["volumeUSD"].astype(float) - df["txCount"] = df["txCount"].astype(float) - - df = df.sort_values(by=sortby, ascending=ascend) - - df["volumeUSD"] = df["volumeUSD"].apply( - lambda x: lambda_very_long_number_formatter(x) - ) - df_data = df.copy() - - print_rich_table( - df, - headers=list(df.columns), - show_index=False, - title="Uniswap Pools", - export=bool(export), - limit=limit, - ) - - export_data( - export, - os.path.dirname(os.path.abspath(__file__)), - "pools", - df_data, - sheet_name, - ) - - -@log_start_end(log=logger) -def display_last_uni_swaps( - limit: int = 10, - sortby: str = "timestamp", - ascend: bool = False, - export: str = "", - sheet_name: Optional[str] = None, -) -> None: - """Prints table showing last swaps done on Uniswap - [Source: https://thegraph.com/en/] - - Parameters - ---------- - limit: int - Number of records to display - sortby: str - Key by which to sort data. The table can be sorted by every of its columns - (see https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2). - ascend: bool - Flag to sort data descending - export : str - Export dataframe data to csv,json,xlsx file - """ - - df = graph_model.get_last_uni_swaps(limit=limit, sortby=sortby, ascend=ascend) - - print_rich_table( - df, - headers=list(df.columns), - show_index=False, - title="Last Uniswap Swaps", - export=bool(export), - ) - - export_data( - export, - os.path.dirname(os.path.abspath(__file__)), - "swaps", - df, - sheet_name, - ) diff --git a/openbb_terminal/economy/datasets/cpi.csv b/openbb_terminal/economy/datasets/cpi.csv index a209ce5869e..7671215ca5a 100644 --- a/openbb_terminal/economy/datasets/cpi.csv +++ b/openbb_terminal/economy/datasets/cpi.csv @@ -1,256 +1,256 @@ -title,country,frequency,units,series_id -Consumer Price Index for Australia,australia,annual,growth_previous,CPALTT01AUA657N -Consumer Price Index for Australia,australia,annual,growth_same,CPALTT01AUA659N -Consumer Price Index for Australia,australia,quarterly,growth_previous,CPALTT01AUQ657N -Consumer Price Index for Australia,australia,quarterly,growth_same,CPALTT01AUQ659N -Consumer Price Index for Austria,austria,annual,growth_previous,CPALTT01ATA657N -Consumer Price Index for Austria,austria,annual,growth_same,CPALTT01ATA659N -Consumer Price Index for Austria,austria,monthly,growth_previous,CPALTT01ATM657N -Consumer Price Index for Austria,austria,monthly,growth_same,CPALTT01ATM659N -Consumer Price Index for Austria,austria,quarterly,growth_previous,CPALTT01ATQ657N -Consumer Price Index for Austria,austria,quarterly,growth_same,CPALTT01ATQ659N -Consumer Price Index for Belgium,belgium,annual,growth_previous,CPALTT01BEA657N -Consumer Price Index for Belgium,belgium,annual,growth_same,CPALTT01BEA659N -Consumer Price Index for Belgium,belgium,monthly,growth_previous,CPALTT01BEM657N -Consumer Price Index for Belgium,belgium,monthly,growth_same,CPALTT01BEM659N -Consumer Price Index for Belgium,belgium,quarterly,growth_previous,CPALTT01BEQ657N -Consumer Price Index for Belgium,belgium,quarterly,growth_same,CPALTT01BEQ659N -Consumer Price Index for Brazil,brazil,annual,growth_previous,CPALTT01BRA657N -Consumer Price Index for Brazil,brazil,annual,growth_same,CPALTT01BRA659N -Consumer Price Index for Brazil,brazil,monthly,growth_previous,CPALTT01BRM657N -Consumer Price Index for Brazil,brazil,monthly,growth_same,CPALTT01BRM659N -Consumer Price Index for Brazil,brazil,quarterly,growth_previous,CPALTT01BRQ657N -Consumer Price Index for Brazil,brazil,quarterly,growth_same,CPALTT01BRQ659N -Consumer Price Index for Canada,canada,annual,index_2015,CPALCY01CAA661N -Consumer Price Index for Canada,canada,monthly,index_2015,CPALCY01CAM661N -Consumer Price Index for Canada,canada,quarterly,index_2015,CPALCY01CAQ661N -Consumer Price Index for Canada,canada,annual,growth_previous,CPALTT01CAA657N -Consumer Price Index for Canada,canada,annual,growth_same,CPALTT01CAA659N -Consumer Price Index for Canada,canada,monthly,growth_previous,CPALTT01CAM657N -Consumer Price Index for Canada,canada,monthly,growth_same,CPALTT01CAM659N -Consumer Price Index for Canada,canada,quarterly,growth_previous,CPALTT01CAQ657N -Consumer Price Index for Canada,canada,quarterly,growth_same,CPALTT01CAQ659N -Consumer Price Index for Chile,chile,annual,growth_previous,CPALTT01CLA657N -Consumer Price Index for Chile,chile,annual,growth_same,CPALTT01CLA659N -Consumer Price Index for Chile,chile,monthly,growth_previous,CPALTT01CLM657N -Consumer Price Index for Chile,chile,monthly,growth_same,CPALTT01CLM659N -Consumer Price Index for Chile,chile,quarterly,growth_previous,CPALTT01CLQ657N -Consumer Price Index for Chile,chile,quarterly,growth_same,CPALTT01CLQ659N -Consumer Price Index for China,china,annual,growth_previous,CPALTT01CNA657N -Consumer Price Index for China,china,monthly,growth_same,CPALTT01CNM657N -Consumer Price Index for China,china,monthly,growth_previous,CPALTT01CNM659N -Consumer Price Index for China,china,quarterly,growth_same,CPALTT01CNQ657N -Consumer Price Index for China,china,quarterly,growth_previous,CPALTT01CNQ659N -Consumer Price Index for Denmark,denmark,annual,growth_same,CPALTT01DKA657N -Consumer Price Index for Denmark,denmark,annual,growth_previous,CPALTT01DKA659N -Consumer Price Index for Denmark,denmark,monthly,growth_same,CPALTT01DKM657N -Consumer Price Index for Denmark,denmark,monthly,growth_previous,CPALTT01DKM659N -Consumer Price Index for Denmark,denmark,quarterly,growth_same,CPALTT01DKQ657N -Consumer Price Index for Denmark,denmark,quarterly,growth_previous,CPALTT01DKQ659N -Consumer Price Index for Estonia,estonia,annual,growth_same,CPALTT01EEA657N -Consumer Price Index for Estonia,estonia,annual,growth_previous,CPALTT01EEA659N -Consumer Price Index for Estonia,estonia,annual,index_2015,CPALTT01EEA661N -Consumer Price Index for Estonia,estonia,monthly,growth_previous,CPALTT01EEM657N -Consumer Price Index for Estonia,estonia,monthly,growth_same,CPALTT01EEM659N -Consumer Price Index for Estonia,estonia,monthly,index_2015,CPALTT01EEM661N -Consumer Price Index for Estonia,estonia,quarterly,growth_same,CPALTT01EEQ657N -Consumer Price Index for Estonia,estonia,quarterly,growth_previous,CPALTT01EEQ659N -Consumer Price Index for Estonia,estonia,quarterly,index_2015,CPALTT01EEQ661N -Consumer Price Index for Finland,finland,annual,growth_previous,CPALTT01FIA657N -Consumer Price Index for Finland,finland,annual,growth_same,CPALTT01FIA659N -Consumer Price Index for Finland,finland,monthly,growth_previous,CPALTT01FIM657N -Consumer Price Index for Finland,finland,monthly,growth_same,CPALTT01FIM659N -Consumer Price Index for Finland,finland,quarterly,growth_previous,CPALTT01FIQ657N -Consumer Price Index for Finland,finland,quarterly,growth_same,CPALTT01FIQ659N -Consumer Price Index for France,france,annual,growth_previous,CPALTT01FRA657N -Consumer Price Index for France,france,annual,growth_same,CPALTT01FRA659N -Consumer Price Index for France,france,monthly,growth_previous,CPALTT01FRM657N -Consumer Price Index for France,france,monthly,growth_same,CPALTT01FRM659N -Consumer Price Index for France,france,quarterly,growth_previous,CPALTT01FRQ657N -Consumer Price Index for France,france,quarterly,growth_same,CPALTT01FRQ659N -Consumer Price Index for Germany,germany,annual,growth_same,CPALTT01DEA657N -Consumer Price Index for Germany,germany,annual,growth_previous,CPALTT01DEA659N -Consumer Price Index for Germany,germany,monthly,growth_same,CPALTT01DEM657N -Consumer Price Index for Germany,germany,monthly,growth_previous,CPALTT01DEM659N -Consumer Price Index for Germany,germany,quarterly,growth_same,CPALTT01DEQ657N -Consumer Price Index for Germany,germany,quarterly,growth_previous,CPALTT01DEQ659N -Consumer Price Index for Greece,greece,annual,growth_previous,CPALTT01GRA657N -Consumer Price Index for Greece,greece,annual,growth_same,CPALTT01GRA659N -Consumer Price Index for Greece,greece,monthly,growth_previous,CPALTT01GRM657N -Consumer Price Index for Greece,greece,monthly,growth_same,CPALTT01GRM659N -Consumer Price Index for Greece,greece,quarterly,growth_previous,CPALTT01GRQ657N -Consumer Price Index for Greece,greece,quarterly,growth_same,CPALTT01GRQ659N -Consumer Price Index for Hungary,hungary,annual,growth_previous,CPALTT01HUA657N -Consumer Price Index for Hungary,hungary,annual,growth_same,CPALTT01HUA659N -Consumer Price Index for Hungary,hungary,monthly,growth_previous,CPALTT01HUM657N -Consumer Price Index for Hungary,hungary,monthly,growth_same,CPALTT01HUM659N -Consumer Price Index for Hungary,hungary,quarterly,growth_previous,CPALTT01HUQ657N -Consumer Price Index for Hungary,hungary,quarterly,growth_same,CPALTT01HUQ659N -Consumer Price Index for Iceland,iceland,annual,growth_previous,CPALTT01ISA657N -Consumer Price Index for Iceland,iceland,annual,growth_same,CPALTT01ISA659N -Consumer Price Index for Iceland,iceland,monthly,growth_previous,CPALTT01ISM657N -Consumer Price Index for Iceland,iceland,monthly,growth_same,CPALTT01ISM659N -Consumer Price Index for Iceland,iceland,quarterly,growth_previous,CPALTT01ISQ657N -Consumer Price Index for Iceland,iceland,quarterly,growth_same,CPALTT01ISQ659N -Consumer Price Index for India,india,annual,growth_previous,CPALTT01INA657N -Consumer Price Index for India,india,annual,growth_same,CPALTT01INA659N -Consumer Price Index for India,india,monthly,growth_previous,CPALTT01INM657N -Consumer Price Index for India,india,monthly,growth_same,CPALTT01INM659N -Consumer Price Index for India,india,quarterly,growth_previous,CPALTT01INQ657N -Consumer Price Index for India,india,quarterly,growth_same,CPALTT01INQ659N -Consumer Price Index for Indonesia,indonesia,annual,growth_previous,CPALTT01IDA657N -Consumer Price Index for Indonesia,indonesia,annual,growth_same,CPALTT01IDA659N -Consumer Price Index for Indonesia,indonesia,monthly,growth_previous,CPALTT01IDM657N -Consumer Price Index for Indonesia,indonesia,monthly,growth_same,CPALTT01IDM659N -Consumer Price Index for Indonesia,indonesia,quarterly,growth_previous,CPALTT01IDQ657N -Consumer Price Index for Indonesia,indonesia,quarterly,growth_same,CPALTT01IDQ659N -Consumer Price Index for Ireland,ireland,annual,growth_previous,CPALTT01IEA657N -Consumer Price Index for Ireland,ireland,annual,growth_same,CPALTT01IEA659N -Consumer Price Index for Ireland,ireland,monthly,growth_previous,CPALTT01IEM657N -Consumer Price Index for Ireland,ireland,monthly,growth_same,CPALTT01IEM659N -Consumer Price Index for Ireland,ireland,quarterly,growth_previous,CPALTT01IEQ657N -Consumer Price Index for Ireland,ireland,quarterly,growth_same,CPALTT01IEQ659N -Consumer Price Index for Israel,israel,annual,growth_previous,CPALTT01ILA657N -Consumer Price Index for Israel,israel,annual,growth_same,CPALTT01ILA659N -Consumer Price Index for Israel,israel,monthly,growth_previous,CPALTT01ILM657N -Consumer Price Index for Israel,israel,monthly,growth_same,CPALTT01ILM659N -Consumer Price Index for Israel,israel,quarterly,growth_previous,CPALTT01ILQ657N -Consumer Price Index for Israel,israel,quarterly,growth_same,CPALTT01ILQ659N -Consumer Price Index for Italy,italy,annual,growth_previous,CPALTT01ITA657N -Consumer Price Index for Italy,italy,annual,growth_same,CPALTT01ITA659N -Consumer Price Index for Italy,italy,monthly,growth_previous,CPALTT01ITM657N -Consumer Price Index for Italy,italy,monthly,growth_same,CPALTT01ITM659N -Consumer Price Index for Italy,italy,quarterly,growth_previous,CPALTT01ITQ657N -Consumer Price Index for Italy,italy,quarterly,growth_same,CPALTT01ITQ659N -Consumer Price Index for Japan,japan,monthly,index_2015,CPALCY01JPM661N -Consumer Price Index for Japan,japan,quarterly,index_2015,CPALCY01JPQ661N -Consumer Price Index for Japan,japan,monthly,growth_previous,CPALTT01JPM657N -Consumer Price Index for Japan,japan,monthly,growth_same,CPALTT01JPM659N -Consumer Price Index for Japan,japan,monthly,index_2015,CPALTT01JPM661S -Consumer Price Index for Japan,japan,quarterly,growth_same,CPALTT01JPQ657N -Consumer Price Index for Japan,japan,quarterly,growth_previous,CPALTT01JPQ659N -Consumer Price Index for Japan,japan,quarterly,index_2015,CPALTT01JPQ661S -Consumer Price Index for Luxembourg,luxembourg,annual,growth_previous,CPALTT01LUA657N -Consumer Price Index for Luxembourg,luxembourg,annual,growth_same,CPALTT01LUA659N -Consumer Price Index for Luxembourg,luxembourg,monthly,growth_previous,CPALTT01LUM657N -Consumer Price Index for Luxembourg,luxembourg,monthly,growth_same,CPALTT01LUM659N -Consumer Price Index for Luxembourg,luxembourg,quarterly,growth_previous,CPALTT01LUQ657N -Consumer Price Index for Luxembourg,luxembourg,quarterly,growth_same,CPALTT01LUQ659N -Consumer Price Index for Mexico,mexico,annual,index_2015,CPALCY01MXA661N -Consumer Price Index for Mexico,mexico,monthly,index_2015,CPALCY01MXM661N -Consumer Price Index for Mexico,mexico,quarterly,index_2015,CPALCY01MXQ661N -Consumer Price Index for Mexico,mexico,annual,growth_previous,CPALTT01MXA657N -Consumer Price Index for Mexico,mexico,annual,growth_same,CPALTT01MXA659N -Consumer Price Index for Mexico,mexico,monthly,growth_previous,CPALTT01MXM657N -Consumer Price Index for Mexico,mexico,monthly,growth_same,CPALTT01MXM659N -Consumer Price Index for Mexico,mexico,quarterly,growth_previous,CPALTT01MXQ657N -Consumer Price Index for Mexico,mexico,quarterly,growth_same,CPALTT01MXQ659N -Consumer Price Index for New Zealand,new_zealand,annual,index_2015,CPALCY01NZA661N -Consumer Price Index for New Zealand,new_zealand,quarterly,index_2015,CPALCY01NZQ661N -Consumer Price Index for New Zealand,new_zealand,annual,growth_previous,CPALTT01NZA657N -Consumer Price Index for New Zealand,new_zealand,annual,growth_same,CPALTT01NZA659N -Consumer Price Index for New Zealand,new_zealand,quarterly,growth_previous,CPALTT01NZQ657N -Consumer Price Index for New Zealand,new_zealand,quarterly,growth_same,CPALTT01NZQ659N -Consumer Price Index for Norway,norway,annual,growth_previous,CPALTT01NOA657N -Consumer Price Index for Norway,norway,annual,growth_same,CPALTT01NOA659N -Consumer Price Index for Norway,norway,monthly,growth_previous,CPALTT01NOM657N -Consumer Price Index for Norway,norway,monthly,growth_same,CPALTT01NOM659N -Consumer Price Index for Norway,norway,quarterly,growth_previous,CPALTT01NOQ657N -Consumer Price Index for Norway,norway,quarterly,growth_same,CPALTT01NOQ659N -Consumer Price Index for Poland,poland,annual,growth_previous,CPALTT01PLA657N -Consumer Price Index for Poland,poland,annual,growth_same,CPALTT01PLA659N -Consumer Price Index for Poland,poland,monthly,growth_previous,CPALTT01PLM657N -Consumer Price Index for Poland,poland,monthly,growth_same,CPALTT01PLM659N -Consumer Price Index for Poland,poland,quarterly,growth_previous,CPALTT01PLQ657N -Consumer Price Index for Poland,poland,quarterly,growth_same,CPALTT01PLQ659N -Consumer Price Index for Portugal,portugal,annual,growth_previous,CPALTT01PTA657N -Consumer Price Index for Portugal,portugal,annual,growth_same,CPALTT01PTA659N -Consumer Price Index for Portugal,portugal,monthly,growth_previous,CPALTT01PTM657N -Consumer Price Index for Portugal,portugal,monthly,growth_same,CPALTT01PTM659N -Consumer Price Index for Portugal,portugal,quarterly,growth_previous,CPALTT01PTQ657N -Consumer Price Index for Portugal,portugal,quarterly,growth_same,CPALTT01PTQ659N -Consumer Price Index for Slovenia,slovenia,annual,growth_previous,CPALTT01SIA657N -Consumer Price Index for Slovenia,slovenia,annual,growth_same,CPALTT01SIA659N -Consumer Price Index for Slovenia,slovenia,monthly,growth_previous,CPALTT01SIM657N -Consumer Price Index for Slovenia,slovenia,monthly,growth_same,CPALTT01SIM659N -Consumer Price Index for Slovenia,slovenia,quarterly,growth_previous,CPALTT01SIQ657N -Consumer Price Index for Slovenia,slovenia,quarterly,growth_same,CPALTT01SIQ659N -Consumer Price Index for South Africa,south_africa,annual,growth_previous,CPALTT01ZAA657N -Consumer Price Index for South Africa,south_africa,annual,growth_same,CPALTT01ZAA659N -Consumer Price Index for South Africa,south_africa,monthly,growth_previous,CPALTT01ZAM657N -Consumer Price Index for South Africa,south_africa,monthly,growth_same,CPALTT01ZAM659N -Consumer Price Index for South Africa,south_africa,quarterly,growth_previous,CPALTT01ZAQ657N -Consumer Price Index for South Africa,south_africa,quarterly,growth_same,CPALTT01ZAQ659N -Consumer Price Index for Spain,spain,annual,growth_previous,CPALTT01ESA657N -Consumer Price Index for Spain,spain,annual,growth_same,CPALTT01ESA659N -Consumer Price Index for Spain,spain,monthly,growth_previous,CPALTT01ESM657N -Consumer Price Index for Spain,spain,monthly,growth_same,CPALTT01ESM659N -Consumer Price Index for Spain,spain,quarterly,growth_previous,CPALTT01ESQ657N -Consumer Price Index for Spain,spain,quarterly,growth_same,CPALTT01ESQ659N -Consumer Price Index for Sweden,sweden,annual,growth_previous,CPALTT01SEA657N -Consumer Price Index for Sweden,sweden,annual,growth_same,CPALTT01SEA659N -Consumer Price Index for Sweden,sweden,monthly,growth_previous,CPALTT01SEM657N -Consumer Price Index for Sweden,sweden,monthly,growth_same,CPALTT01SEM659N -Consumer Price Index for Sweden,sweden,quarterly,growth_previous,CPALTT01SEQ657N -Consumer Price Index for Sweden,sweden,quarterly,growth_same,CPALTT01SEQ659N -Consumer Price Index for Switzerland,switzerland,annual,growth_previous,CPALTT01CHA657N -Consumer Price Index for Switzerland,switzerland,annual,growth_same,CPALTT01CHA659N -Consumer Price Index for Switzerland,switzerland,monthly,growth_previous,CPALTT01CHM657N -Consumer Price Index for Switzerland,switzerland,monthly,growth_same,CPALTT01CHM659N -Consumer Price Index for Switzerland,switzerland,quarterly,growth_previous,CPALTT01CHQ657N -Consumer Price Index for Switzerland,switzerland,quarterly,growth_same,CPALTT01CHQ659N -Consumer Price Index for the Czech Republic,czech_republic,annual,growth_same,CPALTT01CZA657N -Consumer Price Index for the Czech Republic,czech_republic,annual,growth_previous,CPALTT01CZA659N -Consumer Price Index for the Czech Republic,czech_republic,monthly,growth_same,CPALTT01CZM657N -Consumer Price Index for the Czech Republic,czech_republic,monthly,growth_previous,CPALTT01CZM659N -Consumer Price Index for the Czech Republic,czech_republic,quarterly,growth_same,CPALTT01CZQ657N -Consumer Price Index for the Czech Republic,czech_republic,quarterly,growth_previous,CPALTT01CZQ659N -Consumer Price Index for the Netherlands,netherlands,annual,growth_previous,CPALTT01NLA657N -Consumer Price Index for the Netherlands,netherlands,annual,growth_same,CPALTT01NLA659N -Consumer Price Index for the Netherlands,netherlands,monthly,growth_previous,CPALTT01NLM657N -Consumer Price Index for the Netherlands,netherlands,monthly,growth_same,CPALTT01NLM659N -Consumer Price Index for the Netherlands,netherlands,quarterly,growth_previous,CPALTT01NLQ657N -Consumer Price Index for the Netherlands,netherlands,quarterly,growth_same,CPALTT01NLQ659N -Consumer Price Index for the Republic of Korea,korea,annual,growth_previous,CPALTT01KRA657N -Consumer Price Index for the Republic of Korea,korea,annual,growth_same,CPALTT01KRA659N -Consumer Price Index for the Republic of Korea,korea,monthly,growth_previous,CPALTT01KRM657N -Consumer Price Index for the Republic of Korea,korea,monthly,growth_same,CPALTT01KRM659N -Consumer Price Index for the Republic of Korea,korea,quarterly,growth_previous,CPALTT01KRQ657N -Consumer Price Index for the Republic of Korea,korea,quarterly,growth_same,CPALTT01KRQ659N -Consumer Price Index for the Russian Federation,russian_federation,monthly,growth_previous,CPALTT01RUM657N -Consumer Price Index for the Russian Federation,russian_federation,monthly,growth_same,CPALTT01RUM659N -Consumer Price Index for the Russian Federation,russian_federation,quarterly,growth_previous,CPALTT01RUQ657N -Consumer Price Index for the Russian Federation,russian_federation,quarterly,growth_same,CPALTT01RUQ659N -Consumer Price Index for the Slovak Republic,slovak_republic,annual,growth_previous,CPALTT01SKA657N -Consumer Price Index for the Slovak Republic,slovak_republic,annual,growth_same,CPALTT01SKA659N -Consumer Price Index for the Slovak Republic,slovak_republic,monthly,growth_previous,CPALTT01SKM657N -Consumer Price Index for the Slovak Republic,slovak_republic,monthly,growth_same,CPALTT01SKM659N -Consumer Price Index for the Slovak Republic,slovak_republic,quarterly,growth_previous,CPALTT01SKQ657N -Consumer Price Index for the Slovak Republic,slovak_republic,quarterly,growth_same,CPALTT01SKQ659N -Consumer Price Index for the United Kingdom,the united kingdom,annual,growth_previous,CPALTT01GBA657N -Consumer Price Index for the United Kingdom,united_kingdom,annual,growth_same,CPALTT01GBA659N -Consumer Price Index for the United Kingdom,united_kingdom,monthly,growth_previous,CPALTT01GBM657N -Consumer Price Index for the United Kingdom,united_kingdom,monthly,growth_same,CPALTT01GBM659N -Consumer Price Index for the United Kingdom,united_kingdom,quarterly,growth_previous,CPALTT01GBQ657N -Consumer Price Index for the United Kingdom,united_kingdom,quarterly,growth_same,CPALTT01GBQ659N -Consumer Price Index for the United States,united_states,annual,index_2015,CPALCY01USA661N -Consumer Price Index for the United States,united_states,monthly,index_2015,CPALCY01USM661N -Consumer Price Index for the United States,united_states,quarterly,index_2015,CPALCY01USQ661N -Consumer Price Index for the United States,united_states,annual,growth_previous,CPALTT01USA657N -Consumer Price Index for the United States,united_states,annual,growth_same,CPALTT01USA659N -Consumer Price Index for the United States,united_states,annual,index_2015,CPALTT01USA661S -Consumer Price Index for the United States,united_states,monthly,growth_previous,CPALTT01USM657N -Consumer Price Index for the United States,united_states,monthly,growth_same,CPALTT01USM659N -Consumer Price Index for the United States,united_states,monthly,index_2015,CPALTT01USM661S -Consumer Price Index for the United States,united_states,quarterly,growth_previous,CPALTT01USQ657N -Consumer Price Index for the United States,united_states,quarterly,growth_same,CPALTT01USQ659N -Consumer Price Index for the United States,united_states,quarterly,index_2015,CPALTT01USQ661S -Consumer Price Index for Turkey,turkey,annual,index_2015,CPALCY01TRA661N -Consumer Price Index for Turkey,turkey,monthly,index_2015,CPALCY01TRM661N -Consumer Price Index for Turkey,turkey,quarterly,index_2015,CPALCY01TRQ661N -Consumer Price Index for Turkey,turkey,annual,growth_previous,CPALTT01TRA657N -Consumer Price Index for Turkey,turkey,annual,growth_same,CPALTT01TRA659N -Consumer Price Index for Turkey,turkey,monthly,growth_previous,CPALTT01TRM657N -Consumer Price Index for Turkey,turkey,monthly,growth_same,CPALTT01TRM659N -Consumer Price Index for Turkey,turkey,quarterly,growth_previous,CPALTT01TRQ657N +title,country,frequency,units,series_id +Consumer Price Index for Australia,australia,annual,growth_previous,CPALTT01AUA657N +Consumer Price Index for Australia,australia,annual,growth_same,CPALTT01AUA659N +Consumer Price Index for Australia,australia,quarterly,growth_previous,CPALTT01AUQ657N +Consumer Price Index for Australia,australia,quarterly,growth_same,CPALTT01AUQ659N +Consumer Price Index for Austria,austria,annual,growth_previous,CPALTT01ATA657N +Consumer Price Index for Austria,austria,annual,growth_same,CPALTT01ATA659N +Consumer Price Index for Austria,austria,monthly,growth_previous,CPALTT01ATM657N +Consumer Price Index for Austria,austria,monthly,growth_same,CPALTT01ATM659N +Consumer Price Index for Austria,austria,quarterly,growth_previous,CPALTT01ATQ657N +Consumer Price Index for Austria,austria,quarterly,growth_same,CPALTT01ATQ659N +Consumer Price Index for Belgium,belgium,annual,growth_previous,CPALTT01BEA657N +Consumer Price Index for Belgium,belgium,annual,growth_same,CPALTT01BEA659N +Consumer Price Index for Belgium,belgium,monthly,growth_previous,CPALTT01BEM657N +Consumer Price Index for Belgium,belgium,monthly,growth_same,CPALTT01BEM659N +Consumer Price Index for Belgium,belgium,quarterly,growth_previous,CPALTT01BEQ657N +Consumer Price Index for Belgium,belgium,quarterly,growth_same,CPALTT01BEQ659N +Consumer Price Index for Brazil,brazil,annual,growth_previous,CPALTT01BRA657N +Consumer Price Index for Brazil,brazil,annual,growth_same,CPALTT01BRA659N +Consumer Price Index for Brazil,brazil,monthly,growth_previous,CPALTT01BRM657N +Consumer Price Index for Brazil,brazil,monthly,growth_same,CPALTT01BRM659N +Consumer Price Index for Brazil,brazil,quarterly,growth_previous,CPALTT01BRQ657N +Consumer Price Index for Brazil,brazil,quarterly,growth_same,CPALTT01BRQ659N +Consumer Price Index for Canada,canada,annual,index_2015,CPALCY01CAA661N +Consumer Price Index for Canada,canada,monthly,index_2015,CPALCY01CAM661N +Consumer Price Index for Canada,canada,quarterly,index_2015,CPALCY01CAQ661N +Consumer Price Index for Canada,canada,annual,growth_previous,CPALTT01CAA657N +Consumer Price Index for Canada,canada,annual,growth_same,CPALTT01CAA659N +Consumer Price Index for Canada,canada,monthly,growth_previous,CPALTT01CAM657N +Consumer Price Index for Canada,canada,monthly,growth_same,CPALTT01CAM659N +Consumer Price Index for Canada,canada,quarterly,growth_previous,CPALTT01CAQ657N +Consumer Price Index for Canada,canada,quarterly,growth_same,CPALTT01CAQ659N +Consumer Price Index for Chile,chile,annual,growth_previous,CPALTT01CLA657N +Consumer Price Index for Chile,chile,annual,growth_same,CPALTT01CLA659N +Consumer Price Index for Chile,chile,monthly,growth_previous,CPALTT01CLM657N +Consumer Price Index for Chile,chile,monthly,growth_same,CPALTT01CLM659N +Consumer Price Index for Chile,chile,quarterly,growth_previous,CPALTT01CLQ657N +Consumer Price Index for Chile,chile,quarterly,growth_same,CPALTT01CLQ659N +Consumer Price Index for China,china,annual,growth_previous,CPALTT01CNA657N +Consumer Price Index for China,china,monthly,growth_previous,CPALTT01CNM657N +Consumer Price Index for China,china,monthly,growth_same,CPALTT01CNM659N +Consumer Price Index for China,china,quarterly,growth_previous,CPALTT01CNQ657N +Consumer Price Index for China,china,quarterly,growth_same,CPALTT01CNQ659N +Consumer Price Index for Denmark,denmark,annual,growth_previous,CPALTT01DKA657N +Consumer Price Index for Denmark,denmark,annual,growth_same,CPALTT01DKA659N +Consumer Price Index for Denmark,denmark,monthly,growth_previous,CPALTT01DKM657N +Consumer Price Index for Denmark,denmark,monthly,growth_same,CPALTT01DKM659N +Consumer Price Index for Denmark,denmark,quarterly,growth_previous,CPALTT01DKQ657N +Consumer Price Index for Denmark,denmark,quarterly,growth_same,CPALTT01DKQ659N +Consumer Price Index for Estonia,estonia,annual,growth_previous,CPALTT01EEA657N +Consumer Price Index for Estonia,estonia,annual,growth_same,CPALTT01EEA659N +Consumer Price Index for Estonia,estonia,annual,index_2015,CPALTT01EEA661N +Consumer Price Index for Estonia,estonia,monthly,growth_previous,CPALTT01EEM657N +Consumer Price Index for Estonia,estonia,monthly,growth_same,CPALTT01EEM659N +Consumer Price Index for Estonia,estonia,monthly,index_2015,CPALTT01EEM661N +Consumer Price Index for Estonia,estonia,quarterly,growth_previous,CPALTT01EEQ657N +Consumer Price Index for Estonia,estonia,quarterly,growth_same,CPALTT01EEQ659N +Consumer Price Index for Estonia,estonia,quarterly,index_2015,CPALTT01EEQ661N +Consumer Price Index for Finland,finland,annual,growth_previous,CPALTT01FIA657N +Consumer Price Index for Finland,finland,annual,growth_same,CPALTT01FIA659N +Consumer Price Index for Finland,finland,monthly,growth_previous,CPALTT01FIM657N +Consumer Price Index for Finland,finland,monthly,growth_same,CPALTT01FIM659N +Consumer Price Index for Finland,finland,quarterly,growth_previous,CPALTT01FIQ657N +Consumer Price Index for Finland,finland,quarterly,growth_same,CPALTT01FIQ659N +Consumer Price Index for France,france,annual,growth_previous,CPALTT01FRA657N +Consumer Price Index for France,france,annual,growth_same,CPALTT01FRA659N +Consumer Price Index for France,france,monthly,growth_previous,CPALTT01FRM657N +Consumer Price Index for France,france,monthly,growth_same,CPALTT01FRM659N +Consumer Price Index for France,france,quarterly,growth_previous,CPALTT01FRQ657N +Consumer Price Index for France,france,quarterly,growth_same,CPALTT01FRQ659N +Consumer Price Index for Germany,germany,annual,growth_previous,CPALTT01DEA657N +Consumer Price Index for Germany,germany,annual,growth_same,CPALTT01DEA659N +Consumer Price Index for Germany,germany,monthly,growth_previous,CPALTT01DEM657N +Consumer Price Index for Germany,germany,monthly,growth_same,CPALTT01DEM659N +Consumer Price Index for Germany,germany,quarterly,growth_previous,CPALTT01DEQ657N +Consumer Price Index for Germany,germany,quarterly,growth_same,CPALTT01DEQ659N +Consumer Price Index for Greece,greece,annual,growth_previous,CPALTT01GRA657N +Consumer Price Index for Greece,greece,annual,growth_same,CPALTT01GRA659N +Consumer Price Index for Greece,greece,monthly,growth_previous,CPALTT01GRM657N +Consumer Price Index for Greece,greece,monthly,growth_same,CPALTT01GRM659N +Consumer Price Index for Greece,greece,quarterly,growth_previous,CPALTT01GRQ657N +Consumer Price Index for Greece,greece,quarterly,growth_same,CPALTT01GRQ659N +Consumer Price Index for Hungary,hungary,annual,growth_previous,CPALTT01HUA657N +Consumer Price Index for Hungary,hungary,annual,growth_same,CPALTT01HUA659N +Consumer Price Index for Hungary,hungary,monthly,growth_previous,CPALTT01HUM657N +Consumer Price Index for Hungary,hungary,monthly,growth_same,CPALTT01HUM659N +Consumer Price Index for Hungary,hungary,quarterly,growth_previous,CPALTT01HUQ657N +Consumer Price Index for Hungary,hungary,quarterly,growth_same,CPALTT01HUQ659N +Consumer Price Index for Iceland,iceland,annual,growth_previous,CPALTT01ISA657N +Consumer Price Index for Iceland,iceland,annual,growth_same,CPALTT01ISA659N +Consumer Price Index for Iceland,iceland,monthly,growth_previous,CPALTT01ISM657N +Consumer Price Index for Iceland,iceland,monthly,growth_same,CPALTT01ISM659N +Consumer Price Index for Iceland,iceland,quarterly,growth_previous,CPALTT01ISQ657N +Consumer Price Index for Iceland,iceland,quarterly,growth_same,CPALTT01ISQ659N +Consumer Price Index for India,india,annual,growth_previous,CPALTT01INA657N +Consumer Price Index for India,india,annual,growth_same,CPALTT01INA659N +Consumer Price Index for India,india,monthly,growth_previous,CPALTT01INM657N +Consumer Price Index for India,india,monthly,growth_same,CPALTT01INM659N +Consumer Price Index for India,india,quarterly,growth_previous,CPALTT01INQ657N +Consumer Price Index for India,india,quarterly,growth_same,CPALTT01INQ659N +Consumer Price Index for Indonesia,indonesia,annual,growth_previous,CPALTT01IDA657N +Consumer Price Index for Indonesia,indonesia,annual,growth_same,CPALTT01IDA659N +Consumer Price Index for Indonesia,indonesia,monthly,growth_previous,CPALTT01IDM657N +Consumer Price Index for Indonesia,indonesia,monthly,growth_same,CPALTT01IDM659N +Consumer Price Index for Indonesia,indonesia,quarterly,growth_previous,CPALTT01IDQ657N +Consumer Price Index for Indonesia,indonesia,quarterly,growth_same,CPALTT01IDQ659N +Consumer Price Index for Ireland,ireland,annual,growth_previous,CPALTT01IEA657N +Consumer Price Index for Ireland,ireland,annual,growth_same,CPALTT01IEA659N +Consumer Price Index for Ireland,ireland,monthly,growth_previous,CPALTT01IEM657N +Consumer Price Index for Ireland,ireland,monthly,growth_same,CPALTT01IEM659N +Consumer Price Index for Ireland,ireland,quarterly,growth_previous,CPALTT01IEQ657N +Consumer Price Index for Ireland,ireland,quarterly,growth_same,CPALTT01IEQ659N +Consumer Price Index for Israel,israel,annual,growth_previous,CPALTT01ILA657N +Consumer Price Index for Israel,israel,annual,growth_same,CPALTT01ILA659N +Consumer Price Index for Israel,israel,monthly,growth_previous,CPALTT01ILM657N +Consumer Price Index for Israel,israel,monthly,growth_same,CPALTT01ILM659N +Consumer Price Index for Israel,israel,quarterly,growth_previous,CPALTT01ILQ657N +Consumer Price Index for Israel,israel,quarterly,growth_same,CPALTT01ILQ659N +Consumer Price Index for Italy,italy,annual,growth_previous,CPALTT01ITA657N +Consumer Price Index for Italy,italy,annual,growth_same,CPALTT01ITA659N +Consumer Price Index for Italy,italy,monthly,growth_previous,CPALTT01ITM657N +Consumer Price Index for Italy,italy,monthly,growth_same,CPALTT01ITM659N +Consumer Price Index for Italy,italy,quarterly,growth_previous,CPALTT01ITQ657N +Consumer Price Index for Italy,italy,quarterly,growth_same,CPALTT01ITQ659N +Consumer Price Index for Japan,japan,monthly,index_2015,CPALCY01JPM661N +Consumer Price Index for Japan,japan,quarterly,index_2015,CPALCY01JPQ661N +Consumer Price Index for Japan,japan,monthly,growth_previous,CPALTT01JPM657N +Consumer Price Index for Japan,japan,monthly,growth_same,CPALTT01JPM659N +Consumer Price Index for Japan,japan,monthly,index_2015,CPALTT01JPM661S +Consumer Price Index for Japan,japan,quarterly,growth_previous,CPALTT01JPQ657N +Consumer Price Index for Japan,japan,quarterly,growth_same,CPALTT01JPQ659N +Consumer Price Index for Japan,japan,quarterly,index_2015,CPALTT01JPQ661S +Consumer Price Index for Luxembourg,luxembourg,annual,growth_previous,CPALTT01LUA657N +Consumer Price Index for Luxembourg,luxembourg,annual,growth_same,CPALTT01LUA659N +Consumer Price Index for Luxembourg,luxembourg,monthly,growth_previous,CPALTT01LUM657N +Consumer Price Index for Luxembourg,luxembourg,monthly,growth_same,CPALTT01LUM659N +Consumer Price Index for Luxembourg,luxembourg,quarterly,growth_previous,CPALTT01LUQ657N +Consumer Price Index for Luxembourg,luxembourg,quarterly,growth_same,CPALTT01LUQ659N +Consumer Price Index for Mexico,mexico,annual,index_2015,CPALCY01MXA661N +Consumer Price Index for Mexico,mexico,monthly,index_2015,CPALCY01MXM661N +Consumer Price Index for Mexico,mexico,quarterly,index_2015,CPALCY01MXQ661N +Consumer Price Index for Mexico,mexico,annual,growth_previous,CPALTT01MXA657N +Consumer Price Index for Mexico,mexico,annual,growth_same,CPALTT01MXA659N +Consumer Price Index for Mexico,mexico,monthly,growth_previous,CPALTT01MXM657N +Consumer Price Index for Mexico,mexico,monthly,growth_same,CPALTT01MXM659N +Consumer Price Index for Mexico,mexico,quarterly,growth_previous,CPALTT01MXQ657N +Consumer Price Index for Mexico,mexico,quarterly,growth_same,CPALTT01MXQ659N +Consumer Price Index for New Zealand,new_zealand,annual,index_2015,CPALCY01NZA661N +Consumer Price Index for New Zealand,new_zealand,quarterly,index_2015,CPALCY01NZQ661N +Consumer Price Index for New Zealand,new_zealand,annual,growth_previous,CPALTT01NZA657N +Consumer Price Index for New Zealand,new_zealand,annual,growth_same,CPALTT01NZA659N +Consumer Price Index for New Zealand,new_zealand,quarterly,growth_previous,CPALTT01NZQ657N +Consumer Price Index for New Zealand,new_zealand,quarterly,growth_same,CPALTT01NZQ659N +Consumer Price Index for Norway,norway,annual,growth_previous,CPALTT01NOA657N +Consumer Price Index for Norway,norway,annual,growth_same,CPALTT01NOA659N +Consumer Price Index for Norway,norway,monthly,growth_previous,CPALTT01NOM657N +Consumer Price Index for Norway,norway,monthly,growth_same,CPALTT01NOM659N +Consumer Price Index for Norway,norway,quarterly,growth_previous,CPALTT01NOQ657N +Consumer Price Index for Norway,norway,quarterly,growth_same,CPALTT01NOQ659N +Consumer Price Index for Poland,poland,annual,growth_previous,CPALTT01PLA657N +Consumer Price Index for Poland,poland,annual,growth_same,CPALTT01PLA659N +Consumer Price Index for Poland,poland,monthly,growth_previous,CPALTT01PLM657N +Consumer Price Index for Poland,poland,monthly,growth_same,CPALTT01PLM659N +Consumer Price Index for Poland,poland,quarterly,growth_previous,CPALTT01PLQ657N +Consumer Price Index for Poland,poland,quarterly,growth_same,CPALTT01PLQ659N +Consumer Price Index for Portugal,portugal,annual,growth_previous,CPALTT01PTA657N +Consumer Price Index for Portugal,portugal,annual,growth_same,CPALTT01PTA659N +Consumer Price Index for Portugal,portugal,monthly,growth_previous,CPALTT01PTM657N +Consumer Price Index for Portugal,portugal,monthly,growth_same,CPALTT01PTM659N +Consumer Price Index for Portugal,portugal,quarterly,growth_previous,CPALTT01PTQ657N +Consumer Price Index for Portugal,portugal,quarterly,growth_same,CPALTT01PTQ659N +Consumer Price Index for Slovenia,slovenia,annual,growth_previous,CPALTT01SIA657N +Consumer Price Index for Slovenia,slovenia,annual,growth_same,CPALTT01SIA659N +Consumer Price Index for Slovenia,slovenia,monthly,growth_previous,CPALTT01SIM657N +Consumer Price Index for Slovenia,slovenia,monthly,growth_same,CPALTT01SIM659N +Consumer Price Index for Slovenia,slovenia,quarterly,growth_previous,CPALTT01SIQ657N +Consumer Price Index for Slovenia,slovenia,quarterly,growth_same,CPALTT01SIQ659N +Consumer Price Index for South Africa,south_africa,annual,growth_previous,CPALTT01ZAA657N +Consumer Price Index for South Africa,south_africa,annual,growth_same,CPALTT01ZAA659N +Consumer Price Index for South Africa,south_africa,monthly,growth_previous,CPALTT01ZAM657N +Consumer Price Index for South Africa,south_africa,monthly,growth_same,CPALTT01ZAM659N +Consumer Price Index for South Africa,south_africa,quarterly,growth_previous,CPALTT01ZAQ657N +Consumer Price Index for South Africa,south_africa,quarterly,growth_same,CPALTT01ZAQ659N +Consumer Price Index for Spain,spain,annual,growth_previous,CPALTT01ESA657N +Consumer Price Index for Spain,spain,annual,growth_same,CPALTT01ESA659N +Consumer Price Index for Spain,spain,monthly,growth_previous,CPALTT01ESM657N +Consumer Price Index for Spain,spain,monthly,growth_same,CPALTT01ESM659N +Consumer Price Index for Spain,spain,quarterly,growth_previous,CPALTT01ESQ657N +Consumer Price Index for Spain,spain,quarterly,growth_same,CPALTT01ESQ659N +Consumer Price Index for Sweden,sweden,annual,growth_previous,CPALTT01SEA657N +Consumer Price Index for Sweden,sweden,annual,growth_same,CPALTT01SEA659N +Consumer Price Index for Sweden,sweden,monthly,growth_previous,CPALTT01SEM657N +Consumer Price Index for Sweden,sweden,monthly,growth_same,CPALTT01SEM659N +Consumer Price Index for Sweden,sweden,quarterly,growth_previous,CPALTT01SEQ657N +Consumer Price Index for Sweden,sweden,quarterly,growth_same,CPALTT01SEQ659N +Consumer Price Index for Switzerland,switzerland,annual,growth_previous,CPALTT01CHA657N +Consumer Price Index for Switzerland,switzerland,annual,growth_same,CPALTT01CHA659N +Consumer Price Index for Switzerland,switzerland,monthly,growth_previous,CPALTT01CHM657N +Consumer Price Index for Switzerland,switzerland,monthly,growth_same,CPALTT01CHM659N +Consumer Price Index for Switzerland,switzerland,quarterly,growth_previous,CPALTT01CHQ657N +Consumer Price Index for Switzerland,switzerland,quarterly,growth_same,CPALTT01CHQ659N +Consumer Price Index for the Czech Republic,czech_republic,annual,growth_previous,CPALTT01CZA657N +Consumer Price Index for the Czech Republic,czech_republic,annual,growth_same,CPALTT01CZA659N +Consumer Price Index for the Czech Republic,czech_republic,monthly,growth_previous,CPALTT01CZM657N +Consumer Price Index for the Czech Republic,czech_republic,monthly,growth_same,CPALTT01CZM659N +Consumer Price Index for the Czech Republic,czech_republic,quarterly,growth_previous,CPALTT01CZQ657N +Consumer Price Index for the Czech Republic,czech_republic,quarterly,growth_same,CPALTT01CZQ659N +Consumer Price Index for the Netherlands,netherlands,annual,growth_previous,CPALTT01NLA657N +Consumer Price Index for the Netherlands,netherlands,annual,growth_same,CPALTT01NLA659N +Consumer Price Index for the Netherlands,netherlands,monthly,growth_previous,CPALTT01NLM657N +Consumer Price Index for the Netherlands,netherlands,monthly,growth_same,CPALTT01NLM659N +Consumer Price Index for the Netherlands,netherlands,quarterly,growth_previous,CPALTT01NLQ657N +Consumer Price Index for the Netherlands,netherlands,quarterly,growth_same,CPALTT01NLQ659N +Consumer Price Index for the Republic of Korea,korea,annual,growth_previous,CPALTT01KRA657N +Consumer Price Index for the Republic of Korea,korea,annual,growth_same,CPALTT01KRA659N +Consumer Price Index for the Republic of Korea,korea,monthly,growth_previous,CPALTT01KRM657N +Consumer Price Index for the Republic of Korea,korea,monthly,growth_same,CPALTT01KRM659N +Consumer Price Index for the Republic of Korea,korea,quarterly,growth_previous,CPALTT01KRQ657N +Consumer Price Index for the Republic of Korea,korea,quarterly,growth_same,CPALTT01KRQ659N +Consumer Price Index for the Russian Federation,russian_federation,monthly,growth_previous,CPALTT01RUM657N +Consumer Price Index for the Russian Federation,russian_federation,monthly,growth_same,CPALTT01RUM659N +Consumer Price Index for the Russian Federation,russian_federation,quarterly,growth_previous,CPALTT01RUQ657N +Consumer Price Index for the Russian Federation,russian_federation,quarterly,growth_same,CPALTT01RUQ659N +Consumer Price Index for the Slovak Republic,slovak_republic,annual,growth_previous,CPALTT01SKA657N +Consumer Price Index for the Slovak Republic,slovak_republic,annual,growth_same,CPALTT01SKA659N +Consumer Price Index for the Slovak Republic,slovak_republic,monthly,growth_previous,CPALTT01SKM657N +Consumer Price Index for the Slovak Republic,slovak_republic,monthly,growth_same,CPALTT01SKM659N +Consumer Price Index for the Slovak Republic,slovak_republic,quarterly,growth_previous,CPALTT01SKQ657N +Consumer Price Index for the Slovak Republic,slovak_republic,quarterly,growth_same,CPALTT01SKQ659N +Consumer Price Index for the United Kingdom,the united kingdom,annual,growth_previous,CPALTT01GBA657N +Consumer Price Index for the United Kingdom,united_kingdom,annual,growth_same,CPALTT01GBA659N +Consumer Price Index for the United Kingdom,united_kingdom,monthly,growth_previous,CPALTT01GBM657N +Consumer Price Index for the United Kingdom,united_kingdom,monthly,growth_same,CPALTT01GBM659N +Consumer Price Index for the United Kingdom,united_kingdom,quarterly,growth_previous,CPALTT01GBQ657N +Consumer Price Index for the United Kingdom,united_kingdom,quarterly,growth_same,CPALTT01GBQ659N +Consumer Price Index for the United States,united_states,annual,index_2015,CPALCY01USA661N +Consumer Price Index for the United States,united_states,monthly,index_2015,CPALCY01USM661N +Consumer Price Index for the United States,united_states,quarterly,index_2015,CPALCY01USQ661N +Consumer Price Index for the United States,united_states,annual,growth_previous,CPALTT01USA657N +Consumer Price Index for the United States,united_states,annual,growth_same,CPALTT01USA659N +Consumer Price Index for the United States,united_states,annual,index_2015,CPALTT01USA661S +Consumer Price Index for the United States,united_states,monthly,growth_previous,CPALTT01USM657N +Consumer Price Index for the United States,united_states,monthly,growth_same,CPALTT01USM659N +Consumer Price Index for the United States,united_states,monthly,index_2015,CPALTT01USM661S +Consumer Price Index for the United States,united_states,quarterly,growth_previous,CPALTT01USQ657N +Consumer Price Index for the United States,united_states,quarterly,growth_same,CPALTT01USQ659N +Consumer Price Index for the United States,united_states,quarterly,index_2015,CPALTT01USQ661S +Consumer Price Index for Turkey,turkey,annual,index_2015,CPALCY01TRA661N +Consumer Price Index for Turkey,turkey,monthly,index_2015,CPALCY01TRM661N +Consumer Price Index for Turkey,turkey,quarterly,index_2015,CPALCY01TRQ661N +Consumer Price Index for Turkey,turkey,annual,growth_previous,CPALTT01TRA657N +Consumer Price Index for Turkey,turkey,annual,growth_same,CPALTT01TRA659N +Consumer Price Index for Turkey,turkey,monthly,growth_previous,CPALTT01TRM657N +Consumer Price Index for Turkey,turkey,monthly,growth_same,CPALTT01TRM659N +Consumer Price Index for Turkey,turkey,quarterly,growth_previous,CPALTT01TRQ657N Consumer Price Index for Turkey,turkey,quarterly,growth_same,CPALTT01TRQ659N \ No newline at end of file diff --git a/openbb_terminal/keys_controller.py b/openbb_terminal/keys_controller.py index 69c94595a53..976475b934a 100644 --- a/openbb_terminal/keys_controller.py +++ b/openbb_terminal/keys_controller.py @@ -577,52 +577,6 @@ class KeysController(BaseController): # pylint: disable=too-many-public-methods show_output=True, ) - @log_start_end(log=logger) - def call_twitter(self, other_args: List[str]): - """Process twitter command""" - parser = argparse.ArgumentParser( - add_help=False, - formatter_class=argparse.ArgumentDefaultsHelpFormatter, - prog="twitter", - description="Set Twitter API key.", - ) - parser.add_argument( - "-k", - "--key", - type=str, - dest="key", - help="Key", - required="-h" not in other_args and "--help" not in other_args, - ) - parser.add_argument( - "-s", - "--secret", - type=str, - dest="secret", - help="Secret key", - required="-h" not in other_args and "--help" not in other_args, - ) - parser.add_argument( - "-t", - "--token", - type=str, - dest="token", - help="Bearer token", - required="-h" not in other_args and "--help" not in other_args, - ) - if not other_args: - console.print("For your API Key, visit: https://developer.twitter.com") - return - ns_parser = self.parse_simple_args(parser, other_args) - if ns_parser: - self.status_dict["twitter"] = keys_model.set_twitter_key( - key=ns_parser.key, - secret=ns_parser.secret, - access_token=ns_parser.token, - persist=True, - show_output=True, - ) - @log_start_end(log=logger) def call_rh(self, other_args: List[str]): """Process rh command""" diff --git a/openbb_terminal/keys_model.py b/openbb_terminal/keys_model.py index 12d6347f604..5582e0aea3a 100644 --- a/openbb_terminal/keys_model.py +++ b/openbb_terminal/keys_model.py @@ -64,7 +64,6 @@ API_DICT: Dict = { "cmc": "COINMARKETCAP", "finnhub": "FINNHUB", "reddit": "REDDIT", - "twitter": "TWITTER", "rh": "ROBINHOOD", "degiro": "DEGIRO", "oanda": "OANDA", @@ -1160,100 +1159,6 @@ def check_bitquery_key(show_output: bool = False) -> str: return str(status) -def set_twitter_key( - key: str, - secret: str, - access_token: str, - persist: bool = False, - show_output: bool = False, -) -> str: - """Set Twitter key - - Parameters - ---------- - key: str - API key - secret: str - API secret - access_token: str - API token - persist: bool, optional - If False, api key change will be contained to where it was changed. For example, a Jupyter notebook session. - If True, api key change will be global, i.e. it will affect terminal environment variables. - By default, False. - show_output: bool, optional - Display status string or not. By default, False. - - Returns - ------- - str - Status of key set - - Examples - -------- - >>> from openbb_terminal.sdk import openbb - >>> openbb.keys.twitter( - key="example_key", - secret="example_secret", - access_token="example_access_token" - ) - """ - handle_credential("API_TWITTER_KEY", key, persist) - handle_credential("API_TWITTER_SECRET_KEY", secret, persist) - handle_credential("API_TWITTER_BEARER_TOKEN", access_token, persist) - - return check_twitter_key(show_output) - - -def check_twitter_key(show_output: bool = False) -> str: - """Check Twitter key - - Parameters - ---------- - show_output: bool, optional - Display status string or not. By default, False. - - Returns - ------- - str - Status of key set - """ - - if show_output: - console.print("Checking status...") - - current_user = get_current_user() - if current_user.credentials.API_TWITTER_BEARER_TOKEN == "REPLACE_ME": - status = KeyStatus.NOT_DEFINED - else: - params = { - "query": "(\\$AAPL) (lang:en)", - "max_results": "10", - "tweet.fields": "created_at,lang", - } - r = request( - "https://api.twitter.com/2/tweets/search/recent", - params=params, # type: ignore - headers={ - "authorization": "Bearer " - + current_user.credentials.API_TWITTER_BEARER_TOKEN - }, - ) - if r.status_code == 200: - status = KeyStatus.DEFINED_TEST_PASSED - elif r.status_code in [401, 403]: - logger.warning("Twitter key defined, test failed") - status = KeyStatus.DEFINED_TEST_FAILED - else: - logger.warning("Twitter key defined, test failed") - status = KeyStatus.DEFINED_TEST_INCONCLUSIVE - - if show_output: - console.print(status.colorize()) - - return str(status) - - def set_rh_key( username: str, password: str, diff --git a/openbb_terminal/miscellaneous/integration_tests_scripts/stocks/test_ba.openbb b/openbb_terminal/miscellaneous/integration_tests_scripts/stocks/test_ba.openbb index bdb89752416..df8fe96274e 100644 --- a/openbb_terminal/miscellaneous/integration_tests_scripts/stocks/test_ba.openbb +++ b/openbb_terminal/miscellaneous/integration_tests_scripts/stocks/test_ba.openbb @@ -2,29 +2,21 @@ stocks ba load ${ticker=aapl} headlines -headlines --raw wsb -wsb --new -watchlist -popular -l 5 -n 10 -spacc -spac +popular getdd redditsent trending -stalker -l 3 +stalker bullbear messages -infer -sentiment -d 3 -l 2 mentions regions interest -w yolo queries rise -jcdr -jctr snews +ns help reset exit diff --git a/openbb_terminal/miscellaneous/models/all_api_keys.json b/openbb_terminal/miscellaneous/models/all_api_keys.json index d9abe8d6dc9..cac66c9c54e 100644 --- a/openbb_terminal/miscellaneous/models/all_api_keys.json +++ b/openbb_terminal/miscellaneous/models/all_api_keys.json @@ -65,24 +65,6 @@ "link": "https://polygon.io", "markdown": "Go to: https://polygon.io\n\n![Polygon](https://user-images.githubusercontent.com/46355364/207825623-fcd7f0a3-131a-4294-808c-754c13e38e2a.png)\n\nClick on, \"Get your Free API Key\".\n\n![Polygon](https://user-images.githubusercontent.com/46355364/207825952-ca5540ec-6ed2-4cef-a0ed-bb50b813932c.png)\n\nAfter signing up, the API Key is found at the bottom of the account dashboard page.\n\n![Polygon](https://user-images.githubusercontent.com/46355364/207826258-b1f318fa-fd9c-41d9-bf5c-fe16722e6601.png)" }, - { - "name": "API_TWITTER_KEY", - "source": "Twitter key", - "link": "https://developer.twitter.com", - "markdown": "![Twitter API](https://pbs.twimg.com/media/FooIJF3agAIU8SN?format=png&name=medium)" - }, - { - "name": "API_TWITTER_SECRET_KEY", - "source": "Twitter secret", - "link": "https://developer.twitter.com", - "markdown": "![Twitter API](https://pbs.twimg.com/media/FooIJF3agAIU8SN?format=png&name=medium)" - }, - { - "name": "API_TWITTER_BEARER_TOKEN", - "source": "Twitter token", - "link": "https://developer.twitter.com", - "markdown": "![Twitter API](https://pbs.twimg.com/media/FooIJF3agAIU8SN?format=png&name=medium)" - }, { "name": "API_FRED_KEY", "source": "FRED", diff --git a/openbb_terminal/miscellaneous/models/hub_credentials.json b/openbb_terminal/miscellaneous/models/hub_credentials.json index c0275c172bb..2370ee7b71d 100644 --- a/openbb_terminal/miscellaneous/models/hub_credentials.json +++ b/openbb_terminal/miscellaneous/models/hub_credentials.json @@ -32,8 +32,5 @@ "API_REDDIT_USERNAME": "", "API_REDDIT_USER_AGENT": "", "API_REDDIT_PASSWORD": "", - "API_TWITTER_KEY": "", - "API_TWITTER_SECRET_KEY": "", - "API_TWITTER_BEARER_TOKEN": "", "API_DAPPRADAR_KEY": "" } diff --git a/openbb_terminal/sdk.py b/openbb_terminal/sdk.py index 73165a28464..1990c434c1e 100644 --- a/openbb_terminal/sdk.py +++ b/openbb_terminal/sdk.py @@ -438,7 +438,6 @@ class OpenBBSDK: `stocksera`: Set Stocksera key.\n `tokenterminal`: Set Token Terminal key.\n `tradier`: Set Tradier key\n - `twitter`: Set Twitter key\n `ultima`: Set Ultima Insights key\n `walert`: Set Walert key\n """ diff --git a/openbb_terminal/stocks/behavioural_analysis/ba_controller.py b/openbb_terminal/stocks/behavioural_analysis/ba_controller.py index 00953436ee6..547c5f23897 100644 --- a/openbb_terminal/stocks/behavioural_analysis/ba_controller.py +++ b/openbb_terminal/stocks/behavioural_analysis/ba_controller.py @@ -13,7 +13,6 @@ from openbb_terminal.common.behavioural_analysis import ( google_view, reddit_view, stocktwits_view, - twitter_view, ) from openbb_terminal.core.session.current_user import get_current_user from openbb_terminal.custom_prompt_toolkit import NestedCompleter @@ -21,7 +20,6 @@ from openbb_terminal.decorators import log_start_end from openbb_terminal.helper_funcs import ( EXPORT_BOTH_RAW_DATA_AND_FIGURES, EXPORT_ONLY_RAW_DATA_ALLOWED, - check_int_range, check_non_negative, check_positive, valid_date, @@ -53,8 +51,6 @@ class BehaviouralAnalysisController(StockBaseController): "messages", "trending", "stalker", - "infer", - "sentiment", "mentions", "regions", "queries", @@ -102,8 +98,6 @@ class BehaviouralAnalysisController(StockBaseController): mt.add_cmd("stalker") mt.add_cmd("bullbear", self.ticker) mt.add_cmd("messages", self.ticker) - mt.add_cmd("infer", self.ticker) - mt.add_cmd("sentiment", self.ticker) mt.add_cmd("mentions", self.ticker) mt.add_cmd("regions", self.ticker) mt.add_cmd("interest", self.ticker) @@ -673,106 +667,6 @@ class BehaviouralAnalysisController(StockBaseController): else: console.print("No ticker loaded. Please load using 'load '\n") - @log_start_end(log=logger) - def call_infer(self, other_args: List[str]): - """Process infer command.""" - parser = argparse.ArgumentParser( - add_help=False, - formatter_class=argparse.ArgumentDefaultsHelpFormatter, - prog="infer", - description=""" - Print quick sentiment inference from last tweets that contain the ticker. - This model splits the text into character-level tokens and uses vader sentiment analysis. - [Source: Twitter] - """, - ) - parser.add_argument( - "-l", - "--limit", - action="store", - dest="limit", - type=check_int_range(10, 100), - default=100, - help="limit of latest tweets to infer from.", - ) - if other_args and "-" not in other_args[0][0]: - other_args.insert(0, "-l") - ns_parser = self.parse_known_args_and_warn( - parser, other_args, EXPORT_ONLY_RAW_DATA_ALLOWED - ) - if ns_parser: - if self.ticker: - twitter_view.display_inference( - symbol=self.ticker, - limit=ns_parser.limit, - export=ns_parser.export, - sheet_name=" ".join(ns_parser.sheet_name) - if ns_parser.sheet_name - else None, - ) - else: - console.print("No ticker loaded. Please load using 'load '\n") - - @log_start_end(log=logger) - def call_sentiment(self, other_args: List[str]): - """Process sentiment command.""" - parser = argparse.ArgumentParser( - add_help=False, - formatter_class=argparse.ArgumentDefaultsHelpFormatter, - prog="sentiment", - description=""" - Plot in-depth sentiment predicted from tweets from last days - that contain pre-defined ticker. [Source: Twitter] - """, - ) - # in reality this argument could be 100, but after testing it takes too long - # to compute which may not be acceptable - # TODO: use https://github.com/twintproject/twint instead of twitter API - parser.add_argument( - "-l", - "--limit", - action="store", - dest="limit", - type=check_int_range(10, 62), - default=15, - help="limit of tweets to extract per hour.", - ) - parser.add_argument( - "-d", - "--days", - action="store", - dest="n_days_past", - type=check_int_range(1, 6), - default=6, - help="number of days in the past to extract tweets.", - ) - parser.add_argument( - "-c", - "--compare", - action="store_true", - dest="compare", - help="show corresponding change in stock price", - ) - if other_args and "-" not in other_args[0][0]: - other_args.insert(0, "-l") - ns_parser = self.parse_known_args_and_warn( - parser, other_args, EXPORT_BOTH_RAW_DATA_AND_FIGURES - ) - if ns_parser: - if self.ticker: - twitter_view.display_sentiment( - symbol=self.ticker, - n_tweets=ns_parser.limit, - n_days_past=ns_parser.n_days_past, - compare=ns_parser.compare, - export=ns_parser.export, - sheet_name=" ".join(ns_parser.sheet_name) - if ns_parser.sheet_name - else None, - ) - else: - console.print("No ticker loaded. Please load using 'load '\n") - @log_start_end(log=logger) def call_headlines(self, other_args: List[str]): """Process finbrain command.""" diff --git a/openbb_terminal/stocks/fundamental_analysis/fa_controller.py b/openbb_terminal/stocks/fundamental_analysis/fa_controller.py index f8d6bb666f2..bd6c1e49763 100644 --- a/openbb_terminal/stocks/fundamental_analysis/fa_controller.py +++ b/openbb_terminal/stocks/fundamental_analysis/fa_controller.py @@ -325,8 +325,9 @@ class FundamentalAnalysisController(StockBaseController): formatter_class=argparse.ArgumentDefaultsHelpFormatter, prog="score", description=""" - Value investing tool based on Warren Buffett, Joseph Piotroski - and Benjamin Graham thoughts [Source: FMP] + Value investing based on Warren Buffett, Joseph Piotroski and Benjamin Graham thoughts [Source: FMP]. + Data is gathered from fmp and the scores are calculated using the valinvest library. The repository + For this library can be found here: https://github.com/astro30/valinvest """, ) parser.add_argument( diff --git a/openbb_terminal/stocks/fundamental_analysis/fmp_view.py b/openbb_terminal/stocks/fundamental_analysis/fmp_view.py index 8324b120834..9fa02d3c222 100644 --- a/openbb_terminal/stocks/fundamental_analysis/fmp_view.py +++ b/openbb_terminal/stocks/fundamental_analysis/fmp_view.py @@ -29,7 +29,10 @@ logger = logging.getLogger(__name__) def valinvest_score( symbol: str, years: int, export: str = "", sheet_name: Optional[str] = None ): - """Value investing tool based on Warren Buffett, Joseph Piotroski and Benjamin Graham thoughts [Source: FMP] + """ + Value investing tool based on Warren Buffett, Joseph Piotroski and Benjamin Graham thoughts [Source: FMP] + The data is gathered from fmp and the scores are calculated using the valinvest library. The repository + For this library can be found here: https://github.com/astro30/valinvest Parameters ---------- diff --git a/openbb_terminal/terminal_controller.py b/openbb_terminal/terminal_controller.py index 84453250a20..652c1f95b68 100644 --- a/openbb_terminal/terminal_controller.py +++ b/openbb_terminal/terminal_controller.py @@ -791,8 +791,11 @@ def terminal(jobs_cmds: Optional[List[str]] = None, test_mode=False): export_path = "" if jobs_cmds and "export" in jobs_cmds[0]: - export_path = jobs_cmds[0].split("/")[0].split(" ")[1] - jobs_cmds = ["/".join(jobs_cmds[0].split("/")[1:])] + commands = jobs_cmds[0].split("/") + first_split = commands[0].split(" ") + if len(first_split) > 1: + export_path = first_split[1] + jobs_cmds = ["/".join(commands[1:])] ret_code = 1 t_controller = TerminalController(jobs_cmds) diff --git a/tests/openbb_terminal/common/behavioural_analysis/test_twitter_model.py b/tests/openbb_terminal/common/behavioural_analysis/test_twitter_model.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/tests/openbb_terminal/common/behavioural_analysis/test_twitter_view.py b/tests/openbb_terminal/common/behavioural_analysis/test_twitter_view.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/tests/openbb_terminal/cryptocurrency/defi/test_defi_controller.py b/tests/openbb_terminal/cryptocurrency/defi/test_defi_controller.py index 18fd8e34ecf..a5a1263266c 100644 --- a/tests/openbb_terminal/cryptocurrency/defi/test_defi_controller.py +++ b/tests/openbb_terminal/cryptocurrency/defi/test_defi_controller.py @@ -271,41 +271,6 @@ def test_call_func_expect_queue(expected_queue, func, queue): [], dict(), ), - ( - "call_tokens", - [], - "graph_view.display_uni_tokens", - [], - dict(), - ), - ( - "call_stats", - [], - "graph_view.display_uni_stats", - [], - dict(), - ), - ( - "call_pairs", - [], - "graph_view.display_recently_added", - [], - dict(), - ), - ( - "call_pools", - [], - "graph_view.display_uni_pools", - [], - dict(), - ), - ( - "call_swaps", - [], - "graph_view.display_last_uni_swaps", - [], - dict(), - ), ( "call_vaults", [], diff --git a/tests/openbb_terminal/cryptocurrency/defi/test_graph_model.py b/tests/openbb_terminal/cryptocurrency/defi/test_graph_model.py deleted file mode 100644 index 21acd161cd1..00000000000 --- a/tests/openbb_terminal/cryptocurrency/defi/test_graph_model.py +++ /dev/null @@ -1,74 +0,0 @@ -# IMPORTATION STANDARD - -# IMPORTATION THIRDPARTY -import pandas as pd -import pytest - -# IMPORTATION INTERNAL -from openbb_terminal.cryptocurrency.defi import graph_model - - -@pytest.mark.vcr(record_mode="none") -def test_query_graph_status_400(mocker): - # MOCK GET - attrs = { - "status_code": 400, - } - mock_response = mocker.Mock(**attrs) - mocker.patch(target="requests.post", new=mocker.Mock(return_value=mock_response)) - - graph_model.query_graph(url="http://MOCK_URL", query="MOCK_QUERY") - - -@pytest.mark.vcr -@pytest.mark.parametrize( - "func, kwargs", - [ - ("get_uni_tokens", dict(skip=0, limit=5)), - ("get_uniswap_stats", dict()), - ("get_uni_pools_by_volume", dict()), - ("get_last_uni_swaps", dict(limit=5)), - ], -) -def test_call_func(func, kwargs): - df = getattr(graph_model, func)(**kwargs) - - assert isinstance(df, pd.DataFrame) - assert not df.empty - - -@pytest.mark.vcr(filter_post_data_parameters=[("query", "MOCK_QUERY")]) -def test_get_uniswap_pool_recently_added(): - df = graph_model.get_uniswap_pool_recently_added( - last_days=14, min_volume=100, min_liquidity=0, min_tx=100 - ) - - assert isinstance(df, pd.DataFrame) - assert not df.empty - - -@pytest.mark.vcr(record_mode="none") -@pytest.mark.parametrize( - "func, kwargs", - [ - ("get_uni_tokens", dict(skip=0, limit=5)), - ("get_uniswap_stats", dict()), - ( - "get_uniswap_pool_recently_added", - dict(last_days=14, min_volume=100, min_liquidity=0, min_tx=100), - ), - ("get_uni_pools_by_volume", dict()), - ("get_last_uni_swaps", dict(limit=5)), - ], -) -def test_call_func_empty_df(func, kwargs, mocker): - # MOCK QUERY_GRAPH - mocker.patch( - target="openbb_terminal.cryptocurrency.defi.graph_model.query_graph", - return_value={}, - ) - - df = getattr(graph_model, func)(**kwargs) - - assert isinstance(df, pd.DataFrame) - assert df.empty diff --git a/tests/openbb_terminal/cryptocurrency/defi/test_graph_view.py b/tests/openbb_terminal/cryptocurrency/defi/test_graph_view.py deleted file mode 100644 index d8faec1c4cb..00000000000 --- a/tests/openbb_terminal/cryptocurrency/defi/test_graph_view.py +++ /dev/null @@ -1,38 +0,0 @@ -# IMPORTATION STANDARD - -# IMPORTATION THIRDPARTY -import pytest - -# IMPORTATION INTERNAL -from openbb_terminal.cryptocurrency.defi import graph_view - - -@pytest.mark.vcr -@pytest.mark.parametrize( - "func, kwargs", - [ - ("display_uni_tokens", dict(skip=0, limit=5)), - ("display_uni_stats", dict()), - ("display_uni_pools", dict()), - ("display_last_uni_swaps", dict(limit=5)), - ], -) -def test_call_func(func, kwargs, mocker): - # MOCK EXPORT_DATA - mocker.patch(target="openbb_terminal.cryptocurrency.defi.graph_view.export_data") - - getattr(graph_view, func)(**kwargs) - - -@pytest.mark.vcr(filter_post_data_parameters=[("query", "MOCK_QUERY")]) -def test_display_recently_added(mocker): - # MOCK EXPORT_DATA - mocker.patch(target="openbb_terminal.cryptocurrency.defi.graph_view.export_data") - - graph_view.display_recently_added( - limit=10, - days=7, - min_volume=20, - min_liquidity=0, - min_tx=100, - ) diff --git a/tests/openbb_terminal/cryptocurrency/defi/txt/test_defi_controller/test_print_help.txt b/tests/openbb_terminal/cryptocurrency/defi/txt/test_defi_controller/test_print_help.txt index b86ddac6b61..b3e99ba6d2f 100644 --- a/tests/openbb_terminal/cryptocurrency/defi/txt/test_defi_controller/test_print_help.txt +++ b/tests/openbb_terminal/cryptocurrency/defi/txt/test_defi_controller/test_print_help.txt @@ -1,10 +1,5 @@ newsletter recent DeFi related newsletters [Substack] vaults top DeFi Vaults on different blockchains [Coindix] - tokens tokens trade-able on Uniswap [TheGraph] - stats base statistics about Uniswap [TheGraph] - pairs recently added pairs on Uniswap [TheGraph] - pools pools by volume on Uniswap [TheGraph] - swaps recent swaps done on Uniswap [TheGraph] ldapps lists dApps [DeFiLlama] gdapps top DeFi dApps grouped by chain [DeFiLlama] stvl historical values of the total sum of TVLs from all dApps [DeFiLlama] diff --git a/tests/openbb_terminal/stocks/behavioural_analysis/test_ba_controller.py b/tests/openbb_terminal/stocks/behavioural_analysis/test_ba_controller.py index 888a0ac6936..c966d950db7 100644 --- a/tests/openbb_terminal/stocks/behavioural_analysis/test_ba_controller.py +++ b/tests/openbb_terminal/stocks/behavioural_analysis/test_ba_controller.py @@ -297,27 +297,6 @@ def test_call_func_expect_queue(expected_queue, queue, func): limit=5, ), ), - ( - "call_infer", - ["--limit=20", "--export=csv"], - "twitter_view.display_inference", - [], - dict(symbol="MOCK_TICKER", limit=20, export="csv", sheet_name=None), - ), - ( - "call_sentiment", - ["--limit=20", "--days=2", "--compare", "--export=csv"], - "twitter_view.display_sentiment", - [], - dict( - symbol="MOCK_TICKER", - n_tweets=20, - n_days_past=2, - compare=True, - export="csv", - sheet_name=None, - ), - ), ( "call_mentions", ["--start=2020-12-01", "--export=csv"], @@ -422,8 +401,6 @@ def test_call_func( "call_messages", "call_trending", "call_stalker", - "call_infer", - "call_sentiment", "call_mentions", "call_regions", "call_queries", @@ -456,8 +433,6 @@ def test_call_func_no_parser(func, mocker): "func", [ "call_headlines", - "call_sentiment", - "call_infer", "call_rise", "call_queries", "call_regions", diff --git a/tests/openbb_terminal/stocks/behavioural_analysis/txt/test_ba_controller/test_print_help.txt b/tests/openbb_terminal/stocks/behavioural_analysis/txt/test_ba_controller/test_print_help.txt index e2a9a232e0b..e342867786e 100644 --- a/tests/openbb_terminal/stocks/behavioural_analysis/txt/test_ba_controller/test_print_help.txt +++ b/tests/openbb_terminal/stocks/behavioural_analysis/txt/test_ba_controller/test_print_help.txt @@ -12,8 +12,6 @@ Ticker: TSLA stalker stalk stocktwits user's last messages [Stocktwits] bullbear estimate quick sentiment from last 30 messages on board [Stocktwits] messages output up to the 30 last messages on the board [Stocktwits] - infer infer about stock's sentiment from latest tweets [Twitter] - sentiment in-depth sentiment prediction from tweets over time [Twitter] mentions interest over time based on stock's mentions [Google] regions regions that show highest interest in stock [Google] interest interest over time of sentences versus stock price [Google] diff --git a/tests/openbb_terminal/test_keys_controller.py b/tests/openbb_terminal/test_keys_controller.py index 10c2de4d5cf..8af59ae4f4d 100644 --- a/tests/openbb_terminal/test_keys_controller.py +++ b/tests/openbb_terminal/test_keys_controller.py @@ -148,12 +148,6 @@ def test_call_reddit(other): controller.call_reddit(other) -@pytest.mark.vcr -@pytest.mark.parametrize("other", [[], ["-k", "1234", "-s", "4567", "-t", "890"]]) -def test_call_twitter(other): - controller.call_twitter(other) - - @pytest.mark.vcr @pytest.mark.parametrize("other", [[], ["-u", "1234", "-p", "4567"]]) def test_call_rh(other): diff --git a/tests/openbb_terminal/test_keys_model.py b/tests/openbb_terminal/test_keys_model.py index 7d230a13c20..f5b2883e3dd 100644 --- a/tests/openbb_terminal/test_keys_model.py +++ b/tests/openbb_terminal/test_keys_model.py @@ -367,34 +367,6 @@ def test_set_bitquery_key(args: List[str], persist: bool, show_output: bool, moc mock_check.assert_called_once_with(show_output) -@pytest.mark.vcr -@pytest.mark.parametrize( - "args, persist, show_output", - [ - ( - ["test_key", "test_secret", "test_access_token"], - False, - True, - ), - ( - ["test_key", "test_secret", "test_access_token"], - False, - False, - ), - ], -) -def test_set_twitter_key(args: List[str], persist: bool, show_output: bool, mocker): - mock_check = mocker.patch("openbb_terminal.keys_model.check_twitter_key") - keys_model.set_twitter_key( - key=args[0], - secret=args[1], - access_token=args[2], - persist=persist, - show_output=show_output, - ) - mock_check.assert_called_once_with(show_output) - - @pytest.mark.vcr @pytest.mark.parametrize( "args, persist, show_output", diff --git a/website/content/sdk/reference/crypto/defi/pairs.md b/website/content/sdk/reference/crypto/defi/pairs.md deleted file mode 100644 index 0ce06e6bcac..00000000000 --- a/website/content/sdk/reference/crypto/defi/pairs.md +++ /dev/null @@ -1,83 +0,0 @@ ---- -title: pairs -description: OpenBB SDK Function ---- - -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; - -# pairs - - - - -Get lastly added trade-able pairs on Uniswap with parameters like: - -Source Code: [[link](https://github.com/OpenBB-finance/OpenBBTerminal/tree/main/openbb_terminal/cryptocurrency/defi/graph_model.py#L164)] - -```python -openbb.crypto.defi.pairs(last_days: int = 14, min_volume: int = 100, min_liquidity: int = 0, min_tx: int = 100) -``` - ---- - -## Parameters - -| Name | Type | Description | Default | Optional | -| ---- | ---- | ----------- | ------- | -------- | -| last_days | int | How many days back to look for added pairs. | 14 | True | -| min_volume | int | Minimum volume | 100 | True | -| min_liquidity | int | Minimum liquidity | 0 | True | -| min_tx | int | Minimum number of transactions done in given pool. | 100 | True | - - ---- - -## Returns - -| Type | Description | -| ---- | ----------- | -| pd.DataFrame | Lastly added pairs on Uniswap DEX. | ---- - - - - - - -Prints table showing Lastly added pairs on Uniswap DEX. - -Source Code: [[link](https://github.com/OpenBB-finance/OpenBBTerminal/tree/main/openbb_terminal/cryptocurrency/defi/graph_view.py#L102)] - -```python -openbb.crypto.defi.pairs_chart(limit: int = 20, days: int = 7, min_volume: int = 20, min_liquidity: int = 0, min_tx: int = 100, sortby: str = "created", ascend: bool = False, export: str = "") -``` - ---- - -## Parameters - -| Name | Type | Description | Default | Optional | -| ---- | ---- | ----------- | ------- | -------- | -| limit | int | Number of records to display | 20 | True | -| days | int | Number of days the pair has been active, | 7 | True | -| min_volume | int | Minimum trading volume, | 20 | True | -| min_liquidity | int | Minimum liquidity | 0 | True | -| min_tx | int | Minimum number of transactions | 100 | True | -| sortby | str | Key by which to sort data | created | True | -| ascend | bool | Flag to sort data descending | False | True | -| export | str | Export dataframe data to csv,json,xlsx file | | True | - - ---- - -## Returns - -This function does not return anything - ---- - - - - - \ No newline at end of file diff --git a/website/content/sdk/reference/crypto/defi/pools.md b/website/content/sdk/reference/crypto/defi/pools.md deleted file mode 100644 index 35c5a8686fd..00000000000 --- a/website/content/sdk/reference/crypto/defi/pools.md +++ /dev/null @@ -1,73 +0,0 @@ ---- -title: pools -description: OpenBB SDK Function ---- - -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; - -# pools - - - - -Get uniswap pools by volume. [Source: https://thegraph.com/en/] - -Source Code: [[link](https://github.com/OpenBB-finance/OpenBBTerminal/tree/main/openbb_terminal/cryptocurrency/defi/graph_model.py#L253)] - -```python -openbb.crypto.defi.pools() -``` - ---- - -## Parameters - -This function does not take any parameters. - ---- - -## Returns - -| Type | Description | -| ---- | ----------- | -| pd.DataFrame | Trade-able pairs listed on Uniswap by top volume. | ---- - - - - - - -Prints table showing uniswap pools by volume. - -Source Code: [[link](https://github.com/OpenBB-finance/OpenBBTerminal/tree/main/openbb_terminal/cryptocurrency/defi/graph_view.py#L170)] - -```python -openbb.crypto.defi.pools_chart(limit: int = 20, sortby: str = "volumeUSD", ascend: bool = True, export: str = "") -``` - ---- - -## Parameters - -| Name | Type | Description | Default | Optional | -| ---- | ---- | ----------- | ------- | -------- | -| limit | int | Number of records to display | 20 | True | -| sortby | str | Key by which to sort data. The table can be sorted by every of its columns
(see https://bit.ly/3ORagr1 then press ctrl-enter or execute the query). | volumeUSD | True | -| ascend | bool | Flag to sort data descending | True | True | -| export | str | Export dataframe data to csv,json,xlsx file | | True | - - ---- - -## Returns - -This function does not return anything - ---- - - - -
-
\ No newline at end of file diff --git a/website/content/sdk/reference/crypto/defi/stats.md b/website/content/sdk/reference/crypto/defi/stats.md deleted file mode 100644 index 3c8be8c9c97..00000000000 --- a/website/content/sdk/reference/crypto/defi/stats.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -title: stats -description: OpenBB SDK Function ---- - -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; - -# stats - - - - -Get base statistics about Uniswap DEX. [Source: https://thegraph.com/en/] - -Source Code: [[link](https://github.com/OpenBB-finance/OpenBBTerminal/tree/main/openbb_terminal/cryptocurrency/defi/graph_model.py#L124)] - -```python -openbb.crypto.defi.stats() -``` - ---- - -## Parameters - -This function does not take any parameters. - ---- - -## Returns - -| Type | Description | -| ---- | ----------- | -| pd.DataFrame | Uniswap DEX statistics like liquidity, volume, number of pairs, number of transactions. | ---- - - - - - - -Prints table showing base statistics about Uniswap DEX. [Source: https://thegraph.com/en/] - -Source Code: [[link](https://github.com/OpenBB-finance/OpenBBTerminal/tree/main/openbb_terminal/cryptocurrency/defi/graph_view.py#L72)] - -```python -openbb.crypto.defi.stats_chart(export: str = "") -``` - ---- - -## Parameters - -| Name | Type | Description | Default | Optional | -| ---- | ---- | ----------- | ------- | -------- | -| export | str | Export dataframe data to csv,json,xlsx file | | True | - - ---- - -## Returns - -This function does not return anything - ---- - - - - - \ No newline at end of file diff --git a/website/content/sdk/reference/crypto/defi/swaps.md b/website/content/sdk/reference/crypto/defi/swaps.md deleted file mode 100644 index 97473b7ef4c..00000000000 --- a/website/content/sdk/reference/crypto/defi/swaps.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: swaps -description: OpenBB SDK Function ---- - -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; - -# swaps - - - - -Get the last 100 swaps done on Uniswap [Source: https://thegraph.com/en/] - -Source Code: [[link](https://github.com/OpenBB-finance/OpenBBTerminal/tree/main/openbb_terminal/cryptocurrency/defi/graph_model.py#L296)] - -```python -openbb.crypto.defi.swaps(limit: int = 100, sortby: str = "timestamp", ascend: bool = False) -``` - ---- - -## Parameters - -| Name | Type | Description | Default | Optional | -| ---- | ---- | ----------- | ------- | -------- | -| limit | int | Number of swaps to return. Maximum possible number: 1000. | 100 | True | -| sortby | str | Key by which to sort data. The table can be sorted by every of its columns
(see https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2). | timestamp | True | -| ascend | bool | Flag to sort data descending | False | True | - - ---- - -## Returns - -| Type | Description | -| ---- | ----------- | -| pd.DataFrame | Last 100 swaps on Uniswap | ---- - - - -
- - -Prints table showing last swaps done on Uniswap - -Source Code: [[link](https://github.com/OpenBB-finance/OpenBBTerminal/tree/main/openbb_terminal/cryptocurrency/defi/graph_view.py#L218)] - -```python -openbb.crypto.defi.swaps_chart(limit: int = 10, sortby: str = "timestamp", ascend: bool = False, export: str = "") -``` - ---- - -## Parameters - -| Name | Type | Description | Default | Optional | -| ---- | ---- | ----------- | ------- | -------- | -| limit | int | Number of records to display | 10 | True | -| sortby | str | Key by which to sort data. The table can be sorted by every of its columns
(see https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2). | timestamp | True | -| ascend | bool | Flag to sort data descending | False | True | -| export | str | Export dataframe data to csv,json,xlsx file | | True | - - ---- - -## Returns - -This function does not return anything - ---- - - - -
-
\ No newline at end of file diff --git a/website/content/sdk/reference/crypto/defi/tokens.md b/website/content/sdk/reference/crypto/defi/tokens.md deleted file mode 100644 index 17f7dd6e818..00000000000 --- a/website/content/sdk/reference/crypto/defi/tokens.md +++ /dev/null @@ -1,80 +0,0 @@ ---- -title: tokens -description: OpenBB SDK Function ---- - -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; - -# tokens - - - - -Get list of tokens trade-able on Uniswap DEX. [Source: https://thegraph.com/en/] - -Source Code: [[link](https://github.com/OpenBB-finance/OpenBBTerminal/tree/main/openbb_terminal/cryptocurrency/defi/graph_model.py#L81)] - -```python -openbb.crypto.defi.tokens(skip: int = 0, limit: int = 100, sortby: str = "index", ascend: bool = False) -``` - ---- - -## Parameters - -| Name | Type | Description | Default | Optional | -| ---- | ---- | ----------- | ------- | -------- | -| skip | int | Skip n number of records. | 0 | True | -| limit | int | Show n number of records. | 100 | True | -| sortby | str | The column to sort by | index | True | -| ascend | bool | Whether to sort in ascending order | False | True | - - ---- - -## Returns - -| Type | Description | -| ---- | ----------- | -| pd.DataFrame | Uniswap tokens with trading volume, transaction count, liquidity. | ---- - - - - - - -Prints table showing tokens trade-able on Uniswap DEX. - -Source Code: [[link](https://github.com/OpenBB-finance/OpenBBTerminal/tree/main/openbb_terminal/cryptocurrency/defi/graph_view.py#L18)] - -```python -openbb.crypto.defi.tokens_chart(skip: int = 0, limit: int = 20, sortby: str = "index", ascend: bool = False, export: str = "") -``` - ---- - -## Parameters - -| Name | Type | Description | Default | Optional | -| ---- | ---- | ----------- | ------- | -------- | -| skip | int | Number of records to skip | 0 | True | -| limit | int | Number of records to display | 20 | True | -| sortby | str | Key by which to sort data | index | True | -| ascend | bool | Flag to sort data descending | False | True | -| export | str | Export dataframe data to csv,json,xlsx file | | True | - - ---- - -## Returns - -This function does not return anything - ---- - - - - - \ No newline at end of file diff --git a/website/content/terminal/usage/guides/api-keys.md b/website/content/terminal/usage/guides/api-keys.md index d15f8792fd5..30f712e3cb8 100644 --- a/website/content/terminal/usage/guides/api-keys.md +++ b/website/content/terminal/usage/guides/api-keys.md @@ -2,7 +2,7 @@ title: Setting API Keys sidebar_position: 1 description: API (Application Programming Interface) keys are access credentials for accessing data from a particular source. Learn how to set, manage, and access data APIs for the OpenBB Terminal. -keywords: [api, keys, api keys, openbb terminal, data provider, data, free, alpha vantage, fred, iex, twitter, degiro, binance, coinglass, polygon, intrinio, sdk, alphavantage, bitquery, coinbase, databento, finnhub, FRED, github, glassnode, iex cloud, news API, robinhood, santiment, shroomdk, token terminal, tradier, twitter, whale alert] +keywords: [api, keys, api keys, openbb terminal, data provider, data, free, alpha vantage, fred, iex, degiro, binance, coinglass, polygon, intrinio, sdk, alphavantage, bitquery, coinbase, databento, finnhub, FRED, github, glassnode, iex cloud, news API, robinhood, santiment, shroomdk, token terminal, tradier, whale alert] --- import HeadTitle from '@site/src/components/General/HeadTitle.tsx';