Skip to main content

Temporian is a Python package for feature engineering of temporal data, focusing on preventing common modeling errors and providing a simple and powerful API, a first-class iterative development experience, and efficient and well-tested implementations of common and not-so-common temporal data preprocessing functions.

Project description

Temporian logo

pypi docs tests formatting publish

Temporian is a Python library for feature engineering 🛠 and data augmentation ⚡ of temporal data 📈 (e.g. time-series, transactions) in machine learning applications 🤖.

Warning Temporian development is in alpha.

Key features

  • Temporian operates natively on multivariate and multi-index time-series and time-sequences data. With Temporian, all temporal data processing is unified.

  • Temporian favors iterative and interactive development in Colab, where users can easily visualize intermediate results 📊 each step of the way.

  • Temporian introduces a novel mechanism to prevent unwanted future leakage and training/serving skew 😰. Temporian programs always return the same result in batch and in streaming mode.

  • Temporian programs can run seamlessly in-process in Python, on large datasets using Apache Beam ☁️, and in streaming for continuous data ingestion.

  • Temporian's core is implemented in C++ and highly optimized 🔥, so large amounts of data can be handled in-process. In some cases, Temporian can provide a speed-up in the order of 1000x compared to other libraries.

Installation

Temporian is available on PyPI. To install it, run:

pip install temporian

Minimal example

Consider the following dataset.

$ head sales.csv
timestamp,store,price,count
2022-01-01 00:00:00+00:00,CA,27.42,61.9
2022-01-01 00:00:00+00:00,TX,98.55,18.02
2022-01-02 00:00:00+00:00,CA,32.74,14.93
2022-01-02 00:00:00+00:00,TX,48.69,83.99
...

We compute the weekly sales per store as follows.

import temporian as tp

input_data = tp.from_csv("sales.csv")

# Define a Temporian program
input_node = input_data.node()
per_store = tp.set_index(input_node, "store")
weekly_sum = tp.moving_sum(per_store["price"], window_length=tp.duration.days(7))

# Execute Temporian program
output_data = weekly_sum.run({input_node: input_data})

# Plot the result
output_data.plot()

Check the Getting Started tutorial to try it out!

Documentation

The documentation 📚 is available at temporian.readthedocs.io. The 3 minutes to Temporian ⏰️ is the best way to start.

Contributing

Contributions to Temporian are welcome! Check out the contributing guide to get started.

Credits

Temporian is developed in collaboration between Google and Tryolabs.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

temporian-0.1.2.tar.gz (165.6 kB view hashes)

Uploaded Source

Built Distributions

temporian-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (496.8 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

temporian-0.1.2-cp311-cp311-macosx_13_0_arm64.whl (436.9 kB view hashes)

Uploaded CPython 3.11 macOS 13.0+ ARM64

temporian-0.1.2-cp311-cp311-macosx_12_0_x86_64.whl (450.7 kB view hashes)

Uploaded CPython 3.11 macOS 12.0+ x86-64

temporian-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (496.3 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

temporian-0.1.2-cp310-cp310-macosx_13_0_arm64.whl (447.8 kB view hashes)

Uploaded CPython 3.10 macOS 13.0+ ARM64

temporian-0.1.2-cp310-cp310-macosx_12_0_x86_64.whl (449.2 kB view hashes)

Uploaded CPython 3.10 macOS 12.0+ x86-64

temporian-0.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (497.2 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

temporian-0.1.2-cp39-cp39-macosx_13_0_arm64.whl (435.7 kB view hashes)

Uploaded CPython 3.9 macOS 13.0+ ARM64

temporian-0.1.2-cp39-cp39-macosx_12_0_x86_64.whl (449.3 kB view hashes)

Uploaded CPython 3.9 macOS 12.0+ x86-64

temporian-0.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (495.5 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

temporian-0.1.2-cp38-cp38-macosx_13_0_arm64.whl (432.4 kB view hashes)

Uploaded CPython 3.8 macOS 13.0+ ARM64

temporian-0.1.2-cp38-cp38-macosx_12_0_x86_64.whl (449.2 kB view hashes)

Uploaded CPython 3.8 macOS 12.0+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page