<div align="center">
<img src="docs/logo-timetk.png" width="30%"/>
</div>
<div align="center">
<a href="https://github.com/business-science/pytimetk/actions">
<img alt="Github Actions" src="https://github.com/business-science/pytimetk/actions/workflows/timetk-checks.yaml/badge.svg"/>
</a>
<a href="https://pypi.python.org/pypi/pytimetk">
<img alt="PyPI Version" src="https://img.shields.io/pypi/v/pytimetk.svg"/>
</a>
<a href="https://business-science.github.io/pytimetk/contributing.html">
<img alt="PRs Welcome" src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg"/>
</a>
</div>
# pytimetk
> Time series easier, faster, more fun. Pytimetk.
[**Please β us on GitHub (it takes 2-seconds and means a lot).**](https://github.com/business-science/pytimetk)
# Introducing pytimetk: Simplifying Time Series Analysis for Everyone
Time series analysis is fundamental in many fields, from business forecasting to scientific research. While the Python ecosystem offers tools like `pandas`, they sometimes can be verbose and not optimized for all operations, especially for complex time-based aggregations and visualizations.
Enter **pytimetk**. Crafted with a blend of ease-of-use and computational efficiency, `pytimetk` significantly simplifies the process of time series manipulation and visualization. By leveraging the `polars` backend, you can experience speed improvements ranging from 3X to a whopping 3500X. Let's dive into a comparative analysis.
| Features/Properties | **pytimetk** | **pandas (+matplotlib)** |
|---------------------|-------------------------------|---------------------------------------|
| **Speed** | π 3X to 3500X Faster | π’ Standard |
| **Code Simplicity** | π Concise, readable syntax | π Often verbose |
| `plot_timeseries()` | π¨ 2 lines, no customization | π¨ 16 lines, customization needed |
| `summarize_by_time()` | π 2 lines, 13.4X faster | π 6 lines, 2 for-loops |
| `pad_by_time()` | β³ 2 lines, fills gaps in timeseries | β No equivalent |
| `anomalize()` | π 2 lines, detects and corrects anomalies | β No equivalent |
| `augment_timeseries_signature()` | π
1 line, all calendar features | π 29 lines of `dt` extractors |
| `augment_rolling()` | ποΈ 10X to 3500X faster | π’ Slow Rolling Operations |
As evident from the table, **pytimetk** is not just about speed; it also simplifies your codebase. For example, `summarize_by_time()`, converts a 6-line, double for-loop routine in `pandas` into a concise 2-line operation. And with the `polars` engine, get results 13.4X faster than `pandas`!
Similarly, `plot_timeseries()` dramatically streamlines the plotting process, encapsulating what would typically require 16 lines of `matplotlib` code into a mere 2-line command in **pytimetk**, without sacrificing customization or quality. And with `plotly` and `plotnine` engines, you can create interactive plots and beautiful static visualizations with just a few lines of code.
For calendar features, **pytimetk** offers `augment_timeseries_signature()` which cuts down on over 30 lines of `pandas` dt extractions. For rolling features, **pytimetk** offers `augment_rolling()`, which is 10X to 3500X faster than `pandas`. It also offers `pad_by_time()` to fill gaps in your time series data, and `anomalize()` to detect and correct anomalies in your time series data.
Join the revolution in time series analysis. Reduce your code complexity, increase your productivity, and harness the speed that **pytimetk** brings to your workflows.
Explore more at our [pytimetk homepage](https://business-science.github.io/pytimetk/).
# Installation
Install the latest stable version of `pytimetk` using `pip`:
```bash
pip install pytimetk
```
Alternatively you can install the development version:
```bash
pip install git+https://github.com/business-science/pytimetk.git
```
# Quickstart:
This is a simple code to test the function `summarize_by_time`:
```python
import pytimetk as tk
import pandas as pd
df = tk.datasets.load_dataset('bike_sales_sample')
df['order_date'] = pd.to_datetime(df['order_date'])
df \
.groupby("category_2") \
.summarize_by_time(
date_column='order_date',
value_column= 'total_price',
freq = "MS",
agg_func = ['mean', 'sum'],
engine = "polars"
)
```
# Documentation
Get started with the [pytimetk documentation](https://business-science.github.io/pytimetk/)
- [π Overview](https://business-science.github.io/pytimetk/)
- [π Getting Started](https://business-science.github.io/pytimetk/getting-started/02_quick_start.html)
- [πΊοΈ Beginner Guides](https://business-science.github.io/pytimetk/guides/01_visualization.html)
- [πApplied Data Science Tutorials with PyTimeTK](https://business-science.github.io/pytimetk/tutorials/01_sales_crm.html)
- [π API Reference](https://business-science.github.io/pytimetk/reference/)
# Developers (Contributors): Installation
To install `pytimetk` using [Poetry](https://python-poetry.org/), follow these steps:
### 1. Prerequisites
Make sure you have Python 3.9 or later installed on your system.
### 2. Install Poetry
To install Poetry, you can use the [official installer](https://python-poetry.org/docs/#installing-with-the-official-installer) provided by Poetry. Do not use pip.
### 3. Clone the Repository
Clone the `pytimetk` repository from GitHub:
```bash
git clone https://github.com/business-science/pytimetk
```
### 4. Install Dependencies
Use Poetry to install the package and its dependencies:
```bash
poetry install
```
or you can create a virtualenv with poetry and install the dependencies
```bash
poetry shell
poetry install
```
# π More Coming Soon...
We are in the early stages of development. But it's obvious the potential for `pytimetk` now in Python. π
- Please [β us on GitHub](https://github.com/business-science/pytimetk) (it takes 2-seconds and means a lot).
- To make requests, please see our [Project Roadmap GH Issue #2](https://github.com/business-science/pytimetk/issues/2). You can make requests there.
- Want to contribute? [See our contributing guide here.](/contributing.html)
Raw data
{
"_id": null,
"home_page": "https://business-science.github.io/pytimetk/",
"name": "pytimetk",
"maintainer": "Matt Dancho",
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "mdancho@business-science.io",
"keywords": "time series, forecasting, machine learning, data science",
"author": "Business Science",
"author_email": "info@business-science.io",
"download_url": "https://files.pythonhosted.org/packages/af/2f/e9b625f9237b3df53fb5b227ce5d6dc3b7830667b990b57cefdd73740965/pytimetk-1.0.1.tar.gz",
"platform": null,
"description": "<div align=\"center\">\n<img src=\"docs/logo-timetk.png\" width=\"30%\"/>\n</div>\n\n<div align=\"center\">\n <a href=\"https://github.com/business-science/pytimetk/actions\">\n <img alt=\"Github Actions\" src=\"https://github.com/business-science/pytimetk/actions/workflows/timetk-checks.yaml/badge.svg\"/>\n </a>\n <a href=\"https://pypi.python.org/pypi/pytimetk\">\n <img alt=\"PyPI Version\" src=\"https://img.shields.io/pypi/v/pytimetk.svg\"/>\n </a>\n <a href=\"https://business-science.github.io/pytimetk/contributing.html\">\n <img alt=\"PRs Welcome\" src=\"https://img.shields.io/badge/PRs-welcome-brightgreen.svg\"/>\n </a>\n</div>\n\n# pytimetk\n\n> Time series easier, faster, more fun. Pytimetk.\n\n[**Please \u2b50 us on GitHub (it takes 2-seconds and means a lot).**](https://github.com/business-science/pytimetk)\n\n# Introducing pytimetk: Simplifying Time Series Analysis for Everyone\n\nTime series analysis is fundamental in many fields, from business forecasting to scientific research. While the Python ecosystem offers tools like `pandas`, they sometimes can be verbose and not optimized for all operations, especially for complex time-based aggregations and visualizations.\n\nEnter **pytimetk**. Crafted with a blend of ease-of-use and computational efficiency, `pytimetk` significantly simplifies the process of time series manipulation and visualization. By leveraging the `polars` backend, you can experience speed improvements ranging from 3X to a whopping 3500X. Let's dive into a comparative analysis.\n\n| Features/Properties | **pytimetk** | **pandas (+matplotlib)** |\n|---------------------|-------------------------------|---------------------------------------|\n| **Speed** | \ud83d\ude80 3X to 3500X Faster | \ud83d\udc22 Standard |\n| **Code Simplicity** | \ud83c\udf89 Concise, readable syntax | \ud83d\udcdc Often verbose |\n| `plot_timeseries()` | \ud83c\udfa8 2 lines, no customization | \ud83c\udfa8 16 lines, customization needed |\n| `summarize_by_time()` | \ud83d\udd50 2 lines, 13.4X faster | \ud83d\udd50 6 lines, 2 for-loops |\n| `pad_by_time()` | \u26f3 2 lines, fills gaps in timeseries | \u274c No equivalent |\n| `anomalize()` | \ud83d\udcc8 2 lines, detects and corrects anomalies | \u274c No equivalent |\n| `augment_timeseries_signature()` | \ud83d\udcc5 1 line, all calendar features | \ud83d\udd50 29 lines of `dt` extractors |\n| `augment_rolling()` | \ud83c\udfce\ufe0f 10X to 3500X faster | \ud83d\udc22 Slow Rolling Operations |\n\nAs evident from the table, **pytimetk** is not just about speed; it also simplifies your codebase. For example, `summarize_by_time()`, converts a 6-line, double for-loop routine in `pandas` into a concise 2-line operation. And with the `polars` engine, get results 13.4X faster than `pandas`!\n \nSimilarly, `plot_timeseries()` dramatically streamlines the plotting process, encapsulating what would typically require 16 lines of `matplotlib` code into a mere 2-line command in **pytimetk**, without sacrificing customization or quality. And with `plotly` and `plotnine` engines, you can create interactive plots and beautiful static visualizations with just a few lines of code.\n\nFor calendar features, **pytimetk** offers `augment_timeseries_signature()` which cuts down on over 30 lines of `pandas` dt extractions. For rolling features, **pytimetk** offers `augment_rolling()`, which is 10X to 3500X faster than `pandas`. It also offers `pad_by_time()` to fill gaps in your time series data, and `anomalize()` to detect and correct anomalies in your time series data.\n\nJoin the revolution in time series analysis. Reduce your code complexity, increase your productivity, and harness the speed that **pytimetk** brings to your workflows.\n\nExplore more at our [pytimetk homepage](https://business-science.github.io/pytimetk/).\n\n# Installation\n\nInstall the latest stable version of `pytimetk` using `pip`:\n\n```bash\npip install pytimetk\n```\n\nAlternatively you can install the development version:\n\n```bash\npip install git+https://github.com/business-science/pytimetk.git\n```\n\n# Quickstart:\n\nThis is a simple code to test the function `summarize_by_time`:\n\n```python\nimport pytimetk as tk\nimport pandas as pd\n\ndf = tk.datasets.load_dataset('bike_sales_sample')\ndf['order_date'] = pd.to_datetime(df['order_date'])\n\ndf \\\n .groupby(\"category_2\") \\\n .summarize_by_time(\n date_column='order_date', \n value_column= 'total_price',\n freq = \"MS\",\n agg_func = ['mean', 'sum'],\n engine = \"polars\"\n )\n```\n\n# Documentation\n\nGet started with the [pytimetk documentation](https://business-science.github.io/pytimetk/)\n\n- [\ud83d\udcc8 Overview](https://business-science.github.io/pytimetk/)\n- [\ud83c\udfc1 Getting Started](https://business-science.github.io/pytimetk/getting-started/02_quick_start.html)\n- [\ud83d\uddfa\ufe0f Beginner Guides](https://business-science.github.io/pytimetk/guides/01_visualization.html)\n- [\ud83d\udcd8Applied Data Science Tutorials with PyTimeTK](https://business-science.github.io/pytimetk/tutorials/01_sales_crm.html)\n\n- [\ud83d\udcc4 API Reference](https://business-science.github.io/pytimetk/reference/)\n\n# Developers (Contributors): Installation\n\nTo install `pytimetk` using [Poetry](https://python-poetry.org/), follow these steps:\n\n### 1. Prerequisites\n\nMake sure you have Python 3.9 or later installed on your system.\n\n### 2. Install Poetry\n\nTo install Poetry, you can use the [official installer](https://python-poetry.org/docs/#installing-with-the-official-installer) provided by Poetry. Do not use pip.\n\n### 3. Clone the Repository\n\nClone the `pytimetk` repository from GitHub:\n\n```bash\ngit clone https://github.com/business-science/pytimetk\n```\n\n### 4. Install Dependencies\n\nUse Poetry to install the package and its dependencies:\n\n```bash\npoetry install\n```\n\nor you can create a virtualenv with poetry and install the dependencies\n\n```bash\npoetry shell\npoetry install\n```\n\n# \ud83c\udfc6 More Coming Soon...\n\nWe are in the early stages of development. But it's obvious the potential for `pytimetk` now in Python. \ud83d\udc0d\n\n- Please [\u2b50 us on GitHub](https://github.com/business-science/pytimetk) (it takes 2-seconds and means a lot). \n- To make requests, please see our [Project Roadmap GH Issue #2](https://github.com/business-science/pytimetk/issues/2). You can make requests there. \n- Want to contribute? [See our contributing guide here.](/contributing.html) \n",
"bugtrack_url": null,
"license": "LICENSE",
"summary": "The time series toolkit for Python.",
"version": "1.0.1",
"project_urls": {
"Documentation": "https://business-science.github.io/pytimetk/reference/",
"Homepage": "https://business-science.github.io/pytimetk/",
"Repository": "https://github.com/business-science/pytimetk"
},
"split_keywords": [
"time series",
" forecasting",
" machine learning",
" data science"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a9d0fe48044b22ef418568bc8758e8d74467b40b9c2e2099eac1438e5b6b4426",
"md5": "ea4f3ecc81a2abbc00a0d31b4dd9e7d5",
"sha256": "b33cd4a81cd6713e15db4211e8cb269d3f2b64f036e82aba9ce72e2c93f19eba"
},
"downloads": -1,
"filename": "pytimetk-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ea4f3ecc81a2abbc00a0d31b4dd9e7d5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 4286508,
"upload_time": "2024-07-30T13:29:23",
"upload_time_iso_8601": "2024-07-30T13:29:23.130332Z",
"url": "https://files.pythonhosted.org/packages/a9/d0/fe48044b22ef418568bc8758e8d74467b40b9c2e2099eac1438e5b6b4426/pytimetk-1.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "af2fe9b625f9237b3df53fb5b227ce5d6dc3b7830667b990b57cefdd73740965",
"md5": "6c08cafccc5672b11ffe2a39d0878a93",
"sha256": "b77443c638a2a785305f180cf3ab8cc225c9aaab04936fb6d2dd48f5026ce409"
},
"downloads": -1,
"filename": "pytimetk-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "6c08cafccc5672b11ffe2a39d0878a93",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 4290624,
"upload_time": "2024-07-30T13:29:26",
"upload_time_iso_8601": "2024-07-30T13:29:26.659509Z",
"url": "https://files.pythonhosted.org/packages/af/2f/e9b625f9237b3df53fb5b227ce5d6dc3b7830667b990b57cefdd73740965/pytimetk-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-30 13:29:26",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "business-science",
"github_project": "pytimetk",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pytimetk"
}