pytimetk


Namepytimetk JSON
Version 0.4.0 PyPI version JSON
download
home_pagehttps://business-science.github.io/pytimetk/
SummaryThe time series toolkit for Python.
upload_time2024-03-18 16:02:14
maintainerMatt Dancho
docs_urlNone
authorBusiness Science
requires_python>=3.9
licenseLICENSE
keywords time series forecasting machine learning data science
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <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']
    )
```

# 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/c5/82/d6065b9c4e82bbacb082c6eb218785d4b1f3e6fc7b16534767e6ebcda952/pytimetk-0.4.0.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    )\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) ",
    "bugtrack_url": null,
    "license": "LICENSE",
    "summary": "The time series toolkit for Python.",
    "version": "0.4.0",
    "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": "3ce761f10c12d2eac6f7697fca3bc57930992853191ff299a6d65cd5812f12a1",
                "md5": "428ed211040c431d73f9355c1b03584e",
                "sha256": "09556190f969448ec3903ac82b01e8c335abd731f28b37b41dcc8c44a45db25a"
            },
            "downloads": -1,
            "filename": "pytimetk-0.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "428ed211040c431d73f9355c1b03584e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 4284520,
            "upload_time": "2024-03-18T16:02:11",
            "upload_time_iso_8601": "2024-03-18T16:02:11.167562Z",
            "url": "https://files.pythonhosted.org/packages/3c/e7/61f10c12d2eac6f7697fca3bc57930992853191ff299a6d65cd5812f12a1/pytimetk-0.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c582d6065b9c4e82bbacb082c6eb218785d4b1f3e6fc7b16534767e6ebcda952",
                "md5": "3fa6b5dc0b72c4609a582f7c903b4076",
                "sha256": "c4aaa3cff6aa0f64e9248b8925fbbfa4877d115cca09f6ee0b438137384b203a"
            },
            "downloads": -1,
            "filename": "pytimetk-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "3fa6b5dc0b72c4609a582f7c903b4076",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 4122715,
            "upload_time": "2024-03-18T16:02:14",
            "upload_time_iso_8601": "2024-03-18T16:02:14.931869Z",
            "url": "https://files.pythonhosted.org/packages/c5/82/d6065b9c4e82bbacb082c6eb218785d4b1f3e6fc7b16534767e6ebcda952/pytimetk-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-18 16:02:14",
    "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"
}
        
Elapsed time: 0.21112s