From 79bacf3f51e350532efb1ab56f91250e04c8e33a Mon Sep 17 00:00:00 2001 From: Theodore Aptekarev Date: Thu, 2 Dec 2021 02:19:50 +0300 Subject: [PATCH] Fix mypy hook and Resolve documentation errors (#1008) * Make mypy pre-commit check non-strict * Fix mypy pre-commit hook * Update docstrings to be compliant with sphinx-readthedocs commonmark * Change report path to be relative to the module and not the terminal.py * Update class library documentation --- .pre-commit-config.yaml | 3 +- docs/README.md | 4 +- ...gamestonk_terminal.cryptocurrency.defi.rst | 16 ++ ..._terminal.cryptocurrency.due_diligence.rst | 48 +++-- ...estonk_terminal.cryptocurrency.onchain.rst | 16 -- ...stonk_terminal.cryptocurrency.overview.rst | 16 ++ docs/code/gamestonk_terminal.economy.rst | 16 ++ docs/code/gamestonk_terminal.options.rst | 165 ----------------- docs/code/gamestonk_terminal.rst | 1 - ...stonk_terminal.stocks.dark_pool_shorts.rst | 16 ++ .../gamestonk_terminal.stocks.discovery.rst | 16 ++ .../gamestonk_terminal.stocks.options.rst | 173 ++++++++++++++++++ docs/code/gamestonk_terminal.stocks.rst | 1 + .../cryptocurrency/cryptocurrency_helpers.py | 17 +- .../cryptocurrency/defi/defirate_view.py | 6 +- .../due_diligence/coinpaprika_model.py | 90 ++++----- .../brokers/coinbase/coinbase_model.py | 64 ++++--- .../reports/reports_controller.py | 4 +- .../stocks/dark_pool_shorts/dps_controller.py | 1 + .../stocks/discovery/disc_controller.py | 1 + 20 files changed, 398 insertions(+), 276 deletions(-) delete mode 100644 docs/code/gamestonk_terminal.options.rst create mode 100644 docs/code/gamestonk_terminal.stocks.options.rst diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e523637d9e3..679c1f49c90 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,7 +28,8 @@ repos: rev: 'v0.910-1' hooks: - id: mypy - args: [ '--ignore-missing-imports', '--exclude=/setup\.py$', '.'] + args: ['--ignore-missing-imports', '--exclude=/setup\.py$'] + additional_dependencies: [types-all] - repo: local hooks: - id: pylint diff --git a/docs/README.md b/docs/README.md index b7b62609e27..1924a2dc7b2 100644 --- a/docs/README.md +++ b/docs/README.md @@ -9,7 +9,9 @@ The `requirements.txt` file that mentions `myst_parser` is needed for readthedoc Usage: +In the `docs` folder execute: + ```bash -sphinx-apidoc ../gamestonk_terminal/ -o ./code +rm -rf code && sphinx-apidoc ../gamestonk_terminal/ -o ./code make html ``` diff --git a/docs/code/gamestonk_terminal.cryptocurrency.defi.rst b/docs/code/gamestonk_terminal.cryptocurrency.defi.rst index a896e1ad60b..f65558ea43c 100644 --- a/docs/code/gamestonk_terminal.cryptocurrency.defi.rst +++ b/docs/code/gamestonk_terminal.cryptocurrency.defi.rst @@ -44,6 +44,22 @@ gamestonk\_terminal.cryptocurrency.defi.defirate\_view module :undoc-members: :show-inheritance: +gamestonk\_terminal.cryptocurrency.defi.graph\_model module +----------------------------------------------------------- + +.. automodule:: gamestonk_terminal.cryptocurrency.defi.graph_model + :members: + :undoc-members: + :show-inheritance: + +gamestonk\_terminal.cryptocurrency.defi.graph\_view module +---------------------------------------------------------- + +.. automodule:: gamestonk_terminal.cryptocurrency.defi.graph_view + :members: + :undoc-members: + :show-inheritance: + gamestonk\_terminal.cryptocurrency.defi.llama\_model module ----------------------------------------------------------- diff --git a/docs/code/gamestonk_terminal.cryptocurrency.due_diligence.rst b/docs/code/gamestonk_terminal.cryptocurrency.due_diligence.rst index 32cea3c71f4..c44db7851e2 100644 --- a/docs/code/gamestonk_terminal.cryptocurrency.due_diligence.rst +++ b/docs/code/gamestonk_terminal.cryptocurrency.due_diligence.rst @@ -20,22 +20,6 @@ gamestonk\_terminal.cryptocurrency.due\_diligence.binance\_view module :undoc-members: :show-inheritance: -gamestonk\_terminal.cryptocurrency.due\_diligence.bybt\_model module --------------------------------------------------------------------- - -.. automodule:: gamestonk_terminal.cryptocurrency.due_diligence.bybt_model - :members: - :undoc-members: - :show-inheritance: - -gamestonk\_terminal.cryptocurrency.due\_diligence.bybt\_view module -------------------------------------------------------------------- - -.. automodule:: gamestonk_terminal.cryptocurrency.due_diligence.bybt_view - :members: - :undoc-members: - :show-inheritance: - gamestonk\_terminal.cryptocurrency.due\_diligence.coinbase\_model module ------------------------------------------------------------------------ @@ -52,6 +36,22 @@ gamestonk\_terminal.cryptocurrency.due\_diligence.coinbase\_view module :undoc-members: :show-inheritance: +gamestonk\_terminal.cryptocurrency.due\_diligence.coinglass\_model module +------------------------------------------------------------------------- + +.. automodule:: gamestonk_terminal.cryptocurrency.due_diligence.coinglass_model + :members: + :undoc-members: + :show-inheritance: + +gamestonk\_terminal.cryptocurrency.due\_diligence.coinglass\_view module +------------------------------------------------------------------------ + +.. automodule:: gamestonk_terminal.cryptocurrency.due_diligence.coinglass_view + :members: + :undoc-members: + :show-inheritance: + gamestonk\_terminal.cryptocurrency.due\_diligence.coinpaprika\_model module --------------------------------------------------------------------------- @@ -84,6 +84,22 @@ gamestonk\_terminal.cryptocurrency.due\_diligence.finbrain\_crypto\_view module :undoc-members: :show-inheritance: +gamestonk\_terminal.cryptocurrency.due\_diligence.glassnode\_model module +------------------------------------------------------------------------- + +.. automodule:: gamestonk_terminal.cryptocurrency.due_diligence.glassnode_model + :members: + :undoc-members: + :show-inheritance: + +gamestonk\_terminal.cryptocurrency.due\_diligence.glassnode\_view module +------------------------------------------------------------------------ + +.. automodule:: gamestonk_terminal.cryptocurrency.due_diligence.glassnode_view + :members: + :undoc-members: + :show-inheritance: + gamestonk\_terminal.cryptocurrency.due\_diligence.pycoingecko\_model module --------------------------------------------------------------------------- diff --git a/docs/code/gamestonk_terminal.cryptocurrency.onchain.rst b/docs/code/gamestonk_terminal.cryptocurrency.onchain.rst index dfe3c4c22c8..6465a670898 100644 --- a/docs/code/gamestonk_terminal.cryptocurrency.onchain.rst +++ b/docs/code/gamestonk_terminal.cryptocurrency.onchain.rst @@ -36,22 +36,6 @@ gamestonk\_terminal.cryptocurrency.onchain.ethplorer\_view module :undoc-members: :show-inheritance: -gamestonk\_terminal.cryptocurrency.onchain.glassnode\_model module ------------------------------------------------------------------- - -.. automodule:: gamestonk_terminal.cryptocurrency.onchain.glassnode_model - :members: - :undoc-members: - :show-inheritance: - -gamestonk\_terminal.cryptocurrency.onchain.glassnode\_view module ------------------------------------------------------------------ - -.. automodule:: gamestonk_terminal.cryptocurrency.onchain.glassnode_view - :members: - :undoc-members: - :show-inheritance: - gamestonk\_terminal.cryptocurrency.onchain.onchain\_controller module --------------------------------------------------------------------- diff --git a/docs/code/gamestonk_terminal.cryptocurrency.overview.rst b/docs/code/gamestonk_terminal.cryptocurrency.overview.rst index 4b7e50e21ef..c985655d2e7 100644 --- a/docs/code/gamestonk_terminal.cryptocurrency.overview.rst +++ b/docs/code/gamestonk_terminal.cryptocurrency.overview.rst @@ -36,6 +36,22 @@ gamestonk\_terminal.cryptocurrency.overview.coinpaprika\_view module :undoc-members: :show-inheritance: +gamestonk\_terminal.cryptocurrency.overview.cryptopanic\_model module +--------------------------------------------------------------------- + +.. automodule:: gamestonk_terminal.cryptocurrency.overview.cryptopanic_model + :members: + :undoc-members: + :show-inheritance: + +gamestonk\_terminal.cryptocurrency.overview.cryptopanic\_view module +-------------------------------------------------------------------- + +.. automodule:: gamestonk_terminal.cryptocurrency.overview.cryptopanic_view + :members: + :undoc-members: + :show-inheritance: + gamestonk\_terminal.cryptocurrency.overview.overview\_controller module ----------------------------------------------------------------------- diff --git a/docs/code/gamestonk_terminal.economy.rst b/docs/code/gamestonk_terminal.economy.rst index 231363b4579..037caf6df58 100644 --- a/docs/code/gamestonk_terminal.economy.rst +++ b/docs/code/gamestonk_terminal.economy.rst @@ -100,6 +100,22 @@ gamestonk\_terminal.economy.fred\_view module :undoc-members: :show-inheritance: +gamestonk\_terminal.economy.nasdaq\_model module +------------------------------------------------ + +.. automodule:: gamestonk_terminal.economy.nasdaq_model + :members: + :undoc-members: + :show-inheritance: + +gamestonk\_terminal.economy.nasdaq\_view module +----------------------------------------------- + +.. automodule:: gamestonk_terminal.economy.nasdaq_view + :members: + :undoc-members: + :show-inheritance: + gamestonk\_terminal.economy.wsj\_model module --------------------------------------------- diff --git a/docs/code/gamestonk_terminal.options.rst b/docs/code/gamestonk_terminal.options.rst deleted file mode 100644 index 6d75b417b6f..00000000000 --- a/docs/code/gamestonk_terminal.options.rst +++ /dev/null @@ -1,165 +0,0 @@ -gamestonk\_terminal.options package -=================================== - -Submodules ----------- - -gamestonk\_terminal.options.alphaquery\_model module ----------------------------------------------------- - -.. automodule:: gamestonk_terminal.options.alphaquery_model - :members: - :undoc-members: - :show-inheritance: - -gamestonk\_terminal.options.alphaquery\_view module ---------------------------------------------------- - -.. automodule:: gamestonk_terminal.options.alphaquery_view - :members: - :undoc-members: - :show-inheritance: - -gamestonk\_terminal.options.barchart\_model module --------------------------------------------------- - -.. automodule:: gamestonk_terminal.options.barchart_model - :members: - :undoc-members: - :show-inheritance: - -gamestonk\_terminal.options.barchart\_view module -------------------------------------------------- - -.. automodule:: gamestonk_terminal.options.barchart_view - :members: - :undoc-members: - :show-inheritance: - -gamestonk\_terminal.options.calculator\_model module ----------------------------------------------------- - -.. automodule:: gamestonk_terminal.options.calculator_model - :members: - :undoc-members: - :show-inheritance: - -gamestonk\_terminal.options.calculator\_view module ---------------------------------------------------- - -.. automodule:: gamestonk_terminal.options.calculator_view - :members: - :undoc-members: - :show-inheritance: - -gamestonk\_terminal.options.chartexchange\_model module -------------------------------------------------------- - -.. automodule:: gamestonk_terminal.options.chartexchange_model - :members: - :undoc-members: - :show-inheritance: - -gamestonk\_terminal.options.chartexchange\_view module ------------------------------------------------------- - -.. automodule:: gamestonk_terminal.options.chartexchange_view - :members: - :undoc-members: - :show-inheritance: - -gamestonk\_terminal.options.fdscanner\_model module ---------------------------------------------------- - -.. automodule:: gamestonk_terminal.options.fdscanner_model - :members: - :undoc-members: - :show-inheritance: - -gamestonk\_terminal.options.fdscanner\_view module --------------------------------------------------- - -.. automodule:: gamestonk_terminal.options.fdscanner_view - :members: - :undoc-members: - :show-inheritance: - -gamestonk\_terminal.options.op\_helpers module ----------------------------------------------- - -.. automodule:: gamestonk_terminal.options.op_helpers - :members: - :undoc-members: - :show-inheritance: - -gamestonk\_terminal.options.options\_controller module ------------------------------------------------------- - -.. automodule:: gamestonk_terminal.options.options_controller - :members: - :undoc-members: - :show-inheritance: - -gamestonk\_terminal.options.payoff\_controller module ------------------------------------------------------ - -.. automodule:: gamestonk_terminal.options.payoff_controller - :members: - :undoc-members: - :show-inheritance: - -gamestonk\_terminal.options.syncretism\_model module ----------------------------------------------------- - -.. automodule:: gamestonk_terminal.options.syncretism_model - :members: - :undoc-members: - :show-inheritance: - -gamestonk\_terminal.options.syncretism\_view module ---------------------------------------------------- - -.. automodule:: gamestonk_terminal.options.syncretism_view - :members: - :undoc-members: - :show-inheritance: - -gamestonk\_terminal.options.tradier\_model module -------------------------------------------------- - -.. automodule:: gamestonk_terminal.options.tradier_model - :members: - :undoc-members: - :show-inheritance: - -gamestonk\_terminal.options.tradier\_view module ------------------------------------------------- - -.. automodule:: gamestonk_terminal.options.tradier_view - :members: - :undoc-members: - :show-inheritance: - -gamestonk\_terminal.options.yfinance\_model module --------------------------------------------------- - -.. automodule:: gamestonk_terminal.options.yfinance_model - :members: - :undoc-members: - :show-inheritance: - -gamestonk\_terminal.options.yfinance\_view module -------------------------------------------------- - -.. automodule:: gamestonk_terminal.options.yfinance_view - :members: - :undoc-members: - :show-inheritance: - -Module contents ---------------- - -.. automodule:: gamestonk_terminal.options - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/code/gamestonk_terminal.rst b/docs/code/gamestonk_terminal.rst index 6931a78c753..37fbefedd0d 100644 --- a/docs/code/gamestonk_terminal.rst +++ b/docs/code/gamestonk_terminal.rst @@ -12,7 +12,6 @@ Subpackages gamestonk_terminal.economy gamestonk_terminal.etf gamestonk_terminal.forex - gamestonk_terminal.options gamestonk_terminal.portfolio gamestonk_terminal.reports gamestonk_terminal.resources diff --git a/docs/code/gamestonk_terminal.stocks.dark_pool_shorts.rst b/docs/code/gamestonk_terminal.stocks.dark_pool_shorts.rst index e85456fe3e6..0a24cd750d0 100644 --- a/docs/code/gamestonk_terminal.stocks.dark_pool_shorts.rst +++ b/docs/code/gamestonk_terminal.stocks.dark_pool_shorts.rst @@ -28,6 +28,22 @@ gamestonk\_terminal.stocks.dark\_pool\_shorts.finra\_view module :undoc-members: :show-inheritance: +gamestonk\_terminal.stocks.dark\_pool\_shorts.nyse\_model module +---------------------------------------------------------------- + +.. automodule:: gamestonk_terminal.stocks.dark_pool_shorts.nyse_model + :members: + :undoc-members: + :show-inheritance: + +gamestonk\_terminal.stocks.dark\_pool\_shorts.nyse\_view module +--------------------------------------------------------------- + +.. automodule:: gamestonk_terminal.stocks.dark_pool_shorts.nyse_view + :members: + :undoc-members: + :show-inheritance: + gamestonk\_terminal.stocks.dark\_pool\_shorts.quandl\_model module ------------------------------------------------------------------ diff --git a/docs/code/gamestonk_terminal.stocks.discovery.rst b/docs/code/gamestonk_terminal.stocks.discovery.rst index d235d39d861..204b8c394cb 100644 --- a/docs/code/gamestonk_terminal.stocks.discovery.rst +++ b/docs/code/gamestonk_terminal.stocks.discovery.rst @@ -100,6 +100,22 @@ gamestonk\_terminal.stocks.discovery.marketbeat\_view module :undoc-members: :show-inheritance: +gamestonk\_terminal.stocks.discovery.nasdaq\_model module +--------------------------------------------------------- + +.. automodule:: gamestonk_terminal.stocks.discovery.nasdaq_model + :members: + :undoc-members: + :show-inheritance: + +gamestonk\_terminal.stocks.discovery.nasdaq\_view module +-------------------------------------------------------- + +.. automodule:: gamestonk_terminal.stocks.discovery.nasdaq_view + :members: + :undoc-members: + :show-inheritance: + gamestonk\_terminal.stocks.discovery.seeking\_alpha\_model module ----------------------------------------------------------------- diff --git a/docs/code/gamestonk_terminal.stocks.options.rst b/docs/code/gamestonk_terminal.stocks.options.rst new file mode 100644 index 00000000000..11d2674745c --- /dev/null +++ b/docs/code/gamestonk_terminal.stocks.options.rst @@ -0,0 +1,173 @@ +gamestonk\_terminal.stocks.options package +========================================== + +Submodules +---------- + +gamestonk\_terminal.stocks.options.alphaquery\_model module +----------------------------------------------------------- + +.. automodule:: gamestonk_terminal.stocks.options.alphaquery_model + :members: + :undoc-members: + :show-inheritance: + +gamestonk\_terminal.stocks.options.alphaquery\_view module +---------------------------------------------------------- + +.. automodule:: gamestonk_terminal.stocks.options.alphaquery_view + :members: + :undoc-members: + :show-inheritance: + +gamestonk\_terminal.stocks.options.barchart\_model module +--------------------------------------------------------- + +.. automodule:: gamestonk_terminal.stocks.options.barchart_model + :members: + :undoc-members: + :show-inheritance: + +gamestonk\_terminal.stocks.options.barchart\_view module +-------------------------------------------------------- + +.. automodule:: gamestonk_terminal.stocks.options.barchart_view + :members: + :undoc-members: + :show-inheritance: + +gamestonk\_terminal.stocks.options.calculator\_model module +----------------------------------------------------------- + +.. automodule:: gamestonk_terminal.stocks.options.calculator_model + :members: + :undoc-members: + :show-inheritance: + +gamestonk\_terminal.stocks.options.calculator\_view module +---------------------------------------------------------- + +.. automodule:: gamestonk_terminal.stocks.options.calculator_view + :members: + :undoc-members: + :show-inheritance: + +gamestonk\_terminal.stocks.options.chartexchange\_model module +-------------------------------------------------------------- + +.. automodule:: gamestonk_terminal.stocks.options.chartexchange_model + :members: + :undoc-members: + :show-inheritance: + +gamestonk\_terminal.stocks.options.chartexchange\_view module +------------------------------------------------------------- + +.. automodule:: gamestonk_terminal.stocks.options.chartexchange_view + :members: + :undoc-members: + :show-inheritance: + +gamestonk\_terminal.stocks.options.fdscanner\_model module +---------------------------------------------------------- + +.. automodule:: gamestonk_terminal.stocks.options.fdscanner_model + :members: + :undoc-members: + :show-inheritance: + +gamestonk\_terminal.stocks.options.fdscanner\_view module +--------------------------------------------------------- + +.. automodule:: gamestonk_terminal.stocks.options.fdscanner_view + :members: + :undoc-members: + :show-inheritance: + +gamestonk\_terminal.stocks.options.op\_helpers module +----------------------------------------------------- + +.. automodule:: gamestonk_terminal.stocks.options.op_helpers + :members: + :undoc-members: + :show-inheritance: + +gamestonk\_terminal.stocks.options.options\_controller module +------------------------------------------------------------- + +.. automodule:: gamestonk_terminal.stocks.options.options_controller + :members: + :undoc-members: + :show-inheritance: + +gamestonk\_terminal.stocks.options.payoff\_controller module +------------------------------------------------------------ + +.. automodule:: gamestonk_terminal.stocks.options.payoff_controller + :members: + :undoc-members: + :show-inheritance: + +gamestonk\_terminal.stocks.options.pricing\_controller module +------------------------------------------------------------- + +.. automodule:: gamestonk_terminal.stocks.options.pricing_controller + :members: + :undoc-members: + :show-inheritance: + +gamestonk\_terminal.stocks.options.syncretism\_model module +----------------------------------------------------------- + +.. automodule:: gamestonk_terminal.stocks.options.syncretism_model + :members: + :undoc-members: + :show-inheritance: + +gamestonk\_terminal.stocks.options.syncretism\_view module +---------------------------------------------------------- + +.. automodule:: gamestonk_terminal.stocks.options.syncretism_view + :members: + :undoc-members: + :show-inheritance: + +gamestonk\_terminal.stocks.options.tradier\_model module +-------------------------------------------------------- + +.. automodule:: gamestonk_terminal.stocks.options.tradier_model + :members: + :undoc-members: + :show-inheritance: + +gamestonk\_terminal.stocks.options.tradier\_view module +------------------------------------------------------- + +.. automodule:: gamestonk_terminal.stocks.options.tradier_view + :members: + :undoc-members: + :show-inheritance: + +gamestonk\_terminal.stocks.options.yfinance\_model module +--------------------------------------------------------- + +.. automodule:: gamestonk_terminal.stocks.options.yfinance_model + :members: + :undoc-members: + :show-inheritance: + +gamestonk\_terminal.stocks.options.yfinance\_view module +-------------------------------------------------------- + +.. automodule:: gamestonk_terminal.stocks.options.yfinance_view + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: gamestonk_terminal.stocks.options + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/code/gamestonk_terminal.stocks.rst b/docs/code/gamestonk_terminal.stocks.rst index 91bb3cae77a..64463020a26 100644 --- a/docs/code/gamestonk_terminal.stocks.rst +++ b/docs/code/gamestonk_terminal.stocks.rst @@ -16,6 +16,7 @@ Subpackages gamestonk_terminal.stocks.fundamental_analysis gamestonk_terminal.stocks.government gamestonk_terminal.stocks.insider + gamestonk_terminal.stocks.options gamestonk_terminal.stocks.prediction_techniques gamestonk_terminal.stocks.quantitative_analysis gamestonk_terminal.stocks.research diff --git a/gamestonk_terminal/cryptocurrency/cryptocurrency_helpers.py b/gamestonk_terminal/cryptocurrency/cryptocurrency_helpers.py index 9c161325955..24c4f80409f 100644 --- a/gamestonk_terminal/cryptocurrency/cryptocurrency_helpers.py +++ b/gamestonk_terminal/cryptocurrency/cryptocurrency_helpers.py @@ -59,8 +59,9 @@ def load_coinbase_map(): def prepare_all_coins_df() -> pd.DataFrame: - """Helper method which loads coins from all sources: CoinGecko, CoinPaprika, Binance and - merge those coins on keys: + """Helper method which loads coins from all sources: CoinGecko, CoinPaprika, Binance + and merge those coins on keys: + CoinGecko - > name < - CoinPaprika CoinGecko - > id <- Binance @@ -210,9 +211,10 @@ def find(source: str, coin: str, key: str, top: int, export: str) -> None: you can use this command to display coins with similar name, symbol or id to your search query. Example of usage: coin name is something like "polka". So I can try: find -c polka -k name -t 25 It will search for coin that has similar name to polka and display top 25 matches. - -c, --coin stands for coin - you provide here your search query - -k, --key it's a searching key. You can search by symbol, id or name of coin - -t, --top it displays top N number of records. + + -c, --coin stands for coin - you provide here your search query + -k, --key it's a searching key. You can search by symbol, id or name of coin + -t, --top it displays top N number of records. Parameters ---------- @@ -323,8 +325,9 @@ def display_all_coins( you can use this command to display coins with similar name, symbol or id to your search query. Example of usage: coin name is something like "polka". So I can try: find -c polka -k name -t 25 It will search for coin that has similar name to polka and display top 25 matches. - -c, --coin stands for coin - you provide here your search query - -t, --top it displays top N number of records. + + -c, --coin stands for coin - you provide here your search query + -t, --top it displays top N number of records. Parameters ---------- diff --git a/gamestonk_terminal/cryptocurrency/defi/defirate_view.py b/gamestonk_terminal/cryptocurrency/defi/defirate_view.py index 6414190a748..fbb96f53a87 100644 --- a/gamestonk_terminal/cryptocurrency/defi/defirate_view.py +++ b/gamestonk_terminal/cryptocurrency/defi/defirate_view.py @@ -90,8 +90,10 @@ def display_lending_rates(top: int, current: bool = True, export: str = "") -> N def display_borrow_rates(top: int, current: bool = True, export: str = "") -> None: - """Displays DeFi borrow rates. By using smart contracts, borrowers are able to lock collateral - to protect against defaults while seamlessly adding to or closing their loans at any time. + """Displays DeFi borrow rates. By using smart contracts, borrowers are able to lock + collateral to protect against defaults while seamlessly adding to or closing their + loans at any time. + [Source: https://defirate.com/] Parameters diff --git a/gamestonk_terminal/cryptocurrency/due_diligence/coinpaprika_model.py b/gamestonk_terminal/cryptocurrency/due_diligence/coinpaprika_model.py index cee866dc72a..5a13db72be4 100644 --- a/gamestonk_terminal/cryptocurrency/due_diligence/coinpaprika_model.py +++ b/gamestonk_terminal/cryptocurrency/due_diligence/coinpaprika_model.py @@ -65,16 +65,21 @@ def get_coin_events_by_id(coin_id: str = "eth-ethereum") -> pd.DataFrame: """Get all events related to given coin like conferences, start date of futures trading etc. [Source: CoinPaprika] Example of response from API: - { - "id": "17398-cme-april-first-trade", - "date": "2018-04-02T00:00:00Z", - "date_to": "string", - "name": "CME: April First Trade", - "description": "First trade of Bitcoin futures contract for April 2018.", - "is_conference": false, - "link": "http://www.cmegroup.com/trading/equity-index/us-index/bitcoin_product_calendar_futures.html", - "proof_image_link": "https://static.coinpaprika.com/storage/cdn/event_images/16635.jpg" - } + + .. code-block:: json + + { + "id": "17398-cme-april-first-trade", + "date": "2018-04-02T00:00:00Z", + "date_to": "string", + "name": "CME: April First Trade", + "description": "First trade of Bitcoin futures contract for April 2018.", + "is_conference": false, + "link": "http://www.cmegroup.com/trading/equity-index/us-index/bitcoin_product_calendar_futures.html", + "proof_image_link": "https://static.coinpaprika.com/storage/cdn/event_images/16635.jpg" + } + + . Parameters ---------- @@ -226,39 +231,42 @@ def get_tickers_info_for_coin( coin_id: str = "btc-bitcoin", quotes: str = "USD" ) -> pd.DataFrame: """Get all most important ticker related information for given coin id [Source: CoinPaprika] - { - "id": "btc-bitcoin", - "name": "Bitcoin", - "symbol": "BTC", - "rank": 1, - "circulating_supply": 17007062, - "total_supply": 17007062, - "max_supply": 21000000, - "beta_value": 0.735327, - "first_data_at": "2010-11-14T07:20:41Z", - "last_updated": "2018-11-14T07:20:41Z", - "quotes": { - "USD": { - "price": 5162.15941296, - "volume_24h": 7304207651.1585, - "volume_24h_change_24h": -2.5, - "market_cap": 91094433242, - "market_cap_change_24h": 1.6, - "percent_change_15m": 0, - "percent_change_30m": 0, - "percent_change_1h": 0, - "percent_change_6h": 0, - "percent_change_12h": -0.09, - "percent_change_24h": 1.59, - "percent_change_7d": 0.28, - "percent_change_30d": 27.39, - "percent_change_1y": -37.99, - "ath_price": 20089, - "ath_date": "2017-12-17T12:19:00Z", - "percent_from_price_ath": -74.3 + + .. code-block:: json + + { + "id": "btc-bitcoin", + "name": "Bitcoin", + "symbol": "BTC", + "rank": 1, + "circulating_supply": 17007062, + "total_supply": 17007062, + "max_supply": 21000000, + "beta_value": 0.735327, + "first_data_at": "2010-11-14T07:20:41Z", + "last_updated": "2018-11-14T07:20:41Z", + "quotes": { + "USD": { + "price": 5162.15941296, + "volume_24h": 7304207651.1585, + "volume_24h_change_24h": -2.5, + "market_cap": 91094433242, + "market_cap_change_24h": 1.6, + "percent_change_15m": 0, + "percent_change_30m": 0, + "percent_change_1h": 0, + "percent_change_6h": 0, + "percent_change_12h": -0.09, + "percent_change_24h": 1.59, + "percent_change_7d": 0.28, + "percent_change_30d": 27.39, + "percent_change_1y": -37.99, + "ath_price": 20089, + "ath_date": "2017-12-17T12:19:00Z", + "percent_from_price_ath": -74.3 + } } } - } Parameters ---------- diff --git a/gamestonk_terminal/portfolio/brokers/coinbase/coinbase_model.py b/gamestonk_terminal/portfolio/brokers/coinbase/coinbase_model.py index 1a0af518f17..b200e9de33d 100644 --- a/gamestonk_terminal/portfolio/brokers/coinbase/coinbase_model.py +++ b/gamestonk_terminal/portfolio/brokers/coinbase/coinbase_model.py @@ -14,14 +14,20 @@ def get_accounts(add_current_price: bool = True, currency: str = "USD") -> pd.Da """Get list of all your trading accounts. [Source: Coinbase] Single account information: - { - "id": "71452118-efc7-4cc4-8780-a5e22d4baa53", - "currency": "BTC", - "balance": "0.0000000000000000", - "available": "0.0000000000000000", - "hold": "0.0000000000000000", - "profile_id": "75da88c5-05bf-4f54-bc85-5c775bd68254" - } + + .. code-block:: json + + { + "id": "71452118-efc7-4cc4-8780-a5e22d4baa53", + "currency": "BTC", + "balance": "0.0000000000000000", + "available": "0.0000000000000000", + "hold": "0.0000000000000000", + "profile_id": "75da88c5-05bf-4f54-bc85-5c775bd68254" + } + + . + Parameters ------- add_current_price: bool @@ -73,6 +79,9 @@ def get_account_history(account: str) -> pd.DataFrame: """Get your account history. Account activity either increases or decreases your account balance. [Source: Coinbase] Example api response: + + .. code-block:: json + { "id": "100", "created_at": "2014-11-07T08:19:27.028459Z", @@ -86,6 +95,7 @@ def get_account_history(account: str) -> pd.DataFrame: } } + . Parameters ---------- @@ -125,23 +135,27 @@ def get_orders() -> pd.DataFrame: Example response from API: - { - "id": "d0c5340b-6d6c-49d9-b567-48c4bfca13d2", - "price": "0.10000000", - "size": "0.01000000", - "product_id": "BTC-USD", - "side": "buy", - "stp": "dc", - "type": "limit", - "time_in_force": "GTC", - "post_only": false, - "created_at": "2016-12-08T20:02:28.53864Z", - "fill_fees": "0.0000000000000000", - "filled_size": "0.00000000", - "executed_value": "0.0000000000000000", - "status": "open", - "settled": false - } + .. code-block:: json + + { + "id": "d0c5340b-6d6c-49d9-b567-48c4bfca13d2", + "price": "0.10000000", + "size": "0.01000000", + "product_id": "BTC-USD", + "side": "buy", + "stp": "dc", + "type": "limit", + "time_in_force": "GTC", + "post_only": false, + "created_at": "2016-12-08T20:02:28.53864Z", + "fill_fees": "0.0000000000000000", + "filled_size": "0.00000000", + "executed_value": "0.0000000000000000", + "status": "open", + "settled": false + } + + . Returns ------- diff --git a/gamestonk_terminal/reports/reports_controller.py b/gamestonk_terminal/reports/reports_controller.py index fbe4d88792b..04abfe49c1b 100644 --- a/gamestonk_terminal/reports/reports_controller.py +++ b/gamestonk_terminal/reports/reports_controller.py @@ -58,7 +58,9 @@ class ReportController: reports_opts = "" for k, report_to_run in d_id_to_report_name.items(): # Crawl data to look into what - notebook_file = os.path.join("gamestonk_terminal", "reports", report_to_run) + notebook_file = os.path.join( + os.path.dirname(os.path.abspath(__file__)), report_to_run + ) notebook_content = open(notebook_file + ".ipynb").read() metadata_cell = """"metadata": {\n "tags": [\n "parameters"\n ]\n },\n "outputs":""" notebook_metadata_content = notebook_content[ diff --git a/gamestonk_terminal/stocks/dark_pool_shorts/dps_controller.py b/gamestonk_terminal/stocks/dark_pool_shorts/dps_controller.py index 1439df3d4a5..8b87ff0911e 100644 --- a/gamestonk_terminal/stocks/dark_pool_shorts/dps_controller.py +++ b/gamestonk_terminal/stocks/dark_pool_shorts/dps_controller.py @@ -107,6 +107,7 @@ NYSE: def switch(self, an_input: str): """Process and dispatch input + Returns ------- True, False or None diff --git a/gamestonk_terminal/stocks/discovery/disc_controller.py b/gamestonk_terminal/stocks/discovery/disc_controller.py index e9d67d8565a..5ceb7244260 100644 --- a/gamestonk_terminal/stocks/discovery/disc_controller.py +++ b/gamestonk_terminal/stocks/discovery/disc_controller.py @@ -123,6 +123,7 @@ NASDAQ Data Link (Formerly Quandl): def switch(self, an_input: str): """Process and dispatch input + Returns ------- True, False or None