Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add keys examples in docstrings #3497

Merged
merged 10 commits into from
Nov 21, 2022
Prev Previous commit
Next Next commit
add more examples
  • Loading branch information
montezdesousa committed Nov 21, 2022
commit 125e30d90cfd3d82d1b9641e6f5113f4f26ea59b
14 changes: 11 additions & 3 deletions openbb_terminal/keys_model.py
Original file line number Diff line number Diff line change
@@ -123,8 +123,7 @@ def set_keys(
Parameters
----------
keys_dict: Dict[str, Dict[str, Union[str, bool]]]
E.g. {"fred": {"key":"XXXXX"}, "binance": {"key":"YYYYY", "secret":"ZZZZZ"}}
More info on APIs can be found through get_keys_info().
More info on the required inputs for each API can be found on `keys.get_keys_info()`
persist: bool
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.
@@ -135,7 +134,16 @@ def set_keys(
Returns
-------
dict
Status of each key set. E.g. {"fred": "defined, test passed", "binance": "defined, test failed"}
Status of each key set.

Examples
--------
>>> from openbb_terminal.sdk import openbb
>>> d = {
"fred": {"key": "XXXXX"},
"binance": {"key": "YYYYY", "secret": "ZZZZZ"},
}
>>> openbb.keys.set_keys(keys_dict=d)
"""

status_dict = {}