{"id":13465528,"url":"https://github.com/business-science/pytimetk","last_synced_at":"2025-11-27T02:04:15.647Z","repository":{"id":46783501,"uuid":"358703893","full_name":"business-science/pytimetk","owner":"business-science","description":"Time series easier, faster, more fun. Pytimetk.","archived":false,"fork":false,"pushed_at":"2025-04-03T14:14:27.000Z","size":228097,"stargazers_count":858,"open_issues_count":25,"forks_count":72,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-05-12T23:48:57.607Z","etag":null,"topics":["pandas","polars","time","time-series","timeseries","timeseries-analysis"],"latest_commit_sha":null,"homepage":"https://business-science.github.io/pytimetk/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/business-science.png","metadata":{"files":{"readme":"README.html","changelog":null,"contributing":"docs/contributing.qmd","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-04-16T19:46:49.000Z","updated_at":"2025-05-12T21:47:18.000Z","dependencies_parsed_at":"2024-11-22T01:01:33.054Z","dependency_job_id":"bf889fbc-7882-48cd-9eb0-bee3c72baf2d","html_url":"https://github.com/business-science/pytimetk","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/business-science%2Fpytimetk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/business-science%2Fpytimetk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/business-science%2Fpytimetk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/business-science%2Fpytimetk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/business-science","download_url":"https://codeload.github.com/business-science/pytimetk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254110374,"owners_count":22016391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pandas","polars","time","time-series","timeseries","timeseries-analysis"],"created_at":"2024-07-31T15:00:31.582Z","updated_at":"2025-11-27T02:04:05.633Z","avatar_url":"https://github.com/business-science.png","language":"Python","funding_links":[],"categories":["Python","📦 Packages"],"sub_categories":["Python"],"readme":"\u003c!DOCTYPE html\u003e\n\u003chtml xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\" xml:lang=\"en\"\u003e\u003chead\u003e\n\n\u003cmeta charset=\"utf-8\"\u003e\n\u003cmeta name=\"generator\" content=\"quarto-1.3.450\"\u003e\n\n\u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=yes\"\u003e\n\n\n\u003ctitle\u003ereadme\u003c/title\u003e\n\u003cstyle\u003e\ncode{white-space: pre-wrap;}\nspan.smallcaps{font-variant: small-caps;}\ndiv.columns{display: flex; gap: min(4vw, 1.5em);}\ndiv.column{flex: auto; overflow-x: auto;}\ndiv.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}\nul.task-list{list-style: none;}\nul.task-list li input[type=\"checkbox\"] {\n  width: 0.8em;\n  margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */ \n  vertical-align: middle;\n}\n/* CSS for syntax highlighting */\npre \u003e code.sourceCode { white-space: pre; position: relative; }\npre \u003e code.sourceCode \u003e span { display: inline-block; line-height: 1.25; }\npre \u003e code.sourceCode \u003e span:empty { height: 1.2em; }\n.sourceCode { overflow: visible; }\ncode.sourceCode \u003e span { color: inherit; text-decoration: inherit; }\ndiv.sourceCode { margin: 1em 0; }\npre.sourceCode { margin: 0; }\n@media screen {\ndiv.sourceCode { overflow: auto; }\n}\n@media print {\npre \u003e code.sourceCode { white-space: pre-wrap; }\npre \u003e code.sourceCode \u003e span { text-indent: -5em; padding-left: 5em; }\n}\npre.numberSource code\n  { counter-reset: source-line 0; }\npre.numberSource code \u003e span\n  { position: relative; left: -4em; counter-increment: source-line; }\npre.numberSource code \u003e span \u003e a:first-child::before\n  { content: counter(source-line);\n    position: relative; left: -1em; text-align: right; vertical-align: baseline;\n    border: none; display: inline-block;\n    -webkit-touch-callout: none; -webkit-user-select: none;\n    -khtml-user-select: none; -moz-user-select: none;\n    -ms-user-select: none; user-select: none;\n    padding: 0 4px; width: 4em;\n  }\npre.numberSource { margin-left: 3em;  padding-left: 4px; }\ndiv.sourceCode\n  {   }\n@media screen {\npre \u003e code.sourceCode \u003e span \u003e a:first-child::before { text-decoration: underline; }\n}\n\u003c/style\u003e\n\n\n\u003cscript src=\"README_files/libs/clipboard/clipboard.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"README_files/libs/quarto-html/quarto.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"README_files/libs/quarto-html/popper.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"README_files/libs/quarto-html/tippy.umd.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"README_files/libs/quarto-html/anchor.min.js\"\u003e\u003c/script\u003e\n\u003clink href=\"README_files/libs/quarto-html/tippy.css\" rel=\"stylesheet\"\u003e\n\u003clink href=\"README_files/libs/quarto-html/quarto-syntax-highlighting.css\" rel=\"stylesheet\" id=\"quarto-text-highlighting-styles\"\u003e\n\u003cscript src=\"README_files/libs/bootstrap/bootstrap.min.js\"\u003e\u003c/script\u003e\n\u003clink href=\"README_files/libs/bootstrap/bootstrap-icons.css\" rel=\"stylesheet\"\u003e\n\u003clink href=\"README_files/libs/bootstrap/bootstrap.min.css\" rel=\"stylesheet\" id=\"quarto-bootstrap\" data-mode=\"light\"\u003e\n\n\n\u003c/head\u003e\n\n\u003cbody class=\"fullcontent\"\u003e\n\n\u003cdiv id=\"quarto-content\" class=\"page-columns page-rows-contents page-layout-article\"\u003e\n\n\u003cmain class=\"content\" id=\"quarto-document-content\"\u003e\n\n\n\n\u003cdiv data-align=\"center\"\u003e\n\u003cp\u003e\u003cimg src=\"docs/logo-timetk.png\" width=\"40%\"\u003e\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv data-align=\"center\"\u003e\n\u003cp\u003e\u003ca href=\"https://github.com/facebookresearch/Kats/actions\"\u003e \u003cimg alt=\"Github Actions\" src=\"https://github.com/facebookresearch/Kats/actions/workflows/build_and_test.yml/badge.svg\"\u003e \u003c/a\u003e \u003ca href=\"https://pypi.python.org/pypi/kats\"\u003e \u003cimg alt=\"PyPI Version\" src=\"https://img.shields.io/pypi/v/kats.svg\"\u003e \u003c/a\u003e \u003ca href=\"https://github.com/facebookresearch/Kats/blob/master/CONTRIBUTING.md\"\u003e \u003cimg alt=\"PRs Welcome\" src=\"https://img.shields.io/badge/PRs-welcome-brightgreen.svg\"\u003e \u003c/a\u003e\u003c/p\u003e\n\u003c/div\u003e\n\u003csection id=\"pytimetk\" class=\"level1\"\u003e\n\u003ch1\u003epytimetk\u003c/h1\u003e\n\u003cblockquote class=\"blockquote\"\u003e\n\u003cp\u003eThe time series toolkit for Python\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cp\u003e\u003cstrong\u003ePlease ⭐ us on GitHub (it takes 2-seconds and means a lot).\u003c/strong\u003e\u003c/p\u003e\n\u003c/section\u003e\n\u003csection id=\"installation\" class=\"level1\"\u003e\n\u003ch1\u003eInstallation\u003c/h1\u003e\n\u003cp\u003eInstall the latest stable version of \u003ccode\u003epytimetk\u003c/code\u003e using \u003ccode\u003epip\u003c/code\u003e:\u003c/p\u003e\n\u003cdiv class=\"sourceCode\" id=\"cb1\"\u003e\u003cpre class=\"sourceCode bash code-with-copy\"\u003e\u003ccode class=\"sourceCode bash\"\u003e\u003cspan id=\"cb1-1\"\u003e\u003ca href=\"#cb1-1\" aria-hidden=\"true\" tabindex=\"-1\"\u003e\u003c/a\u003e\u003cspan class=\"ex\"\u003epip\u003c/span\u003e install pytimetk\u003c/span\u003e\u003c/code\u003e\u003cbutton title=\"Copy to Clipboard\" class=\"code-copy-button\"\u003e\u003ci class=\"bi\"\u003e\u003c/i\u003e\u003c/button\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp\u003eAlternatively you can install the development version:\u003c/p\u003e\n\u003cdiv class=\"sourceCode\" id=\"cb2\"\u003e\u003cpre class=\"sourceCode bash code-with-copy\"\u003e\u003ccode class=\"sourceCode bash\"\u003e\u003cspan id=\"cb2-1\"\u003e\u003ca href=\"#cb2-1\" aria-hidden=\"true\" tabindex=\"-1\"\u003e\u003c/a\u003e\u003cspan class=\"ex\"\u003epip\u003c/span\u003e install git+https://github.com/business-science/pytimetk.git\u003c/span\u003e\u003c/code\u003e\u003cbutton title=\"Copy to Clipboard\" class=\"code-copy-button\"\u003e\u003ci class=\"bi\"\u003e\u003c/i\u003e\u003c/button\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003c/section\u003e\n\u003csection id=\"quickstart\" class=\"level1\"\u003e\n\u003ch1\u003eQuickstart:\u003c/h1\u003e\n\u003cp\u003eThis is a simple code to test the function \u003ccode\u003esummarize_by_time\u003c/code\u003e:\u003c/p\u003e\n\u003cdiv class=\"sourceCode\" id=\"cb3\"\u003e\u003cpre class=\"sourceCode python code-with-copy\"\u003e\u003ccode class=\"sourceCode python\"\u003e\u003cspan id=\"cb3-1\"\u003e\u003ca href=\"#cb3-1\" aria-hidden=\"true\" tabindex=\"-1\"\u003e\u003c/a\u003e\u003cspan class=\"im\"\u003eimport\u003c/span\u003e pytimetk \u003cspan class=\"im\"\u003eas\u003c/span\u003e tk\u003c/span\u003e\n\u003cspan id=\"cb3-2\"\u003e\u003ca href=\"#cb3-2\" aria-hidden=\"true\" tabindex=\"-1\"\u003e\u003c/a\u003e\u003cspan class=\"im\"\u003eimport\u003c/span\u003e pandas \u003cspan class=\"im\"\u003eas\u003c/span\u003e pd\u003c/span\u003e\n\u003cspan id=\"cb3-3\"\u003e\u003ca href=\"#cb3-3\" aria-hidden=\"true\" tabindex=\"-1\"\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan id=\"cb3-4\"\u003e\u003ca href=\"#cb3-4\" aria-hidden=\"true\" tabindex=\"-1\"\u003e\u003c/a\u003edf \u003cspan class=\"op\"\u003e=\u003c/span\u003e tk.datasets.load_dataset(\u003cspan class=\"st\"\u003e'bike_sales_sample'\u003c/span\u003e)\u003c/span\u003e\n\u003cspan id=\"cb3-5\"\u003e\u003ca href=\"#cb3-5\" aria-hidden=\"true\" tabindex=\"-1\"\u003e\u003c/a\u003edf[\u003cspan class=\"st\"\u003e'order_date'\u003c/span\u003e] \u003cspan class=\"op\"\u003e=\u003c/span\u003e pd.to_datetime(df[\u003cspan class=\"st\"\u003e'order_date'\u003c/span\u003e])\u003c/span\u003e\n\u003cspan id=\"cb3-6\"\u003e\u003ca href=\"#cb3-6\" aria-hidden=\"true\" tabindex=\"-1\"\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan id=\"cb3-7\"\u003e\u003ca href=\"#cb3-7\" aria-hidden=\"true\" tabindex=\"-1\"\u003e\u003c/a\u003edf \u003cspan class=\"op\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan id=\"cb3-8\"\u003e\u003ca href=\"#cb3-8\" aria-hidden=\"true\" tabindex=\"-1\"\u003e\u003c/a\u003e    .groupby(\u003cspan class=\"st\"\u003e\"category_2\"\u003c/span\u003e) \u003cspan class=\"op\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan id=\"cb3-9\"\u003e\u003ca href=\"#cb3-9\" aria-hidden=\"true\" tabindex=\"-1\"\u003e\u003c/a\u003e    .summarize_by_time(\u003c/span\u003e\n\u003cspan id=\"cb3-10\"\u003e\u003ca href=\"#cb3-10\" aria-hidden=\"true\" tabindex=\"-1\"\u003e\u003c/a\u003e        date_column\u003cspan class=\"op\"\u003e=\u003c/span\u003e\u003cspan class=\"st\"\u003e'order_date'\u003c/span\u003e, \u003c/span\u003e\n\u003cspan id=\"cb3-11\"\u003e\u003ca href=\"#cb3-11\" aria-hidden=\"true\" tabindex=\"-1\"\u003e\u003c/a\u003e        value_column\u003cspan class=\"op\"\u003e=\u003c/span\u003e \u003cspan class=\"st\"\u003e'total_price'\u003c/span\u003e,\u003c/span\u003e\n\u003cspan id=\"cb3-12\"\u003e\u003ca href=\"#cb3-12\" aria-hidden=\"true\" tabindex=\"-1\"\u003e\u003c/a\u003e        freq \u003cspan class=\"op\"\u003e=\u003c/span\u003e \u003cspan class=\"st\"\u003e\"MS\"\u003c/span\u003e,\u003c/span\u003e\n\u003cspan id=\"cb3-13\"\u003e\u003ca href=\"#cb3-13\" aria-hidden=\"true\" tabindex=\"-1\"\u003e\u003c/a\u003e        agg_func \u003cspan class=\"op\"\u003e=\u003c/span\u003e [\u003cspan class=\"st\"\u003e'mean'\u003c/span\u003e, \u003cspan class=\"st\"\u003e'sum'\u003c/span\u003e]\u003c/span\u003e\n\u003cspan id=\"cb3-14\"\u003e\u003ca href=\"#cb3-14\" aria-hidden=\"true\" tabindex=\"-1\"\u003e\u003c/a\u003e    )\u003c/span\u003e\u003c/code\u003e\u003cbutton title=\"Copy to Clipboard\" class=\"code-copy-button\"\u003e\u003ci class=\"bi\"\u003e\u003c/i\u003e\u003c/button\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003csection id=\"developers-contributors-installation\" class=\"level2\"\u003e\n\u003ch2 class=\"anchored\" data-anchor-id=\"developers-contributors-installation\"\u003eDevelopers (Contributors): Installation\u003c/h2\u003e\n\u003cp\u003eTo install \u003ccode\u003epytimetk\u003c/code\u003e using \u003ca href=\"https://python-poetry.org/\"\u003ePoetry\u003c/a\u003e, follow these steps:\u003c/p\u003e\n\u003csection id=\"prerequisites\" class=\"level3\"\u003e\n\u003ch3 class=\"anchored\" data-anchor-id=\"prerequisites\"\u003e1. Prerequisites\u003c/h3\u003e\n\u003cp\u003eMake sure you have Python 3.9 or later installed on your system.\u003c/p\u003e\n\u003c/section\u003e\n\u003csection id=\"install-poetry\" class=\"level3\"\u003e\n\u003ch3 class=\"anchored\" data-anchor-id=\"install-poetry\"\u003e2. Install Poetry\u003c/h3\u003e\n\u003cp\u003eTo install Poetry, you can use the \u003ca href=\"https://python-poetry.org/docs/#installing-with-the-official-installer\"\u003eofficial installer\u003c/a\u003e provided by Poetry. Do not use pip.\u003c/p\u003e\n\u003c/section\u003e\n\u003csection id=\"clone-the-repository\" class=\"level3\"\u003e\n\u003ch3 class=\"anchored\" data-anchor-id=\"clone-the-repository\"\u003e3. Clone the Repository\u003c/h3\u003e\n\u003cp\u003eClone the \u003ccode\u003epytimetk\u003c/code\u003e repository from GitHub:\u003c/p\u003e\n\u003cdiv class=\"sourceCode\" id=\"cb4\"\u003e\u003cpre class=\"sourceCode bash code-with-copy\"\u003e\u003ccode class=\"sourceCode bash\"\u003e\u003cspan id=\"cb4-1\"\u003e\u003ca href=\"#cb4-1\" aria-hidden=\"true\" tabindex=\"-1\"\u003e\u003c/a\u003e\u003cspan class=\"fu\"\u003egit\u003c/span\u003e clone https://github.com/business-science/pytimetk\u003c/span\u003e\u003c/code\u003e\u003cbutton title=\"Copy to Clipboard\" class=\"code-copy-button\"\u003e\u003ci class=\"bi\"\u003e\u003c/i\u003e\u003c/button\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003c/section\u003e\n\u003csection id=\"install-dependencies\" class=\"level3\"\u003e\n\u003ch3 class=\"anchored\" data-anchor-id=\"install-dependencies\"\u003e4. Install Dependencies\u003c/h3\u003e\n\u003cp\u003eUse Poetry to install the package and its dependencies:\u003c/p\u003e\n\u003cdiv class=\"sourceCode\" id=\"cb5\"\u003e\u003cpre class=\"sourceCode bash code-with-copy\"\u003e\u003ccode class=\"sourceCode bash\"\u003e\u003cspan id=\"cb5-1\"\u003e\u003ca href=\"#cb5-1\" aria-hidden=\"true\" tabindex=\"-1\"\u003e\u003c/a\u003e\u003cspan class=\"ex\"\u003epoetry\u003c/span\u003e install\u003c/span\u003e\u003c/code\u003e\u003cbutton title=\"Copy to Clipboard\" class=\"code-copy-button\"\u003e\u003ci class=\"bi\"\u003e\u003c/i\u003e\u003c/button\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp\u003eor you can create a virtualenv with poetry and install the dependencies\u003c/p\u003e\n\u003cdiv class=\"sourceCode\" id=\"cb6\"\u003e\u003cpre class=\"sourceCode bash code-with-copy\"\u003e\u003ccode class=\"sourceCode bash\"\u003e\u003cspan id=\"cb6-1\"\u003e\u003ca href=\"#cb6-1\" aria-hidden=\"true\" tabindex=\"-1\"\u003e\u003c/a\u003e\u003cspan class=\"ex\"\u003epoetry\u003c/span\u003e shell\u003c/span\u003e\n\u003cspan id=\"cb6-2\"\u003e\u003ca href=\"#cb6-2\" aria-hidden=\"true\" tabindex=\"-1\"\u003e\u003c/a\u003e\u003cspan class=\"ex\"\u003epoetry\u003c/span\u003e install\u003c/span\u003e\u003c/code\u003e\u003cbutton title=\"Copy to Clipboard\" class=\"code-copy-button\"\u003e\u003ci class=\"bi\"\u003e\u003c/i\u003e\u003c/button\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003c/section\u003e\n\u003c/section\u003e\n\u003c/section\u003e\n\n\u003c/main\u003e\n\u003c!-- /main column --\u003e\n\u003cscript id=\"quarto-html-after-body\" type=\"application/javascript\"\u003e\nwindow.document.addEventListener(\"DOMContentLoaded\", function (event) {\n  const toggleBodyColorMode = (bsSheetEl) =\u003e {\n    const mode = bsSheetEl.getAttribute(\"data-mode\");\n    const bodyEl = window.document.querySelector(\"body\");\n    if (mode === \"dark\") {\n      bodyEl.classList.add(\"quarto-dark\");\n      bodyEl.classList.remove(\"quarto-light\");\n    } else {\n      bodyEl.classList.add(\"quarto-light\");\n      bodyEl.classList.remove(\"quarto-dark\");\n    }\n  }\n  const toggleBodyColorPrimary = () =\u003e {\n    const bsSheetEl = window.document.querySelector(\"link#quarto-bootstrap\");\n    if (bsSheetEl) {\n      toggleBodyColorMode(bsSheetEl);\n    }\n  }\n  toggleBodyColorPrimary();  \n  const icon = \"\";\n  const anchorJS = new window.AnchorJS();\n  anchorJS.options = {\n    placement: 'right',\n    icon: icon\n  };\n  anchorJS.add('.anchored');\n  const isCodeAnnotation = (el) =\u003e {\n    for (const clz of el.classList) {\n      if (clz.startsWith('code-annotation-')) {                     \n        return true;\n      }\n    }\n    return false;\n  }\n  const clipboard = new window.ClipboardJS('.code-copy-button', {\n    text: function(trigger) {\n      const codeEl = trigger.previousElementSibling.cloneNode(true);\n      for (const childEl of codeEl.children) {\n        if (isCodeAnnotation(childEl)) {\n          childEl.remove();\n        }\n      }\n      return codeEl.innerText;\n    }\n  });\n  clipboard.on('success', function(e) {\n    // button target\n    const button = e.trigger;\n    // don't keep focus\n    button.blur();\n    // flash \"checked\"\n    button.classList.add('code-copy-button-checked');\n    var currentTitle = button.getAttribute(\"title\");\n    button.setAttribute(\"title\", \"Copied!\");\n    let tooltip;\n    if (window.bootstrap) {\n      button.setAttribute(\"data-bs-toggle\", \"tooltip\");\n      button.setAttribute(\"data-bs-placement\", \"left\");\n      button.setAttribute(\"data-bs-title\", \"Copied!\");\n      tooltip = new bootstrap.Tooltip(button, \n        { trigger: \"manual\", \n          customClass: \"code-copy-button-tooltip\",\n          offset: [0, -8]});\n      tooltip.show();    \n    }\n    setTimeout(function() {\n      if (tooltip) {\n        tooltip.hide();\n        button.removeAttribute(\"data-bs-title\");\n        button.removeAttribute(\"data-bs-toggle\");\n        button.removeAttribute(\"data-bs-placement\");\n      }\n      button.setAttribute(\"title\", currentTitle);\n      button.classList.remove('code-copy-button-checked');\n    }, 1000);\n    // clear code selection\n    e.clearSelection();\n  });\n  function tippyHover(el, contentFn) {\n    const config = {\n      allowHTML: true,\n      content: contentFn,\n      maxWidth: 500,\n      delay: 100,\n      arrow: false,\n      appendTo: function(el) {\n          return el.parentElement;\n      },\n      interactive: true,\n      interactiveBorder: 10,\n      theme: 'quarto',\n      placement: 'bottom-start'\n    };\n    window.tippy(el, config); \n  }\n  const noterefs = window.document.querySelectorAll('a[role=\"doc-noteref\"]');\n  for (var i=0; i\u003cnoterefs.length; i++) {\n    const ref = noterefs[i];\n    tippyHover(ref, function() {\n      // use id or data attribute instead here\n      let href = ref.getAttribute('data-footnote-href') || ref.getAttribute('href');\n      try { href = new URL(href).hash; } catch {}\n      const id = href.replace(/^#\\/?/, \"\");\n      const note = window.document.getElementById(id);\n      return note.innerHTML;\n    });\n  }\n      let selectedAnnoteEl;\n      const selectorForAnnotation = ( cell, annotation) =\u003e {\n        let cellAttr = 'data-code-cell=\"' + cell + '\"';\n        let lineAttr = 'data-code-annotation=\"' +  annotation + '\"';\n        const selector = 'span[' + cellAttr + '][' + lineAttr + ']';\n        return selector;\n      }\n      const selectCodeLines = (annoteEl) =\u003e {\n        const doc = window.document;\n        const targetCell = annoteEl.getAttribute(\"data-target-cell\");\n        const targetAnnotation = annoteEl.getAttribute(\"data-target-annotation\");\n        const annoteSpan = window.document.querySelector(selectorForAnnotation(targetCell, targetAnnotation));\n        const lines = annoteSpan.getAttribute(\"data-code-lines\").split(\",\");\n        const lineIds = lines.map((line) =\u003e {\n          return targetCell + \"-\" + line;\n        })\n        let top = null;\n        let height = null;\n        let parent = null;\n        if (lineIds.length \u003e 0) {\n            //compute the position of the single el (top and bottom and make a div)\n            const el = window.document.getElementById(lineIds[0]);\n            top = el.offsetTop;\n            height = el.offsetHeight;\n            parent = el.parentElement.parentElement;\n          if (lineIds.length \u003e 1) {\n            const lastEl = window.document.getElementById(lineIds[lineIds.length - 1]);\n            const bottom = lastEl.offsetTop + lastEl.offsetHeight;\n            height = bottom - top;\n          }\n          if (top !== null \u0026\u0026 height !== null \u0026\u0026 parent !== null) {\n            // cook up a div (if necessary) and position it \n            let div = window.document.getElementById(\"code-annotation-line-highlight\");\n            if (div === null) {\n              div = window.document.createElement(\"div\");\n              div.setAttribute(\"id\", \"code-annotation-line-highlight\");\n              div.style.position = 'absolute';\n              parent.appendChild(div);\n            }\n            div.style.top = top - 2 + \"px\";\n            div.style.height = height + 4 + \"px\";\n            let gutterDiv = window.document.getElementById(\"code-annotation-line-highlight-gutter\");\n            if (gutterDiv === null) {\n              gutterDiv = window.document.createElement(\"div\");\n              gutterDiv.setAttribute(\"id\", \"code-annotation-line-highlight-gutter\");\n              gutterDiv.style.position = 'absolute';\n              const codeCell = window.document.getElementById(targetCell);\n              const gutter = codeCell.querySelector('.code-annotation-gutter');\n              gutter.appendChild(gutterDiv);\n            }\n            gutterDiv.style.top = top - 2 + \"px\";\n            gutterDiv.style.height = height + 4 + \"px\";\n          }\n          selectedAnnoteEl = annoteEl;\n        }\n      };\n      const unselectCodeLines = () =\u003e {\n        const elementsIds = [\"code-annotation-line-highlight\", \"code-annotation-line-highlight-gutter\"];\n        elementsIds.forEach((elId) =\u003e {\n          const div = window.document.getElementById(elId);\n          if (div) {\n            div.remove();\n          }\n        });\n        selectedAnnoteEl = undefined;\n      };\n      // Attach click handler to the DT\n      const annoteDls = window.document.querySelectorAll('dt[data-target-cell]');\n      for (const annoteDlNode of annoteDls) {\n        annoteDlNode.addEventListener('click', (event) =\u003e {\n          const clickedEl = event.target;\n          if (clickedEl !== selectedAnnoteEl) {\n            unselectCodeLines();\n            const activeEl = window.document.querySelector('dt[data-target-cell].code-annotation-active');\n            if (activeEl) {\n              activeEl.classList.remove('code-annotation-active');\n            }\n            selectCodeLines(clickedEl);\n            clickedEl.classList.add('code-annotation-active');\n          } else {\n            // Unselect the line\n            unselectCodeLines();\n            clickedEl.classList.remove('code-annotation-active');\n          }\n        });\n      }\n  const findCites = (el) =\u003e {\n    const parentEl = el.parentElement;\n    if (parentEl) {\n      const cites = parentEl.dataset.cites;\n      if (cites) {\n        return {\n          el,\n          cites: cites.split(' ')\n        };\n      } else {\n        return findCites(el.parentElement)\n      }\n    } else {\n      return undefined;\n    }\n  };\n  var bibliorefs = window.document.querySelectorAll('a[role=\"doc-biblioref\"]');\n  for (var i=0; i\u003cbibliorefs.length; i++) {\n    const ref = bibliorefs[i];\n    const citeInfo = findCites(ref);\n    if (citeInfo) {\n      tippyHover(citeInfo.el, function() {\n        var popup = window.document.createElement('div');\n        citeInfo.cites.forEach(function(cite) {\n          var citeDiv = window.document.createElement('div');\n          citeDiv.classList.add('hanging-indent');\n          citeDiv.classList.add('csl-entry');\n          var biblioDiv = window.document.getElementById('ref-' + cite);\n          if (biblioDiv) {\n            citeDiv.innerHTML = biblioDiv.innerHTML;\n          }\n          popup.appendChild(citeDiv);\n        });\n        return popup.innerHTML;\n      });\n    }\n  }\n});\n\u003c/script\u003e\n\u003c/div\u003e \u003c!-- /content --\u003e\n\n\n\n\u003c/body\u003e\u003c/html\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbusiness-science%2Fpytimetk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbusiness-science%2Fpytimetk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbusiness-science%2Fpytimetk/lists"}