Auto Generate API Documentation (#2360)

* Started auto doc generation

* Created a markdown document

* Added test changed to md

* Created working version of new documentation

* Made requested changes

* Generate docs for all

Co-authored-by: minhhoang1023 <40023817+minhhoang1023@users.noreply.github.com>
This commit is contained in:
Colin Delahunty
2022-09-20 19:15:54 +01:00
committed by GitHub
parent cb7423d8c6
commit 8731fbd692
548 changed files with 19413 additions and 1 deletions

92
docs/generate.py Normal file
View File

@@ -0,0 +1,92 @@
from typing import Callable, Any, Optional
from inspect import signature
import importlib
import os
from openbb_terminal.api import functions
def all_functions() -> list[tuple[str, str, Callable[..., Any]]]:
"""Uses the base api functions dictionary to get a list of all functions we have linked
in our API.
Returns
----------
func_list: list[Tuple[str, str, Callable[..., Any]]]
A list of functions organized as (path_to_func, view/model, the_function)
"""
func_list = []
for key, sub_dict in functions.items():
for sub_key, item_path in sub_dict.items():
full_path = item_path.split(".")
module_path = ".".join(full_path[:-1])
module = importlib.import_module(module_path)
target_function = getattr(module, full_path[-1])
func_list.append((key, sub_key, target_function))
return func_list
def groupby(orig_list: list[Any], index: int) -> dict[Any, Any]:
"""Groups a list of iterable by the index provided
Parameters
----------
orig_list: list[Any]
A list of iterables
index: int
The index to groupby
Returns
----------
grouped: dict[Any, Any]
Group information where keys are the groupby item and values are the iterables
"""
grouped: dict[Any, Any] = {}
for item in orig_list:
if item[index] in grouped:
grouped[item[index]].append(item)
else:
grouped[item[index]] = [item]
return grouped
def generate_documentation(
base: str, key: str, value: list[tuple[str, str, Callable[..., Any]]]
):
models = list(filter(lambda x: x[1] == "model", value))
views = list(filter(lambda x: x[1] == "view", value))
model_type = Optional[tuple[str, str, Callable[..., Any]]]
model: model_type = models[0] if models else None
view: model_type = views[0] if views else None
for end in key.split("."):
base += f"/{end}"
if not os.path.isdir(base):
os.mkdir(base)
with open(f"{base}/_index.md", "w") as f:
f.write(f"# {key}\n\n")
if view:
f.write(
"To obtain charts, make sure to add `chart=True` as the last parameter\n\n"
)
if model:
f.write(f"## Get underlying data \n###{key}{signature(model[2])}\n\n")
m_docs = str(model[2].__doc__)[:-5]
f.write(f"{m_docs}\n")
if view:
if model:
f.write("\n")
v_docs = str(view[2].__doc__)[:-5]
temp = str(signature(view[2]))
# TODO: This breaks if there is a ')' inside the function arguments
idx = temp.find(")")
new_signature = temp[:idx] + ", chart=True" + temp[idx:]
f.write(f"## Getting charts \n###{key}{new_signature}\n\n")
f.write(f"{v_docs}\n")
if __name__ == "__main__":
folder_path = os.path.realpath("./website/content/api")
funcs = all_functions()
grouped_funcs = groupby(funcs, 0)
for k, v in grouped_funcs.items():
generate_documentation(folder_path, k, v)

View File

@@ -128,7 +128,7 @@ def display_repo_summary(repo: str, export: str = "") -> None:
repo : str
Repository to display summary. Format: org/repo, e.g., openbb-finance/openbbterminal
export : str
Export dataframe data to csv,json,xlsx file
Export dataframe data to csv,json,xlsx file
"""
data = github_model.get_repo_summary(repo)
if not data.empty:

View File

@@ -13,6 +13,7 @@ from openbb_terminal.cryptocurrency.dataframe_helpers import (
from openbb_terminal.decorators import log_start_end
logger = logging.getLogger(__name__)
# pylint: disable=unsupported-assignment-operation
UNI_URL = "https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2"

View File

@@ -14,6 +14,7 @@ from openbb_terminal.decorators import log_start_end
from openbb_terminal.rich_config import console
logger = logging.getLogger(__name__)
# pylint: disable=unsupported-assignment-operation
@log_start_end(log=logger)

View File

@@ -10,6 +10,7 @@ from openbb_terminal.decorators import log_start_end
from openbb_terminal.rich_config import console
logger = logging.getLogger(__name__)
# pylint: disable=unsupported-assignment-operation
api_url = "https://api.glassnode.com/v1/metrics/"

View File

@@ -25,6 +25,7 @@ from openbb_terminal.rich_config import console
logger = logging.getLogger(__name__)
INTERVALS_TIMESERIES = ["5m", "15m", "30m", "1h", "1d", "1w"]
# pylint: disable=unsupported-assignment-operation
@log_start_end(log=logger)

View File

@@ -14,6 +14,7 @@ from openbb_terminal.helper_funcs import export_data, print_rich_table
from openbb_terminal.rich_config import console
logger = logging.getLogger(__name__)
# pylint: disable=unsupported-assignment-operation
@log_start_end(log=logger)

View File

@@ -20,6 +20,7 @@ from openbb_terminal.cryptocurrency.discovery.pycoingecko_model import get_coins
from openbb_terminal.decorators import log_start_end
logger = logging.getLogger(__name__)
# pylint: disable=unsupported-assignment-operation
HOLD_COINS = ["ethereum", "bitcoin"]

View File

@@ -14,6 +14,7 @@ from openbb_terminal.decorators import log_start_end
from openbb_terminal.helper_funcs import get_user_agent
logger = logging.getLogger(__name__)
# pylint: disable=unsupported-assignment-operation
GROUPS = {
"sector": "Sector",

View File

@@ -8,6 +8,8 @@ from openbb_terminal.config_terminal import API_POLYGON_KEY as api_key
from openbb_terminal.helper_funcs import get_user_agent
from openbb_terminal.rich_config import console
# pylint: disable=unsupported-assignment-operation
def get_historical(
fx_pair: str,

View File

@@ -11,6 +11,7 @@ import requests
from openbb_terminal.decorators import log_start_end
logger = logging.getLogger(__name__)
# pylint: disable=unsupported-assignment-operation
@log_start_end(log=logger)

View File

@@ -14,6 +14,7 @@ from openbb_terminal.rich_config import console
from openbb_terminal.stocks.options.op_helpers import get_dte_from_expiration as get_dte
logger = logging.getLogger(__name__)
# pylint: disable=unsupported-assignment-operation
@log_start_end(log=logger)

View File

@@ -36,6 +36,7 @@ logger = logging.getLogger(__name__)
# pylint: disable=no-member,too-many-branches,C0302,R0913
# pylint: disable=inconsistent-return-statements
# pylint: disable=unsupported-assignment-operation
INTERVALS = [1, 5, 15, 30, 60]
SOURCES = ["YahooFinance", "AlphaVantage", "IEXCloud", "EODHD"]

View File

@@ -11,6 +11,7 @@ import pytz
from openbb_terminal.decorators import log_start_end
logger = logging.getLogger(__name__)
# pylint: disable=no-member
@log_start_end(log=logger)

View File

@@ -0,0 +1,17 @@
# alt.covid.case_slopes
## Get underlying data
###alt.covid.case_slopes(days_back: int = 30, threshold: int = 10000) -> pandas.core.frame.DataFrame
Load cases and find slope over period
Parameters
----------
days_back: int
Number of historical days to consider
threshold: int
Threshold for total number of cases
Returns
-------
pd.DataFrame
Dataframe containing slopes

View File

@@ -0,0 +1,16 @@
# alt.covid.global_cases
## Get underlying data
###alt.covid.global_cases(country: str) -> pandas.core.frame.DataFrame
Get historical cases for given country
Parameters
----------
country: str
Country to search for
Returns
-------
pd.DataFrame
Dataframe of historical cases

View File

@@ -0,0 +1,16 @@
# alt.covid.global_deaths
## Get underlying data
###alt.covid.global_deaths(country: str) -> pandas.core.frame.DataFrame
Get historical deaths for given country
Parameters
----------
country: str
Country to search for
Returns
-------
pd.DataFrame
Dataframe of historical deaths

View File

@@ -0,0 +1,33 @@
# alt.covid.ov
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###alt.covid.ov(country, limit: int = 100) -> pandas.core.frame.DataFrame
Get historical cases and deaths by country
Parameters
----------
country: str
Country to get data for
limit: int
Number of raw data to show
## Getting charts
###alt.covid.ov(country, raw: bool = False, limit: int = 10, export: str = '', plot: bool = True, chart=True) -> None
Show historical cases and deaths by country
Parameters
----------
country: str
Country to get data for
raw: bool
Flag to display raw data
limit: int
Number of raw data to show
export: str
Format to export data
plot: bool
Flag to display historical plot

View File

@@ -0,0 +1,41 @@
# alt.covid.slopes
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###alt.covid.slopes(days_back: int = 30, limit: int = 50, threshold: int = 10000, ascend: bool = False) -> pandas.core.frame.DataFrame
Load cases and find slope over period
Parameters
----------
days_back: int
Number of historical days to consider
limit: int
Number of rows to show
threshold: int
Threshold for total number of cases
ascend: bool
Flag to sort in ascending order
Returns
-------
pd.DataFrame
Dataframe containing slopes
## Getting charts
###alt.covid.slopes(days_back: int = 30, limit: int = 10, threshold: int = 10000, ascend: bool = False, export: str = '', chart=True) -> None
Parameters
----------
days_back: int
Number of historical days to get slope for
limit: int
Number to show in table
ascend: bool
Flag to sort in ascending order
threshold: int
Threshold for total cases over period
export : str
Format to export data

View File

@@ -0,0 +1,37 @@
# alt.covid.stat
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###alt.covid.stat(country, stat: str = 'cases', limit: int = 10) -> pandas.core.frame.DataFrame
Show historical cases and deaths by country
Parameters
----------
country: str
Country to get data for
stat: str
Statistic to get. Either "cases", "deaths" or "rates"
limit: int
Number of raw data to show
## Getting charts
###alt.covid.stat(country, stat: str = 'cases', raw: bool = False, limit: int = 10, export: str = '', plot: bool = True, chart=True) -> None
Show historical cases and deaths by country
Parameters
----------
country: str
Country to get data for
stat: str
Statistic to get. Either "cases", "deaths" or "rates"
raw: bool
Flag to display raw data
limit: int
Number of raw data to show
export: str
Format to export data
plot : bool
Flag to plot data

View File

@@ -0,0 +1,15 @@
# alt.oss._make_request
## Get underlying data
###alt.oss._make_request(url: str) -> Optional[bs4.BeautifulSoup]
Helper method to scrap
Parameters
----------
url : str
url to scrape
Returns
-------
BeautifulSoup object

View File

@@ -0,0 +1,21 @@
# alt.oss._retry_session
## Get underlying data
###alt.oss._retry_session(url: str, retries: int = 3, backoff_factor: float = 1.0) -> requests.sessions.Session
Helper methods that retries to make request
Parameters
----------
url: str
Url to mount a session
retries: int
How many retries
backoff_factor: float
Backoff schema - time periods between retry
Returns
-------
requests.Session
Mounted session

View File

@@ -0,0 +1,16 @@
# alt.oss.github_data
## Get underlying data
###alt.oss.github_data(url: str, **kwargs)
Get repository stats
Parameters
----------
url: str
github api endpoint
params: dict
params to pass to api endpoint
Returns
-------
dict with data

View File

@@ -0,0 +1,31 @@
# alt.oss.history
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###alt.oss.history(repo: str)
Get repository star history
Parameters
----------
repo : str
Repo to search for Format: org/repo, e.g., openbb-finance/openbbterminal
Returns
-------
pd.DataFrame - Columns: Date, Stars
## Getting charts
###alt.oss.history(repo: str, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None
Display repo summary [Source: https://api.github.com]
Parameters
----------
repo : str
Repository to display star history. Format: org/repo, e.g., openbb-finance/openbbterminal
export : str
Export dataframe data to csv,json,xlsx file
external_axes : Optional[List[plt.Axes]], optional
External axes (1 axis is expected in the list), by default None

View File

@@ -0,0 +1,29 @@
# alt.oss.repo_summary
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###alt.oss.repo_summary(repo: str)
Get repository summary
Parameters
----------
repo : str
Repo to search for Format: org/repo, e.g., openbb-finance/openbbterminal
Returns
-------
pd.DataFrame - Columns: Metric, Value
## Getting charts
###alt.oss.repo_summary(repo: str, export: str = '', chart=True) -> None
Display repo summary [Source: https://api.github.com]
Parameters
----------
repo : str
Repository to display summary. Format: org/repo, e.g., openbb-finance/openbbterminal
export : str
Export dataframe data to csv,json,xlsx file

View File

@@ -0,0 +1,40 @@
# alt.oss.ross
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###alt.oss.ross() -> pandas.core.frame.DataFrame
Get startups from ROSS index [Source: https://runacap.com/]
Parameters
----------
Returns
-------
pandas.DataFrame:
list of startups
## Getting charts
###alt.oss.ross(limit: int = 10, sortby: str = 'Stars AGR [%]', descend: bool = False, show_chart: bool = False, show_growth: bool = True, chart_type: str = 'stars', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None
Display list of startups from ross index [Source: https://runacap.com/]
Parameters
----------
limit: int
Number of startups to search
sortby: str
Key by which to sort data. Default: Stars AGR [%]
descend: bool
Flag to sort data descending
show_chart: bool
Flag to show chart with startups
show_growth: bool
Flag to show growth line chart
chart_type: str
Chart type {stars,forks}
export : str
Export dataframe data to csv,json,xlsx file
external_axes : Optional[List[plt.Axes]], optional
External axes (1 axis is expected in the list), by default None

View File

@@ -0,0 +1,18 @@
# alt.oss.search
## Get underlying data
###alt.oss.search(sortby: str = 'stars', page: int = 1, categories: str = '') -> pandas.core.frame.DataFrame
Get repos sorted by stars or forks. Can be filtered by categories
Parameters
----------
sortby : str
Sort repos by {stars, forks}
categories : str
Check for repo categories. If more than one separate with a comma: e.g., finance,investment. Default: None
page : int
Page number to get repos
Returns
-------
pd.DataFrame with list of repos

View File

@@ -0,0 +1,18 @@
# alt.oss.search_repos
## Get underlying data
###alt.oss.search_repos(sortby: str = 'stars', page: int = 1, categories: str = '') -> pandas.core.frame.DataFrame
Get repos sorted by stars or forks. Can be filtered by categories
Parameters
----------
sortby : str
Sort repos by {stars, forks}
categories : str
Check for repo categories. If more than one separate with a comma: e.g., finance,investment. Default: None
page : int
Page number to get repos
Returns
-------
pd.DataFrame with list of repos

View File

@@ -0,0 +1,15 @@
# alt.oss.stars_history
## Get underlying data
###alt.oss.stars_history(repo: str)
Get repository star history
Parameters
----------
repo : str
Repo to search for Format: org/repo, e.g., openbb-finance/openbbterminal
Returns
-------
pd.DataFrame - Columns: Date, Stars

View File

@@ -0,0 +1,29 @@
# alt.oss.summary
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###alt.oss.summary(repo: str) -> pandas.core.frame.DataFrame
Get repository summary
Parameters
----------
repo : str
Repo to search for Format: org/repo, e.g., openbb-finance/openbbterminal
Returns
-------
pd.DataFrame - Columns: Metric, Value
## Getting charts
###alt.oss.summary(repo: str, export: str = '', chart=True) -> None
Display repo summary [Source: https://api.github.com]
Parameters
----------
repo : str
Repository to display summary. Format: org/repo, e.g., openbb-finance/openbbterminal
export : str
Export dataframe data to csv,json,xlsx file

View File

@@ -0,0 +1,38 @@
# alt.oss.top
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###alt.oss.top(sortby: str, limit: int = 50, categories: str = '') -> pandas.core.frame.DataFrame
Get repos sorted by stars or forks. Can be filtered by categories
Parameters
----------
sortby : str
Sort repos by {stars, forks}
categories : str
Check for repo categories. If more than one separate with a comma: e.g., finance,investment. Default: None
limit : int
Number of repos to search for
Returns
-------
pd.DataFrame with list of repos
## Getting charts
###alt.oss.top(sortby: str, categories: str = '', limit: int = 10, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None
Display repo summary [Source: https://api.github.com]
Parameters
----------
sortby : str
Sort repos by {stars, forks}
categories : str
Check for repo categories. If more than one separate with a comma: e.g., finance,investment. Default: None
limit : int
Number of repos to look at
export : str
Export dataframe data to csv,json,xlsx file
external_axes : Optional[List[plt.Axes]], optional
External axes (1 axis is expected in the list), by default None

View File

@@ -0,0 +1,38 @@
# alt.oss.top_repos
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###alt.oss.top_repos(sortby: str, top: int, categories: str) -> pandas.core.frame.DataFrame
Get repos sorted by stars or forks. Can be filtered by categories
Parameters
----------
sortby : str
Sort repos by {stars, forks}
categories : str
Check for repo categories. If more than one separate with a comma: e.g., finance,investment. Default: None
top : int
Number of repos to search for
Returns
-------
pd.DataFrame with list of repos
## Getting charts
###alt.oss.top_repos(sortby: str, categories: str, limit: int, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None
Display repo summary [Source: https://api.github.com]
Parameters
----------
sortby : str
Sort repos by {stars, forks}
categories : str
Check for repo categories. If more than one separate with a comma: e.g., finance,investment. Default: None
limit : int
Number of repos to look at
export : str
Export dataframe data to csv,json,xlsx file
external_axes : Optional[List[plt.Axes]], optional
External axes (1 axis is expected in the list), by default None

View File

@@ -0,0 +1,38 @@
# common.behavioural_analysis.sentiment
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.behavioural_analysis.sentiment(post_data: List[str]) -> float
Find the sentiment of a post and related comments
Parameters
----------
post_data: List[str]
A post and its comments in string form
Returns
-------
float
A number in the range [-1, 1] representing sentiment
## Getting charts
###common.behavioural_analysis.sentiment(symbol: str, n_tweets: int = 15, n_days_past: int = 2, compare: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True)
Plot 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
export: str
Format to export tweet dataframe
external_axes: Optional[List[plt.Axes]], optional
External axes (1 axis is expected in the list), by default None

View File

@@ -0,0 +1,32 @@
# common.behavioural_analysis.sentiment_stats
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.behavioural_analysis.sentiment_stats(ticker: str) -> Dict
Get sentiment stats [Source: finnhub]
Parameters
----------
ticker : str
Ticker to get sentiment stats
Returns
-------
Dict
Get sentiment stats
## Getting charts
###common.behavioural_analysis.sentiment_stats(ticker: str, export: str = '', chart=True)
Sentiment stats which displays buzz, news score, articles last week, articles weekly average,
bullish vs bearish percentages, sector average bullish percentage, and sector average news score
Parameters
----------
ticker : str
Ticker to get sentiment stats
export : str
Format to export data

View File

@@ -0,0 +1,36 @@
# common.news
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.news(term: str = '', sources: str = 'bloomberg.com') -> pandas.core.frame.DataFrame
Get news for a given term and source. [Source: Feedparser]
Parameters
----------
term : str
term to search on the news articles
sources: str
sources to exclusively show news from
Returns
----------
articles : dict
term to search on the news articles
## Getting charts
###common.news(term: str, sources: str = '', limit: int = 5, export: str = '', chart=True)
Display news for a given term and source. [Source: Feedparser]
Parameters
----------
term : str
term to search on the news articles
sources : str
sources to exclusively show news from
limit : int
number of articles to display
export : str
Export dataframe data to csv,json,xlsx file

View File

@@ -0,0 +1,39 @@
# common.qa.bw
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.qa.bw(data: pandas.core.frame.DataFrame, target: str, symbol: str = '', yearly: bool = True, external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None) -> None
Show box and whisker plots
Parameters
----------
symbol : str
Name of dataset
data : pd.DataFrame
Dataframe to look at
target : str
Data column to look at
yearly : bool
Flag to indicate yearly accumulation
external_axes : Optional[List[plt.Axes]], optional
External axes (1 axis is expected in the list), by default None
## Getting charts
###common.qa.bw(data: pandas.core.frame.DataFrame, target: str, symbol: str = '', yearly: bool = True, external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None
Show box and whisker plots
Parameters
----------
symbol : str
Name of dataset
data : pd.DataFrame
Dataframe to look at
target : str
Data column to look at
yearly : bool
Flag to indicate yearly accumulation
external_axes : Optional[List[plt.Axes]], optional
External axes (1 axis is expected in the list), by default None

View File

@@ -0,0 +1,24 @@
# common.qa.calculate_adjusted_var
## Get underlying data
###common.qa.calculate_adjusted_var(kurtosis: float, skew: float, ndp: float, std: float, mean: float) -> float
Calculates VaR, which is adjusted for skew and kurtosis (Cornish-Fischer-Expansion)
Parameters
----------
kurtosis: float
kurtosis of data
skew: float
skew of data
ndp: float
normal distribution percentage number (99% -> -2.326)
std: float
standard deviation of data
mean: float
mean of data
Returns
-------
float
Real adjusted VaR

View File

@@ -0,0 +1,22 @@
# common.qa.decompose
## Get underlying data
###common.qa.decompose(data: pandas.core.frame.DataFrame, multiplicative: bool = False) -> Tuple[Any, pandas.core.frame.DataFrame, pandas.core.frame.DataFrame]
Perform seasonal decomposition
Parameters
----------
data : pd.DataFrame
Dataframe of targeted data
multiplicative : bool
Boolean to indicate multiplication instead of addition
Returns
-------
result: Any
Result of statsmodels seasonal_decompose
cycle: pd.DataFrame
Filtered cycle
trend: pd.DataFrame
Filtered Trend

View File

@@ -0,0 +1,48 @@
# common.qa.es
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.qa.es(data: pandas.core.frame.DataFrame, use_mean: bool = False, distribution: str = 'normal', percentile: Union[float, int] = 0.999, portfolio: bool = False) -> pandas.core.frame.DataFrame
Gets Expected Shortfall for specified stock dataframe
Parameters
----------
data: pd.DataFrame
Data dataframe
use_mean: bool
If one should use the data mean for calculation
distribution: str
Type of distribution, options: laplace, student_t, normal
percentile: Union[float,int]
VaR percentile
portfolio: bool
If the data is a portfolio
Returns
-------
list
list of ES
list
list of historical ES
## Getting charts
###common.qa.es(data: pandas.core.frame.DataFrame, symbol: str = '', use_mean: bool = False, distribution: str = 'normal', percentile: float = 0.999, portfolio: bool = False, chart=True) -> None
Displays expected shortfall
Parameters
----------
data: pd.DataFrame
Data dataframe
use_mean:
if one should use the data mean return
symbol: str
name of the data
distribution: str
choose distribution to use: logistic, laplace, normal
percentile: int
es percentile
portfolio: bool
If the data is a portfolio

View File

@@ -0,0 +1,40 @@
# common.qa.kurtosis
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.qa.kurtosis(data: pandas.core.frame.DataFrame, window: int = 14) -> pandas.core.frame.DataFrame
Kurtosis Indicator
Parameters
----------
data: pd.DataFrame
Dataframe of targeted data
window: int
Length of window
Returns
-------
df_kurt : pd.DataFrame
Dataframe of rolling kurtosis
## Getting charts
###common.qa.kurtosis(symbol: str, data: pandas.core.frame.DataFrame, target: str, window: int = 14, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True)
View rolling kurtosis
Parameters
----------
symbol: str
Ticker
data: pd.DataFrame
Dataframe of stock prices
target: str
Column in data to look at
window: int
Length of window
export: str
Format to export data
external_axes: Optional[List[plt.Axes]], optional
External axes (2 axes are expected in the list), by default None

View File

@@ -0,0 +1,35 @@
# common.qa.normality
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.qa.normality(data: pandas.core.frame.DataFrame) -> pandas.core.frame.DataFrame
Look at the distribution of returns and generate statistics on the relation to the normal curve.
This function calculates skew and kurtosis (the third and fourth moments) and performs both
a Jarque-Bera and Shapiro Wilk test to determine if data is normally distributed.
Parameters
----------
data : pd.DataFrame
Dataframe of targeted data
Returns
-------
pd.DataFrame
Dataframe containing statistics of normality
## Getting charts
###common.qa.normality(data: pandas.core.frame.DataFrame, target: str, export: str = '', chart=True) -> None
View normality statistics
Parameters
----------
data : pd.DataFrame
DataFrame
target : str
Column in data to look at
export : str
Format to export data

View File

@@ -0,0 +1,29 @@
# common.qa.omega
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.qa.omega(data: pandas.core.frame.DataFrame, threshold_start: float = 0, threshold_end: float = 1.5) -> pandas.core.frame.DataFrame
Get the omega series
Parameters
----------
data: pd.DataFrame
stock dataframe
threshold_start: float
annualized target return threshold start of plotted threshold range
threshold_end: float
annualized target return threshold end of plotted threshold range
## Getting charts
###common.qa.omega(data: pandas.core.frame.DataFrame, threshold_start: float = 0, threshold_end: float = 1.5, chart=True) -> None
Displays the omega ratio
Parameters
----------
data: pd.DataFrame
stock dataframe
threshold_start: float
annualized target return threshold start of plotted threshold range
threshold_end: float
annualized target return threshold end of plotted threshold range

View File

@@ -0,0 +1,46 @@
# common.qa.quantile
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.qa.quantile(data: pandas.core.frame.DataFrame, window: int = 14, quantile_pct: float = 0.5) -> Tuple[pandas.core.frame.DataFrame, pandas.core.frame.DataFrame]
Overlay Median & Quantile
Parameters
----------
data: pd.DataFrame
Dataframe of targeted data
window : int
Length of window
quantile_pct: float
Quantile to display
Returns
-------
df_med : pd.DataFrame
Dataframe of median prices over window
df_quantile : pd.DataFrame
Dataframe of gievn quantile prices over window
## Getting charts
###common.qa.quantile(data: pandas.core.frame.DataFrame, target: str, symbol: str = '', window: int = 14, quantile: float = 0.5, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None
View rolling quantile
Parameters
----------
data: pd.DataFrame
Dataframe
target: str
Column in data to look at
symbol : str
Stock ticker
window : int
Length of window
quantile: float
Quantile to get
export: str
Format to export data
external_axes: Optional[List[plt.Axes]], optional
External axes (1 axis is expected in the list), by default None

View File

@@ -0,0 +1,42 @@
# common.qa.rolling
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.qa.rolling(data: pandas.core.frame.DataFrame, window: int = 14) -> Tuple[pandas.core.frame.DataFrame, pandas.core.frame.DataFrame]
Return rolling mean and standard deviation
Parameters
----------
data: pd.DataFrame
Dataframe of target data
window: int
Length of rolling window
Returns
-------
pd.DataFrame:
Dataframe of rolling mean
pd.DataFrame:
Dataframe of rolling standard deviation
## Getting charts
###common.qa.rolling(data: pandas.core.frame.DataFrame, target: str, symbol: str = '', window: int = 14, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None
View mean std deviation
Parameters
----------
data: pd.DataFrame
Dataframe
target: str
Column in data to look at
symbol : str
Stock ticker
window : int
Length of window
export: str
Format to export data
external_axes: Optional[List[plt.Axes]], optional
External axes (2 axes are expected in the list), by default None

View File

@@ -0,0 +1,34 @@
# common.qa.sharpe
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.qa.sharpe(data: pandas.core.frame.DataFrame, rfr: float = 0, window: float = 252) -> pandas.core.frame.DataFrame
Calculates the sharpe ratio
Parameters
----------
data: pd.DataFrame
selected dataframe column
rfr: float
risk free rate
window: float
length of the rolling window
Returns
-------
sharpe: pd.DataFrame
sharpe ratio
## Getting charts
###common.qa.sharpe(data: pandas.core.frame.DataFrame, rfr: float = 0, window: float = 252, chart=True) -> None
Calculates the sharpe ratio
Parameters
----------
data: pd.DataFrame
selected dataframe column
rfr: float
risk free rate
window: float
length of the rolling window

View File

@@ -0,0 +1,40 @@
# common.qa.skew
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.qa.skew(data: pandas.core.frame.DataFrame, window: int = 14) -> pandas.core.frame.DataFrame
Skewness Indicator
Parameters
----------
data: pd.DataFrame
Dataframe of targeted data
window : int
Length of window
Returns
-------
data_skew : pd.DataFrame
Dataframe of rolling skew
## Getting charts
###common.qa.skew(symbol: str, data: pandas.core.frame.DataFrame, target: str, window: int = 14, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None
View rolling skew
Parameters
----------
symbol: str
Stock ticker
data: pd.DataFrame
Dataframe
target: str
Column in data to look at
window: int
Length of window
export: str
Format to export data
external_axes: Optional[List[plt.Axes]], optional
External axes (2 axes are expected in the list), by default None

View File

@@ -0,0 +1,38 @@
# common.qa.sortino
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.qa.sortino(data: pandas.core.frame.DataFrame, target_return: float = 0, window: float = 252, adjusted: bool = False) -> pandas.core.frame.DataFrame
Calculates the sortino ratio
Parameters
----------
data: pd.DataFrame
selected dataframe
target_return: float
target return of the asset
window: float
length of the rolling window
adjusted: bool
adjust the sortino ratio
Returns
-------
sortino: pd.DataFrame
sortino ratio
## Getting charts
###common.qa.sortino(data: pandas.core.frame.DataFrame, target_return: float, window: float, adjusted: bool, chart=True) -> None
Displays the sortino ratio
Parameters
----------
data: pd.DataFrame
selected dataframe
target_return: float
target return of the asset
window: float
length of the rolling window
adjusted: bool
adjust the sortino ratio

View File

@@ -0,0 +1,44 @@
# common.qa.spread
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.qa.spread(data: pandas.core.frame.DataFrame, window: int = 14) -> Tuple[pandas.core.frame.DataFrame, pandas.core.frame.DataFrame]
Standard Deviation and Variance
Parameters
----------
data: pd.DataFrame
DataFrame of targeted data
window: int
Length of window
Returns
-------
df_sd: pd.DataFrame
Dataframe of rolling standard deviation
df_var: pd.DataFrame
Dataframe of rolling standard deviation
## Getting charts
###common.qa.spread(data: pandas.core.frame.DataFrame, target: str, symbol: str = '', window: int = 14, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True)
View rolling spread
Parameters
----------
data: pd.DataFrame
Dataframe
target: str
Column in data to look at
target: str
Column in data to look at
symbol : str
Stock ticker
window : int
Length of window
export: str
Format to export data
external_axes: Optional[List[plt.Axes]], optional
External axes (3 axes are expected in the list), by default None

View File

@@ -0,0 +1,30 @@
# common.qa.summary
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.qa.summary(data: pandas.core.frame.DataFrame) -> pandas.core.frame.DataFrame
Print summary statistics
Parameters
----------
data : pd.DataFrame
Dataframe to get summary statistics for
Returns
-------
summary : pd.DataFrame
Summary statistics
## Getting charts
###common.qa.summary(data: pandas.core.frame.DataFrame, export: str = '', chart=True) -> None
Show summary statistics
Parameters
----------
data : pd.DataFrame
DataFrame to get statistics of
export : str
Format to export data

View File

@@ -0,0 +1,40 @@
# common.qa.unitroot
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.qa.unitroot(data: pandas.core.frame.DataFrame, fuller_reg: str = 'c', kpss_reg: str = 'c') -> pandas.core.frame.DataFrame
Calculate test statistics for unit roots
Parameters
----------
data : pd.DataFrame
DataFrame of target variable
fuller_reg : str
Type of regression of ADF test. Can be ‘c’,’ct’,’ctt’,’nc’ 'c' - Constant and t - trend order
kpss_reg : str
Type of regression for KPSS test. Can be ‘c’,’ct'
Returns
-------
pd.DataFrame
Dataframe with results of ADF test and KPSS test
## Getting charts
###common.qa.unitroot(data: pandas.core.frame.DataFrame, target: str, fuller_reg: str = 'c', kpss_reg: str = 'c', export: str = '', chart=True)
Show unit root test calculations
Parameters
----------
data : pd.DataFrame
DataFrame
target : str
Column of data to look at
fuller_reg : str
Type of regression of ADF test. Can be ‘c’,’ct’,’ctt’,’nc’ 'c' - Constant and t - trend order
kpss_reg : str
Type of regression for KPSS test. Can be ‘c’,’ct'
export : str
Format for exporting data

View File

@@ -0,0 +1,54 @@
# common.qa.var
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.qa.var(data: pandas.core.frame.DataFrame, use_mean: bool = False, adjusted_var: bool = False, student_t: bool = False, percentile: Union[int, float] = 0.999, portfolio: bool = False) -> pandas.core.frame.DataFrame
Gets value at risk for specified stock dataframe
Parameters
----------
data: pd.DataFrame
Data dataframe
use_mean: bool
If one should use the data mean for calculation
adjusted_var: bool
If one should return VaR adjusted for skew and kurtosis
student_t: bool
If one should use the student-t distribution
percentile: Union[int,float]
VaR percentile
portfolio: bool
If the data is a portfolio
Returns
-------
list
list of VaR
list
list of historical VaR
## Getting charts
###common.qa.var(data: pandas.core.frame.DataFrame, symbol: str = '', use_mean: bool = False, adjusted_var: bool = False, student_t: bool = False, percentile: float = 0.999, data_range: int = 0, portfolio: bool = False, chart=True) -> None
Displays VaR of dataframe
Parameters
----------
data: pd.Dataframe
Data dataframe
use_mean: bool
if one should use the data mean return
symbol: str
name of the data
adjusted_var: bool
if one should have VaR adjusted for skew and kurtosis (Cornish-Fisher-Expansion)
student_t: bool
If one should use the student-t distribution
percentile: int
var percentile
data_range: int
Number of rows you want to use VaR over
portfolio: bool
If the data is a portfolio

View File

@@ -0,0 +1,38 @@
# common.ta.ad
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.ta.ad(data: pandas.core.frame.DataFrame, use_open: bool = False) -> pandas.core.frame.DataFrame
Calculate AD technical indicator
Parameters
----------
data : pd.DataFrame
Dataframe of prices with OHLC and Volume
use_open : bool
Whether to use open prices
Returns
-------
pd.DataFrame
Dataframe with technical indicator
## Getting charts
###common.ta.ad(data: pandas.core.frame.DataFrame, use_open: bool = False, symbol: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True)
Plot AD technical indicator
Parameters
----------
data : pd.DataFrame
Dataframe of ohlc prices
use_open : bool
Whether to use open prices in calculation
symbol : str
Ticker symbol
export: str
Format to export data as
external_axes : Optional[List[plt.Axes]], optional
External axes (3 axes are expected in the list), by default None

View File

@@ -0,0 +1,46 @@
# common.ta.adosc
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.ta.adosc(data: pandas.core.frame.DataFrame, use_open: bool = False, fast: int = 3, slow: int = 10) -> pandas.core.frame.DataFrame
Calculate AD oscillator technical indicator
Parameters
----------
data : pd.DataFrame
Dataframe of OHLC prices
use_open : bool
Whether to use open prices
fast: int
Fast value
slow: int
Slow value
Returns
-------
pd.DataFrame
Dataframe with technical indicator
## Getting charts
###common.ta.adosc(data: pandas.core.frame.DataFrame, fast: int = 3, slow: int = 10, use_open: bool = False, symbol: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True)
Display AD Osc Indicator
Parameters
----------
data : pd.DataFrame
Dataframe of ohlc prices
use_open : bool
Whether to use open prices in calculation
fast: int
Length of fast window
slow : int
Length of slow window
symbol : str
Stock ticker
export : str
Format to export data
external_axes : Optional[List[plt.Axes]], optional
External axes (3 axes are expected in the list), by default None

View File

@@ -0,0 +1,50 @@
# common.ta.adx
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.ta.adx(high_values: pandas.core.series.Series, low_values: pandas.core.series.Series, close_values: pandas.core.series.Series, window: int = 14, scalar: int = 100, drift: int = 1)
ADX technical indicator
Parameters
----------
high_values: pd.Series
High prices
low_values: pd.Series
Low prices
close_values: pd.Series
close prices
window: int
Length of window
scalar: int
Scalar variable
drift: int
Drift variable
Returns
-------
pd.DataFrame
DataFrame with adx indicator
## Getting charts
###common.ta.adx(data: pandas.core.frame.DataFrame, window: int = 14, scalar: int = 100, drift: int = 1, symbol: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True)
Plot ADX indicator
Parameters
----------
data : pd.DataFrame
Dataframe with OHLC price data
window : int
Length of window
scalar : int
Scalar variable
drift : int
Drift variable
symbol : str
Ticker
export : str
Format to export data
external_axes : Optional[List[plt.Axes]], optional
External axes (2 axes are expected in the list), by default None

View File

@@ -0,0 +1,44 @@
# common.ta.aroon
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.ta.aroon(high_values: pandas.core.series.Series, low_values: pandas.core.series.Series, window: int = 25, scalar: int = 100) -> pandas.core.frame.DataFrame
Aroon technical indicator
Parameters
----------
high_values: pd.Series
High prices
low_values: pd.Series
Low prices
window : int
Length of window
scalar : int
Scalar variable
Returns
-------
pd.DataFrame
DataFrame with aroon indicator
## Getting charts
###common.ta.aroon(data: pandas.core.frame.DataFrame, window: int = 25, scalar: int = 100, symbol: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True)
Plot Aroon indicator
Parameters
----------
data: pd.DataFrame
Dataframe with OHLC price data
window: int
Length of window
symbol: str
Ticker
scalar: int
Scalar variable
export: str
Format to export data
external_axes: Optional[List[plt.Axes]], optional
External axes (3 axes are expected in the list), by default None

View File

@@ -0,0 +1,46 @@
# common.ta.bbands
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.ta.bbands(close_values: pandas.core.series.Series, window: int = 15, n_std: float = 2, mamode: str = 'ema') -> pandas.core.frame.DataFrame
Calculate Bollinger Bands
Parameters
----------
close_values : pd.DataFrame
DataFrame of sclose prices
window : int
Length of window to calculate BB
n_std : float
Number of standard deviations to show
mamode : str
Method of calculating average
Returns
-------
df_ta: pd.DataFrame
Dataframe of bollinger band data
## Getting charts
###common.ta.bbands(data: pandas.core.frame.DataFrame, symbol: str = '', window: int = 15, n_std: float = 2, mamode: str = 'sma', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True)
Show bollinger bands
Parameters
----------
data : pd.DataFrame
Dataframe of ohlc prices
symbol : str
Ticker symbol
window : int
Length of window to calculate BB
n_std : float
Number of standard deviations to show
mamode : str
Method of calculating average
export : str
Format of export file
external_axes : Optional[List[plt.Axes]], optional
External axes (1 axis is expected in the list), by default None

View File

@@ -0,0 +1,47 @@
# common.ta.cci
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.ta.cci(data: pandas.core.frame.DataFrame, window: int = 14, scalar: float = 0.0015) -> pandas.core.frame.DataFrame
Commodity channel index
Parameters
----------
high_vals: pd.Series
High values
low_values: pd.Series
Low values
close-values: pd.Series
Close values
window: int
Length of window
scalar: float
Scalar variable
Returns
----------
pd.DataFrame
Dataframe of technical indicator
## Getting charts
###common.ta.cci(data: pandas.core.frame.DataFrame, window: int = 14, scalar: float = 0.0015, symbol: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True)
Display CCI Indicator
Parameters
----------
data : pd.DataFrame
Dataframe of OHLC
window : int
Length of window
scalar : float
Scalar variable
symbol : str
Stock ticker
export : str
Format to export data
external_axes : Optional[List[plt.Axes]], optional
External axes (2 axes are expected in the list), by default None

View File

@@ -0,0 +1,37 @@
# common.ta.cg
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.ta.cg(values: pandas.core.series.Series, window: int) -> pandas.core.frame.DataFrame
Center of gravity
Parameters
----------
values: pd.DataFrame
Data to use with close being titled values
window: int
Length for indicator window
Returns
----------
d.DataFrame
Dataframe of technical indicator
## Getting charts
###common.ta.cg(data: pandas.core.series.Series, window: int = 14, symbol: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True)
Display center of gravity Indicator
Parameters
----------
data : pd.Series
Series of values
window : int
Length of window
symbol : str
Stock ticker
export : str
Format to export data
external_axes : Optional[List[plt.Axes]], optional
External axes (2 axes are expected in the list), by default None

View File

@@ -0,0 +1,44 @@
# common.ta.donchian
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.ta.donchian(high_prices: pandas.core.series.Series, low_prices: pandas.core.series.Series, upper_length: int = 20, lower_length: int = 20) -> pandas.core.frame.DataFrame
Calculate Donchian Channels
Parameters
----------
high_prices : pd.DataFrame
High prices
low_prices : pd.DataFrame
Low prices
upper_length : int
Length of window to calculate upper channel
lower_length : int
Length of window to calculate lower channel
Returns
-------
pd.DataFrame
Dataframe of upper and lower channels
## Getting charts
###common.ta.donchian(data: pandas.core.frame.DataFrame, symbol: str = '', upper_length: int = 20, lower_length: int = 20, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True)
Show donchian channels
Parameters
----------
data : pd.DataFrame
Dataframe of ohlc prices
symbol : str
Ticker symbol
upper_length : int
Length of window to calculate upper channel
lower_length : int
Length of window to calculate lower channel
export : str
Format of export file
external_axes : Optional[List[plt.Axes]], optional
External axes (1 axis is expected in the list), by default None

View File

@@ -0,0 +1,20 @@
# common.ta.ema
## Get underlying data
###common.ta.ema(data: pandas.core.frame.DataFrame, length: int = 50, offset: int = 0) -> pandas.core.frame.DataFrame
Gets exponential moving average (EMA) for stock
Parameters
----------
data: pd.DataFrame
Dataframe of dates and prices
length: int
Length of EMA window
offset: int
Length of offset
Returns
----------
pd.DataFrame
Dataframe containing prices and EMA

View File

@@ -0,0 +1,54 @@
# common.ta.fib
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.ta.fib(data: pandas.core.frame.DataFrame, limit: int = 120, start_date: Any = None, end_date: Any = None) -> Tuple[pandas.core.frame.DataFrame, pandas._libs.tslibs.timestamps.Timestamp, pandas._libs.tslibs.timestamps.Timestamp, float, float]
Calculate Fibonacci levels
Parameters
----------
data : pd.DataFrame
Dataframe of prices
limit : int
Days to look back for retracement
start_date : Any
Custom start date for retracement
end_date : Any
Custom end date for retracement
Returns
-------
df : pd.DataFrame
Dataframe of fib levels
min_date: pd.Timestamp
Date of min point
max_date: pd.Timestamp:
Date of max point
min_pr: float
Price at min point
max_pr: float
Price at max point
## Getting charts
###common.ta.fib(data: pandas.core.frame.DataFrame, limit: int = 120, start_date: Optional[str] = None, end_date: Optional[str] = None, symbol: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True)
Calculate fibonacci retracement levels
Parameters
----------
data: pd.DataFrame
OHLC data
limit: int
Days to lookback
start_date: Optional[str, None]
User picked date for starting retracement
end_date: Optional[str, None]
User picked date for ending retracement
symbol: str
Ticker symbol
export: str
Format to export data
external_axes : Optional[List[plt.Axes]], optional
External axes (2 axes are expected in the list), by default None

View File

@@ -0,0 +1,39 @@
# common.ta.fisher
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.ta.fisher(high_vals: pandas.core.series.Series, low_vals: pandas.core.series.Series, window: int = 14) -> pandas.core.frame.DataFrame
Fisher Transform
Parameters
----------
high_vals: pd.Series
High values
low_vals: pd.Series
Low values
window: int
Length for indicator window
Returns
----------
df_ta: pd.DataFrame
Dataframe of technical indicator
## Getting charts
###common.ta.fisher(data: pandas.core.frame.DataFrame, window: int = 14, symbol: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True)
Display Fisher Indicator
Parameters
----------
data : pd.DataFrame
Dataframe of OHLC prices
window : int
Length of window
symbol : str
Ticker string
export : str
Format to export data
external_axes : Optional[List[plt.Axes]], optional
External axes (3 axes are expected in the list), by default None

View File

@@ -0,0 +1,20 @@
# common.ta.hma
## Get underlying data
###common.ta.hma(data: pandas.core.frame.DataFrame, length: int = 50, offset: int = 0) -> pandas.core.frame.DataFrame
Gets hull moving average (HMA) for stock
Parameters
----------
data: pd.DataFrame
Dataframe of dates and prices
length: int
Length of SMA window
offset: int
Length of offset
Returns
----------
df_ta: pd.DataFrame
Dataframe containing prices and HMA

View File

@@ -0,0 +1,55 @@
# common.ta.kc
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.ta.kc(high_prices: pandas.core.series.Series, low_prices: pandas.core.series.Series, close_prices: pandas.core.series.Series, window: int = 20, scalar: float = 2, mamode: str = 'ema', offset: int = 0) -> pandas.core.frame.DataFrame
Keltner Channels
Parameters
----------
high_prices : pd.DataFrame
High prices
low_prices : pd.DataFrame
Low prices
close_prices : pd.DataFrame
Close prices
window : int
Length of window
scalar: float
Scalar value
mamode: str
Type of filter
offset : int
Offset value
Returns
-------
df_en : pd.DataFrame
Dataframe of rolling kc
## Getting charts
###common.ta.kc(data: pandas.core.frame.DataFrame, window: int = 20, scalar: float = 2, mamode: str = 'ema', offset: int = 0, symbol: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True)
View Keltner Channels Indicator
Parameters
----------
data: pd.DataFrame
Dataframe of ohlc prices
window: int
Length of window
scalar: float
Scalar value
mamode: str
Type of filter
offset: int
Offset value
symbol: str
Ticker symbol
export: str
Format to export data
external_axes: Optional[List[plt.Axes]], optional
External axes (2 axes are expected in the list), by default None

View File

@@ -0,0 +1,47 @@
# common.ta.ma
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.ta.ma(data: pandas.core.series.Series, window: List[int] = None, offset: int = 0, ma_type: str = 'EMA', symbol: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None) -> None
Plots MA technical indicator
Parameters
----------
data: pd.Series
Series of prices
window: List[int]
Length of EMA window
offset: int
Offset variable
ma_type: str
Type of moving average. Either "EMA" "ZLMA" or "SMA"
symbol: str
Ticker
export: str
Format to export data
external_axes: Optional[List[plt.Axes]], optional
External axes (1 axis is expected in the list), by default None
## Getting charts
###common.ta.ma(data: pandas.core.series.Series, window: List[int] = None, offset: int = 0, ma_type: str = 'EMA', symbol: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None
Plots MA technical indicator
Parameters
----------
data: pd.Series
Series of prices
window: List[int]
Length of EMA window
offset: int
Offset variable
ma_type: str
Type of moving average. Either "EMA" "ZLMA" or "SMA"
symbol: str
Ticker
export: str
Format to export data
external_axes: Optional[List[plt.Axes]], optional
External axes (1 axis is expected in the list), by default None

View File

@@ -0,0 +1,45 @@
# common.ta.macd
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.ta.macd(values: pandas.core.frame.DataFrame, n_fast: int = 12, n_slow: int = 26, n_signal: int = 9) -> pandas.core.frame.DataFrame
Moving average convergence divergence
Parameters
----------
values: pd.Series
Values for calculation
n_fast : int
Fast period
n_slow : int
Slow period
n_signal : int
Signal period
Returns
----------
pd.DataFrame
Dataframe of technical indicator
## Getting charts
###common.ta.macd(data: pandas.core.series.Series, n_fast: int = 12, n_slow: int = 26, n_signal: int = 9, symbol: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True)
Plot MACD signal
Parameters
----------
data : pd.Series
Values to input
n_fast : int
Fast period
n_slow : int
Slow period
n_signal : int
Signal period
symbol : str
Stock ticker
export : str
Format to export data
external_axes : Optional[List[plt.Axes]], optional
External axes (2 axes are expected in the list), by default None

View File

@@ -0,0 +1,34 @@
# common.ta.obv
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.ta.obv(data: pandas.core.frame.DataFrame) -> pandas.core.frame.DataFrame
On Balance Volume
Parameters
----------
data: pd.DataFrame
Dataframe of OHLC prices
Returns
-------
pd.DataFrame
Dataframe with technical indicator
## Getting charts
###common.ta.obv(data: pandas.core.frame.DataFrame, symbol: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True)
Plot OBV technical indicator
Parameters
----------
data : pd.DataFrame
Dataframe of ohlc prices
symbol : str
Ticker
export: str
Format to export data as
external_axes : Optional[List[plt.Axes]], optional
External axes (1 axis is expected in the list), by default None

View File

@@ -0,0 +1,46 @@
# common.ta.rsi
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.ta.rsi(values: pandas.core.series.Series, window: int = 14, scalar: float = 100, drift: int = 1) -> pandas.core.frame.DataFrame
Relative strength index
Parameters
----------
values: pd.Series
Dataframe of prices
window: int
Length of window
scalar: float
Scalar variable
drift: int
Drift variable
Returns
----------
pd.DataFrame
Dataframe of technical indicator
## Getting charts
###common.ta.rsi(data: pandas.core.series.Series, window: int = 14, scalar: float = 100.0, drift: int = 1, symbol: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True)
Display RSI Indicator
Parameters
----------
data : pd.Series
Values to input
window : int
Length of window
scalar : float
Scalar variable
drift : int
Drift variable
symbol : str
Stock ticker
export : str
Format to export data
external_axes : Optional[List[plt.Axes]], optional
External axes (2 axes are expected in the list), by default None

View File

@@ -0,0 +1,20 @@
# common.ta.sma
## Get underlying data
###common.ta.sma(data: pandas.core.frame.DataFrame, length: int = 50, offset: int = 0) -> pandas.core.frame.DataFrame
Gets simple moving average (EMA) for stock
Parameters
----------
data: pd.DataFrame
Dataframe of dates and prices
length: int
Length of SMA window
offset: int
Length of offset
Returns
----------
pd.DataFrame
Dataframe containing prices and SMA

View File

@@ -0,0 +1,49 @@
# common.ta.stoch
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.ta.stoch(high_vals: pandas.core.series.Series, low_vals: pandas.core.series.Series, close_vals: pandas.core.series.Series, fastkperiod: int = 14, slowdperiod: int = 3, slowkperiod: int = 3)
Stochastic oscillator
Parameters
----------
high_vals: pd.Series
High values
low_vals: pd.Series
Low values
close-vals: pd.Series
Close values
fastkperiod : int
Fast k period
slowdperiod : int
Slow d period
slowkperiod : int
Slow k period
Returns
----------
pd.DataFrame
Dataframe of technical indicator
## Getting charts
###common.ta.stoch(data: pandas.core.frame.DataFrame, fastkperiod: int = 14, slowdperiod: int = 3, slowkperiod: int = 3, symbol: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None
Plot stochastic oscillator signal
Parameters
----------
data : pd.DataFrame
Dataframe of OHLC prices
fastkperiod : int
Fast k period
slowdperiod : int
Slow d period
slowkperiod : int
Slow k period
symbol : str
Stock ticker symbol
export : str
Format to export data
external_axes : Optional[List[plt.Axes]], optional
External axes (3 axes are expected in the list), by default None

View File

@@ -0,0 +1,43 @@
# common.ta.vwap
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###common.ta.vwap(data: pandas.core.frame.DataFrame, offset: int = 0) -> pandas.core.frame.DataFrame
Gets volume weighted average price (VWAP)
Parameters
----------
data: pd.DataFrame
Dataframe of dates and prices
offset: int
Length of offset
Returns
----------
df_vwap: pd.DataFrame
Dataframe with VWAP data
## Getting charts
###common.ta.vwap(data: pandas.core.frame.DataFrame, symbol: str = '', start_date: str = None, end_date: str = None, offset: int = 0, interval: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True)
Plots VWMA technical indicator
Parameters
----------
data : pd.DataFrame
Dataframe of OHLC prices
symbol : str
Ticker
offset : int
Offset variable
start_date: datetime
Start date to get data from with
end_date: datetime
End date to get data from with
interval : str
Interval of data
export : str
Format to export data
external_axes : Optional[List[plt.Axes]], optional
External axes (3 axes are expected in the list), by default None

View File

@@ -0,0 +1,20 @@
# common.ta.wma
## Get underlying data
###common.ta.wma(data: pandas.core.frame.DataFrame, length: int = 50, offset: int = 0) -> pandas.core.frame.DataFrame
Gets weighted moving average (WMA) for stock
Parameters
----------
data: pd.DataFrame
Dataframe of dates and prices
length: int
Length of SMA window
offset: int
Length of offset
Returns
----------
df_ta: pd.DataFrame
Dataframe containing prices and WMA

View File

@@ -0,0 +1,20 @@
# common.ta.zlma
## Get underlying data
###common.ta.zlma(data: pandas.core.frame.DataFrame, length: int = 50, offset: int = 0) -> pandas.core.frame.DataFrame
Gets zero-lagged exponential moving average (ZLEMA) for stock
Parameters
----------
data: pd.DataFrame
Dataframe of dates and prices
length: int
Length of EMA window
offset: int
Length of offset
Returns
----------
df_ta: pd.DataFrame
Dataframe containing prices and EMA

View File

@@ -0,0 +1,19 @@
# crypto.candles
## Get underlying data
###crypto.candles(candles_df: 'pd.DataFrame', volume: 'bool' = True, ylabel: 'str' = '', title: 'str' = '', external_axes: 'list[plt.Axes] | None' = None) -> 'None'
Plot candle chart from dataframe. [Source: Binance]
Parameters
----------
candles_df: pd.DataFrame
Dataframe containing time and OHLCV
volume: bool
If volume data shall be plotted, by default True
ylabel: str
Y-label of the graph, by default ""
title: str
Title of graph, by default ""
external_axes : Optional[List[plt.Axes]], optional
External axes (1 axis is expected in the list), by default None

View File

@@ -0,0 +1,31 @@
# crypto.chart
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###crypto.chart(prices_df: 'pd.DataFrame', symbol: 'str' = '', currency: 'str' = '', source: 'str' = '', exchange: 'str' = '', interval: 'str' = '', external_axes: 'list[plt.Axes] | None' = None) -> 'None'
Load data for Technical Analysis
Parameters
----------
prices_df: pd.DataFrame
Cryptocurrency
symbol: str
Coin (only used for chart title), by default ""
currency: str
Currency (only used for chart title), by default ""
## Getting charts
###crypto.chart(prices_df: 'pd.DataFrame', symbol: 'str' = '', currency: 'str' = '', source: 'str' = '', exchange: 'str' = '', interval: 'str' = '', external_axes: 'list[plt.Axes] | None' = None, chart=True) -> 'None'
Load data for Technical Analysis
Parameters
----------
prices_df: pd.DataFrame
Cryptocurrency
symbol: str
Coin (only used for chart title), by default ""
currency: str
Currency (only used for chart title), by default ""

View File

@@ -0,0 +1,46 @@
# crypto.dd.active
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###crypto.dd.active(symbol: str, interval: str = '24h', start_date: int = 1262304000, end_date: int = 1663694553) -> pandas.core.frame.DataFrame
Returns active addresses of a certain symbol
[Source: https://glassnode.com]
Parameters
----------
symbol : str
Asset to search active addresses (e.g., BTC)
start_date : int
Initial date timestamp (e.g., 1_614_556_800)
end_date : int
End date timestamp (e.g., 1_614_556_800)
interval : str
Interval frequency (e.g., 24h)
Returns
-------
pd.DataFrame
active addresses over time
## Getting charts
###crypto.dd.active(symbol: str, start_date: int = 1577836800, end_date: int = 1609459200, interval: str = '24h', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None
Display active addresses of a certain symbol over time
[Source: https://glassnode.org]
Parameters
----------
symbol : str
Asset to search active addresses (e.g., BTC)
start_date : int
Initial date timestamp (e.g., 1_614_556_800)
end_date : int
End date timestamp (e.g., 1_614_556_800)
interval : str
Interval frequency (possible values are: 24h, 1w, 1month)
export : str
Export dataframe data to csv,json,xlsx file
external_axes : Optional[List[plt.Axes]], optional
External axes (1 axis is expected in the list), by default None

View File

@@ -0,0 +1,16 @@
# crypto.dd.all_binance_trading_pairs
## Get underlying data
###crypto.dd.all_binance_trading_pairs() -> pandas.core.frame.DataFrame
Returns all available pairs on Binance in DataFrame format. DataFrame has 3 columns symbol, baseAsset, quoteAsset
example row: ETHBTC | ETH | BTC
[Source: Binance]
Returns
-------
pd.DataFrame
All available pairs on Binance
Columns: symbol, baseAsset, quoteAsset

View File

@@ -0,0 +1,34 @@
# crypto.dd.balance
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###crypto.dd.balance(from_symbol: str, to_symbol: str = 'USDT') -> pandas.core.frame.DataFrame
Get account holdings for asset. [Source: Binance]
Parameters
----------
from_symbol: str
Cryptocurrency
to_symbol: str
Cryptocurrency
Returns
-------
pd.DataFrame
Dataframe with account holdings for an asset
## Getting charts
###crypto.dd.balance(from_symbol: str, to_symbol: str = 'USDT', export: str = '', chart=True) -> None
Get account holdings for asset. [Source: Binance]
Parameters
----------
from_symbol: str
Cryptocurrency
to_symbol: str
Cryptocurrency
export: str
Export dataframe data to csv,json,xlsx

View File

@@ -0,0 +1,32 @@
# crypto.dd.basic
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###crypto.dd.basic(symbol: str = 'btc-bitcoin') -> pandas.core.frame.DataFrame
Basic coin information [Source: CoinPaprika]
Parameters
----------
symbol: str
Coin id
Returns
-------
pd.DataFrame
Metric, Value
## Getting charts
###crypto.dd.basic(symbol: str = 'BTC', export: str = '', chart=True) -> None
Get basic information for coin. Like:
name, symbol, rank, type, description, platform, proof_type, contract, tags, parent.
[Source: CoinPaprika]
Parameters
----------
symbol: str
Cryptocurrency symbol (e.g. BTC)
export: str
Export dataframe data to csv,json,xlsx

View File

@@ -0,0 +1,13 @@
# crypto.dd.binance_available_quotes_for_each_coin
## Get underlying data
###crypto.dd.binance_available_quotes_for_each_coin() -> dict
Helper methods that for every coin available on Binance add all quote assets. [Source: Binance]
Returns
-------
dict:
All quote assets for given coin
{'ETH' : ['BTC', 'USDT' ...], 'UNI' : ['ETH', 'BTC','BUSD', ...]

View File

@@ -0,0 +1,43 @@
# crypto.dd.book
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###crypto.dd.book(from_symbol: str, limit: int = 100, to_symbol: str = 'USDT') -> pandas.core.frame.DataFrame
Get order book for currency. [Source: Binance]
Parameters
----------
from_symbol: str
Cryptocurrency symbol
limit: int
Limit parameter. Adjusts the weight
to_symbol: str
Quote currency (what to view coin vs)
Returns
-------
pd.DataFrame
Dataframe containing orderbook
## Getting charts
###crypto.dd.book(from_symbol: str, limit: int = 100, to_symbol: str = 'USDT', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None
Get order book for currency. [Source: Binance]
Parameters
----------
from_symbol: str
Cryptocurrency symbol
limit: int
Limit parameter. Adjusts the weight
to_symbol: str
Quote currency (what to view coin vs)
export: str
Export dataframe data to csv,json,xlsx
external_axes : Optional[List[plt.Axes]]
External axes (1 axis is expected in the list), by default None

View File

@@ -0,0 +1,43 @@
# crypto.dd.btcrb
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###crypto.dd.btcrb(symbol: str, start_date: int = 1262304000, end_date: int = 1663694553, print_errors: bool = True) -> pandas.core.frame.DataFrame
Returns the price of a cryptocurrency
[Source: https://glassnode.com]
Parameters
----------
symbol : str
Crypto to check close price (BTC or ETH)
start_date : int
Initial date timestamp (e.g., 1_614_556_800)
end_date : int
End date timestamp (e.g., 1_641_227_783_561)
print_errors: bool
Flag to print errors. Default: True
Returns
-------
pd.DataFrame
price over time
## Getting charts
###crypto.dd.btcrb(start_date: int = 1262304000, end_date: int = 1663694553, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True)
Displays bitcoin rainbow chart
[Price data from source: https://glassnode.com]
[Inspired by: https://blockchaincenter.net]
Parameters
----------
start_date : int
Initial date timestamp. Default is initial BTC timestamp: 1_325_376_000
end_date : int
Final date timestamp. Default is current BTC timestamp
export : str
Export dataframe data to csv,json,xlsx file
external_axes : Optional[List[plt.Axes]], optional
External axes (1 axis is expected in the list), by default None

View File

@@ -0,0 +1,34 @@
# crypto.dd.candles
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###crypto.dd.candles(symbol: str, interval: str = '24h') -> pandas.core.frame.DataFrame
Get candles for chosen trading pair and time interval. [Source: Coinbase]
Parameters
----------
symbol: str
Trading pair of coins on Coinbase e.g ETH-USDT or UNI-ETH
interval: str
Time interval. One from 1min, 5min ,15min, 1hour, 6hour, 24hour
Returns
-------
pd.DataFrame
Candles for chosen trading pair.
## Getting charts
###crypto.dd.candles(symbol: str, interval: str = '24h', export: str = '', chart=True) -> None
Get candles for chosen trading pair and time interval. [Source: Coinbase]
Parameters
----------
symbol: str
Trading pair of coins on Coinbase e.g ETH-USDT or UNI-ETH
interval: str
Time interval. One from 1m, 5m ,15m, 1h, 6h, 24h
export : str
Export dataframe data to csv,json,xlsx file

View File

@@ -0,0 +1,35 @@
# crypto.dd.cbbook
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###crypto.dd.cbbook(symbol: str) -> Tuple[numpy.ndarray, numpy.ndarray, str, dict]
Get orders book for chosen trading pair. [Source: Coinbase]
Parameters
----------
symbol: str
Trading pair of coins on Coinbase e.g ETH-USDT or UNI-ETH
Returns
-------
Tuple[np.array, np.array, str, dict]
array with bid prices, order sizes and cumulative order sizes
array with ask prices, order sizes and cumulative order sizes
trading pair
dict with raw data
## Getting charts
###crypto.dd.cbbook(symbol: str, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None
Displays a list of available currency pairs for trading. [Source: Coinbase]
Parameters
----------
symbol: str
Trading pair of coins on Coinbase e.g ETH-USDT or UNI-ETH
export : str
Export dataframe data to csv,json,xlsx file
external_axes : Optional[List[plt.Axes]], optional
External axes (1 axis is expected in the list), by default None

View File

@@ -0,0 +1,48 @@
# crypto.dd.change
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###crypto.dd.change(symbol: str, exchange: str = 'binance', start_date: int = 1262304000, end_date: int = 1663694553) -> pandas.core.frame.DataFrame
Returns 30d change of the supply held in exchange wallets of a certain symbol.
[Source: https://glassnode.com]
Parameters
----------
symbol : str
Asset symbol to search supply (e.g., BTC)
exchange : str
Exchange to check net position change (e.g., binance)
start_date : int
Initial date timestamp (e.g., 1_614_556_800)
end_date : int
End date timestamp (e.g., 1_614_556_800)
Returns
-------
pd.DataFrame
supply change in exchange wallets of a certain symbol over time
## Getting charts
###crypto.dd.change(symbol: str, exchange: str = 'binance', start_date: int = 1577836800, end_date: int = 1609459200, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None
Display 30d change of the supply held in exchange wallets.
[Source: https://glassnode.org]
Parameters
----------
symbol : str
Asset to search active addresses (e.g., BTC)
exchange : str
Exchange to check net position change (possible values are: aggregated, binance,
bittrex, coinex, gate.io, gemini, huobi, kucoin, poloniex, bibox, bigone, bitfinex,
hitbtc, kraken, okex, bithumb, zb.com, cobinhood, bitmex, bitstamp, coinbase, coincheck, luno)
start_date : int
Initial date timestamp (e.g., 1_614_556_800)
end_date : int
End date timestamp (e.g., 1_614_556_800)
export : str
Export dataframe data to csv,json,xlsx file
external_axes : Optional[List[plt.Axes]], optional
External axes (1 axis is expected in the list), by default None

View File

@@ -0,0 +1,6 @@
# crypto.dd.check_valid_binance_str
## Get underlying data
###crypto.dd.check_valid_binance_str(symbol: str) -> str
Check if symbol is in defined binance. [Source: Bin

View File

@@ -0,0 +1,15 @@
# crypto.dd.coin
## Get underlying data
###crypto.dd.coin(symbol: str = 'eth-ethereum') -> dict
Get coin by id [Source: CoinPaprika]
Parameters
----------
symbol: str
id of coin from coinpaprika e.g. Ethereum - > 'eth-ethereum'
Returns
-------
dict
Coin response

View File

@@ -0,0 +1,20 @@
# crypto.dd.coin_market_chart
## Get underlying data
###crypto.dd.coin_market_chart(symbol: str = '', vs_currency: str = 'usd', days: int = 30, **kwargs: Any) -> pandas.core.frame.DataFrame
Get prices for given coin. [Source: CoinGecko]
Parameters
----------
vs_currency: str
currency vs which display data
days: int
number of days to display the data
kwargs
Returns
-------
pandas.DataFrame
Prices for given coin
Columns: time, price, currency

View File

@@ -0,0 +1,50 @@
# crypto.dd.eb
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###crypto.dd.eb(symbol: str, exchange: str = 'binance', start_date: int = 1262304000, end_date: int = 1663694553) -> pandas.core.frame.DataFrame
Returns the total amount of coins held on exchange addresses in units and percentage.
[Source: https://glassnode.com]
Parameters
----------
symbol : str
Asset to search active addresses (e.g., BTC)
exchange : str
Exchange to check net position change (e.g., binance)
start_date : int
Initial date timestamp (e.g., 1_614_556_800)
end_date : int
End date timestamp (e.g., 1_614_556_800)
Returns
-------
pd.DataFrame
total amount of coins in units/percentage and symbol price over time
## Getting charts
###crypto.dd.eb(symbol: str, exchange: str = 'binance', start_date: int = 1577836800, end_date: int = 1609459200, percentage: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None
Display total amount of coins held on exchange addresses in units and percentage.
[Source: https://glassnode.org]
Parameters
----------
symbol : str
Asset to search active addresses (e.g., BTC)
exchange : str
Exchange to check net position change (possible values are: aggregated, binance, bittrex,
coinex, gate.io, gemini, huobi, kucoin, poloniex, bibox, bigone, bitfinex, hitbtc, kraken,
okex, bithumb, zb.com, cobinhood, bitmex, bitstamp, coinbase, coincheck, luno)
start_date : int
Initial date timestamp (e.g., 1_614_556_800)
end_date : int
End date timestamp (e.g., 1_614_556_800)
percentage : bool
Show percentage instead of stacked value.
export : str
Export dataframe data to csv,json,xlsx file
external_axes : Optional[List[plt.Axes]], optional
External axes (2 axes are expected in the list), by default None

View File

@@ -0,0 +1,62 @@
# crypto.dd.events
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###crypto.dd.events(symbol: str = 'eth-ethereum', sortby='date', ascend: bool = False) -> pandas.core.frame.DataFrame
Get all events related to given coin like conferences, start date of futures trading etc.
[Source: CoinPaprika]
Example of response from API:
.. 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
----------
symbol: str
id of coin from coinpaprika e.g. Ethereum - > 'eth-ethereum'
sortby: str
Key by which to sort data. Every column name is valid
(see for possible values:
https://api.coinpaprika.com/docs#tag/Coins/paths/~1coins~1%7Bcoin_id%7D~1events/get).
ascend: bool
Flag to sort data ascending
Returns
-------
pandas.DataFrame
Events found for given coin
Columns: id, date , date_to, name, description, is_conference, link, proof_image_link
## Getting charts
###crypto.dd.events(symbol: str = 'BTC', limit: int = 10, sortby: str = 'date', ascend: bool = False, links: bool = False, export: str = '', chart=True) -> None
Get all events for given coin id. [Source: CoinPaprika]
Parameters
----------
symbol: str
Cryptocurrency symbol (e.g. BTC)
limit: int
Number of records to display
sortby: str
Key by which to sort data. Every column name is valid
(see for possible values:
https://api.coinpaprika.com/docs#tag/Coins/paths/~1coins~1%7Bcoin_id%7D~1events/get).
ascend: bool
Flag to sort data ascending
links: bool
Flag to display urls
export : str
Export dataframe data to csv,json,xlsx file

View File

@@ -0,0 +1,43 @@
# crypto.dd.ex
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###crypto.dd.ex(symbol: str = 'eth-ethereum', sortby: str = 'adjusted_volume_24h_share', ascend: bool = True) -> pandas.core.frame.DataFrame
Get all exchanges for given coin id. [Source: CoinPaprika]
Parameters
----------
symbol: str
Identifier of Coin from CoinPaprika
sortby: str
Key by which to sort data. Every column name is valid (see for possible values:
https://api.coinpaprika.com/v1).
ascend: bool
Flag to sort data ascending
Returns
-------
pandas.DataFrame
All exchanges for given coin
Columns: id, name, adjusted_volume_24h_share, fiats
## Getting charts
###crypto.dd.ex(symbol: str = 'btc', limit: int = 10, sortby: str = 'adjusted_volume_24h_share', ascend: bool = True, export: str = '', chart=True) -> None
Get all exchanges for given coin id. [Source: CoinPaprika]
Parameters
----------
symbol: str
Cryptocurrency symbol (e.g. BTC)
limit: int
Number of records to display
sortby: str
Key by which to sort data. Every column name is valid (see for possible values:
https://api.coinpaprika.com/v1).
ascend: bool
Flag to sort data ascending
export : str
Export dataframe data to csv,json,xlsx file

View File

@@ -0,0 +1,15 @@
# crypto.dd.exchanges
## Get underlying data
###crypto.dd.exchanges()
Helper method to get all the exchanges supported by ccxt
[Source: https://docs.ccxt.com/en/latest/manual.html]
Parameters
----------
Returns
-------
List[str]
list of all the exchanges supported by ccxt

View File

@@ -0,0 +1,40 @@
# crypto.dd.fr
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###crypto.dd.fr(symbol: str) -> Tuple[str, pandas.core.frame.DataFrame, pandas.core.frame.DataFrame, pandas.core.frame.DataFrame]
Returns coin fundraising
[Source: https://messari.io/]
Parameters
----------
symbol : str
Crypto symbol to check fundraising
Returns
-------
str
launch summary
pd.DataFrame
Sales rounds
pd.DataFrame
Treasury Accounts
pd.DataFrame
Metric Value launch details
## Getting charts
###crypto.dd.fr(symbol: str, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None
Display coin fundraising
[Source: https://messari.io/]
Parameters
----------
symbol : str
Crypto symbol to check coin fundraising
export : str
Export dataframe data to csv,json,xlsx file
external_axes : Optional[List[plt.Axes]], optional
External axes (1 axis is expected in the list), by default None

View File

@@ -0,0 +1,36 @@
# crypto.dd.get_mt
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###crypto.dd.get_mt(only_free: bool = True) -> pandas.core.frame.DataFrame
Returns available messari timeseries
[Source: https://messari.io/]
Parameters
----------
only_free : bool
Display only timeseries available for free
Returns
-------
pd.DataFrame
available timeseries
## Getting charts
###crypto.dd.get_mt(limit: int = 10, query: str = '', only_free: bool = True, export: str = '', chart=True) -> None
Display messari timeseries list
[Source: https://messari.io/]
Parameters
----------
limit : int
number to show
query : str
Query to search across all messari timeseries
only_free : bool
Display only timeseries available for free
export : str
Export dataframe data to csv,json,xlsx file

View File

@@ -0,0 +1,52 @@
# crypto.dd.gh
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###crypto.dd.gh(symbol: str, dev_activity: bool = False, interval: str = '1d', start_date: str = '2021-09-20T18:22:33Z', end_date: str = '2022-09-20T18:22:33Z') -> pandas.core.frame.DataFrame
Returns a list of developer activity for a given coin and time interval.
[Source: https://santiment.net/]
Parameters
----------
symbol : str
Crypto symbol to check github activity
dev_activity: bool
Whether to filter only for development activity
start_date : int
Initial date like string (e.g., 2021-10-01)
end_date : int
End date like string (e.g., 2021-10-01)
interval : str
Interval frequency (e.g., 1d)
Returns
-------
pd.DataFrame
developer activity over time
## Getting charts
###crypto.dd.gh(symbol: str, start_date: str = '2021-09-20T18:22:33Z', dev_activity: bool = False, end_date: str = '2022-09-20T18:22:33Z', interval: str = '1d', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None
Returns a list of github activity for a given coin and time interval.
[Source: https://santiment.net/]
Parameters
----------
symbol : str
Crypto symbol to check github activity
dev_activity: bool
Whether to filter only for development activity
start_date : int
Initial date like string (e.g., 2021-10-01)
end_date : int
End date like string (e.g., 2021-10-01)
interval : str
Interval frequency (some possible values are: 1h, 1d, 1w)
export : str
Export dataframe data to csv,json,xlsx file
external_axes : Optional[List[plt.Axes]], optional
External axes (1 axis is expected in the list), by default None

View File

@@ -0,0 +1,34 @@
# crypto.dd.gov
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###crypto.dd.gov(symbol: str) -> Tuple[str, pandas.core.frame.DataFrame]
Returns coin governance
[Source: https://messari.io/]
Parameters
----------
symbol : str
Crypto symbol to check governance
Returns
-------
str
governance summary
pd.DataFrame
Metric Value with governance details
## Getting charts
###crypto.dd.gov(symbol: str, export: str = '', chart=True) -> None
Display coin governance
[Source: https://messari.io/]
Parameters
----------
symbol : str
Crypto symbol to check coin governance
export : str
Export dataframe data to csv,json,xlsx file

View File

@@ -0,0 +1,41 @@
# crypto.dd.headlines
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###crypto.dd.headlines(symbol: str) -> pandas.core.frame.DataFrame
Gets Sentiment analysis provided by FinBrain's API [Source: finbrain]
Parameters
----------
symbol : str
Ticker symbol to get the sentiment analysis from
Returns
-------
DataFrame()
Empty if there was an issue with data retrieval
## Getting charts
###crypto.dd.headlines(symbol: str, raw: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None
Sentiment analysis from FinBrain for Cryptocurrencies
FinBrain collects the news headlines from 15+ major financial news
sources on a daily basis and analyzes them to generate sentiment scores
for more than 4500 US stocks. FinBrain Technologies develops deep learning
algorithms for financial analysis and prediction, which currently serves
traders from more than 150 countries all around the world.
[Source: https://finbrain.tech]
Parameters
----------
symbol: str
Cryptocurrency
raw : False
Display raw table data
export : str
Export dataframe data to csv,json,xlsx file
external_axes : Optional[List[plt.Axes]], optional
External axes (1 axis is expected in the list), by default None

View File

@@ -0,0 +1,46 @@
# crypto.dd.hr
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###crypto.dd.hr(symbol: str, interval: str = '24h', start_date: int = 1262304000, end_date: int = 1663694553) -> pandas.core.frame.DataFrame
Returns dataframe with mean hashrate of btc or eth blockchain and symbol price
[Source: https://glassnode.com]
Parameters
----------
symbol : str
Blockchain to check hashrate (BTC or ETH)
start_date : int
Initial date timestamp (e.g., 1_614_556_800)
end_date : int
End date timestamp (e.g., 1_614_556_800)
interval : str
Interval frequency (e.g., 24h)
Returns
-------
pd.DataFrame
mean hashrate and symbol price over time
## Getting charts
###crypto.dd.hr(symbol: str, start_date: int = 1632158553, end_date: int = 1663694553, interval: str = '24h', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None
Display dataframe with mean hashrate of btc or eth blockchain and symbol price.
[Source: https://glassnode.org]
Parameters
----------
symbol : str
Blockchain to check mean hashrate (BTC or ETH)
start_date : int
Initial date timestamp (e.g., 1_614_556_800)
end_date : int
End date timestamp (e.g., 1_614_556_800)
interval : str
Interval frequency (possible values are: 24, 1w, 1month)
export : str
Export dataframe data to csv,json,xlsx file
external_axes : Optional[List[plt.Axes]], optional
External axes (2 axes are expected in the list), by default None

View File

@@ -0,0 +1,34 @@
# crypto.dd.inv
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###crypto.dd.inv(symbol: str) -> Tuple[pandas.core.frame.DataFrame, pandas.core.frame.DataFrame]
Returns coin investors
[Source: https://messari.io/]
Parameters
----------
symbol : str
Crypto symbol to check investors
Returns
-------
pd.DataFrame
individuals
pd.DataFrame
organizations
## Getting charts
###crypto.dd.inv(symbol: str, export: str = '', chart=True) -> None
Display coin investors
[Source: https://messari.io/]
Parameters
----------
symbol : str
Crypto symbol to check coin investors
export : str
Export dataframe data to csv,json,xlsx file

View File

@@ -0,0 +1,34 @@
# crypto.dd.links
To obtain charts, make sure to add `chart=True` as the last parameter
## Get underlying data
###crypto.dd.links(symbol: str) -> pandas.core.frame.DataFrame
Returns asset's links
[Source: https://messari.io/]
Parameters
----------
symbol : str
Crypto symbol to check links
Returns
-------
pd.DataFrame
asset links
## Getting charts
###crypto.dd.links(symbol: str, export: str = '', chart=True) -> None
Display coin links
[Source: https://messari.io/]
Parameters
----------
symbol : str
Crypto symbol to check links
export : str
Export dataframe data to csv,json,xlsx file
external_axes : Optional[List[plt.Axes]], optional
External axes (1 axis is expected in the list), by default None

Some files were not shown because too many files have changed in this diff Show More