{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Single Time Series"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-09-21T08:54:57.825351Z",
     "start_time": "2022-09-21T08:54:55.730672Z"
    }
   },
   "outputs": [],
   "source": [
    "import tslumen\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-09-21T08:54:57.831835Z",
     "start_time": "2022-09-21T08:54:57.827681Z"
    },
    "nbsphinx": "hidden"
   },
   "outputs": [],
   "source": [
    "# patch it\n",
    "_read_csv = pd.read_csv\n",
    "pd.read_csv = lambda fpath, *args, **kwargs: _read_csv(fpath.split('/')[-1], *args, **kwargs)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-09-21T08:54:57.844874Z",
     "start_time": "2022-09-21T08:54:57.834588Z"
    }
   },
   "outputs": [],
   "source": [
    "df = pd.read_csv('https://datahub.io/core/gold-prices/r/monthly.csv', parse_dates=[0], index_col=0)\n",
    "meta = {\n",
    "    'frame': {\n",
    "        'Description': 'Gold Prices (Monthly in USD)',\n",
    "        'Source': '<a href=\"https://datahub.io/core/gold-prices\">DataHub</a>',\n",
    "    },\n",
    "    'series': {\n",
    "        'Price': 'Gold price in USD'\n",
    "    }\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-09-21T08:55:07.050059Z",
     "start_time": "2022-09-21T08:54:57.847471Z"
    }
   },
   "outputs": [],
   "source": [
    "tslumen.HtmlReport(df, meta)"
   ]
  }
 ],
 "metadata": {
  "celltoolbar": "Edit Metadata",
  "hide_input": false,
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": false,
   "skip_h1_title": true,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
