mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-08 02:11:44 +00:00
* fix(docs): added margin between sections * fix: moved files to right context * fix: updated path * fix: apis * fix: tests Co-authored-by: James Maslek <jmaslek11@gmail.com>
36 lines
894 B
Python
36 lines
894 B
Python
from datetime import datetime
|
|
import logging
|
|
|
|
from openbb_terminal.decorators import log_start_end
|
|
|
|
from openbb_terminal.cryptocurrency.due_diligence.glassnode_model import get_close_price
|
|
|
|
# pylint: disable=unsupported-assignment-operation
|
|
|
|
logger = logging.getLogger(__name__)
|
|
# pylint: disable=unsupported-assignment-operation
|
|
|
|
api_url = "https://api.glassnode.com/v1/metrics/"
|
|
|
|
|
|
@log_start_end(log=logger)
|
|
def get_btc_rainbow(
|
|
start_date: str = "2010-01-01",
|
|
end_date: str = datetime.now().strftime("%Y-%m-%d"),
|
|
):
|
|
"""Get bitcoin price data
|
|
[Price data from source: https://glassnode.com]
|
|
[Inspired by: https://blockchaincenter.net]
|
|
|
|
Parameters
|
|
----------
|
|
start_date : str
|
|
Initial date, format YYYY-MM-DD
|
|
end_date : str
|
|
Final date, format YYYY-MM-DD
|
|
"""
|
|
|
|
df_data = get_close_price("BTC", start_date, end_date)
|
|
|
|
return df_data
|