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 library for safe, simple and efficient preprocessing and feature engineering of temporal data in Python. Temporian supports multivariate time-series, multivariate time-sequences, event logs, and cross-source event streams.

Temporian is to temporal data what Pandas is to tabular data.

Key features

  • Supports most types of temporal data 📈: Handles both uniformly sampled and non-uniformly sampled data, both single-variate and multivariate data, both flat and multi-index data, and both mono-source and multi-source non-synchronized events.

  • Optimized for Temporal data 🔥: Temporian's core computation is implemented in C++ and optimized for temporal data. Temporian can be more than 1,000x faster than off-the-shelf data processing libraries when operating on temporal data.

  • Easy to integrate into an existing ML ecosystem: Temporian does not perform any ML model training - instead it integrates seamlessly with any ML library, such as PyTorch, Scikit-Learn, Jax, TensorFlow, XGBoost, or Yggdrasil Decision Forests.

  • Prevents unwanted future leakage 😰: Unless explicitly specified with tp.leak, feature computation cannot depend on future data, thereby preventing unwanted, hard-to-debug, and potentially costly future leakage.

QuickStart

Installation

Install Temporian from PyPI with pip:

pip install temporian -U

Minimal example

Consider sale records that contain contain the timestamp, store, and revenue of individual sales.

$ cat sales.csv
timestamp,store,revenue
2023-12-04 21:21:05,STORE_31,5071
2023-11-08 17:14:38,STORE_4,1571
2023-11-29 21:44:46,STORE_49,6101
2023-12-20 18:17:14,STORE_18,4499
2023-12-15 10:55:09,STORE_2,6666
...

Our goal is to compute the sum of revenue for each store at 11 pm every weekday (excluding weekends).

First, we load the data and list the workdays.

import temporian as tp

# Load sale transactions
sales = tp.from_csv("sales.csv")

# Index sales per store
sales_per_store = sales.add_index("store")

# List work days
days = sales_per_store.tick_calendar(hour=22)
work_days = (days.calendar_day_of_week() <= 5).filter()

work_days.plot(max_num_plots=1)

Then, we sum the daily revenue for each workday and each store.

# Aggregate revenue per store and per work day
daily_revenue = sales_per_store["revenue"].moving_sum(tp.duration.days(1), sampling=work_days).rename("daily_revenue")

# Plot the results
daily_revenue.plot(max_num_plots=3)

Finally, we can export the result as a Pandas DataFrame for further processing or for consumption by other libraries.

tp.to_pandas(daily_revenue)

Check the Getting Started tutorial to find out more!

Next steps

New users should refer to the Getting Started guide, which provides a quick overview of the key concepts and operations of Temporian.

After that, visit the User Guide for a deep dive into the major concepts, operators, conventions, and practices of Temporian. For a hands-on learning experience, work through the Tutorials or refer to the API reference.

Documentation

The documentation 📚 is available at temporian.readthedocs.io. The Getting Started guide 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.6.tar.gz (225.1 kB view details)

Uploaded Source

Built Distributions

temporian-0.1.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (630.5 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

temporian-0.1.6-cp311-cp311-macosx_14_0_arm64.whl (570.6 kB view details)

Uploaded CPython 3.11 macOS 14.0+ ARM64

temporian-0.1.6-cp311-cp311-macosx_12_0_x86_64.whl (586.5 kB view details)

Uploaded CPython 3.11 macOS 12.0+ x86-64

temporian-0.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (630.7 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

temporian-0.1.6-cp310-cp310-macosx_14_0_arm64.whl (569.4 kB view details)

Uploaded CPython 3.10 macOS 14.0+ ARM64

temporian-0.1.6-cp310-cp310-macosx_12_0_x86_64.whl (585.1 kB view details)

Uploaded CPython 3.10 macOS 12.0+ x86-64

temporian-0.1.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (631.9 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

temporian-0.1.6-cp39-cp39-macosx_14_0_arm64.whl (569.6 kB view details)

Uploaded CPython 3.9 macOS 14.0+ ARM64

temporian-0.1.6-cp39-cp39-macosx_12_0_x86_64.whl (585.3 kB view details)

Uploaded CPython 3.9 macOS 12.0+ x86-64

temporian-0.1.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (629.3 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

temporian-0.1.6-cp38-cp38-macosx_14_0_arm64.whl (569.3 kB view details)

Uploaded CPython 3.8 macOS 14.0+ ARM64

temporian-0.1.6-cp38-cp38-macosx_12_0_x86_64.whl (585.0 kB view details)

Uploaded CPython 3.8 macOS 12.0+ x86-64

File details

Details for the file temporian-0.1.6.tar.gz.

File metadata

  • Download URL: temporian-0.1.6.tar.gz
  • Upload date:
  • Size: 225.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/6.2.0-1016-azure

File hashes

Hashes for temporian-0.1.6.tar.gz
Algorithm Hash digest
SHA256 504de0bdd9288f6a9197b856401f4e686a095d0220cbaf6a95ce488675de2b35
MD5 4ec3c96e9ee73198f45aebf7c777c597
BLAKE2b-256 724061a8afa718257f014bd13125d49dd898bd96958516050ff2f62cbc5e8fa2

See more details on using hashes here.

File details

Details for the file temporian-0.1.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for temporian-0.1.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 30e3935cd106220faf5654d7cedb8e8a6dedd28055d77cffc3bafbde230f04fa
MD5 b8aa6c173ec72af98d84cb9efece1b9a
BLAKE2b-256 51afd1bdeb4eda613bba7d34cdf9b8ee418cbbef08a61fa5f78482b8a9ca5a74

See more details on using hashes here.

File details

Details for the file temporian-0.1.6-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for temporian-0.1.6-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 3b06be07d623e0677527fc7015ea86e03b785a4d6f15093e81c53a45142f205c
MD5 01d6672e94b9c15585bda3b7264b5a89
BLAKE2b-256 8cde11ebb49ec451e97aeda7efb968b52bd682dfd150c94825a1b456e8168563

See more details on using hashes here.

File details

Details for the file temporian-0.1.6-cp311-cp311-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for temporian-0.1.6-cp311-cp311-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 68bfe039ca6dbf1b85cbc1edfa0ff0b3b31707b82748dd0b5b1138fd8b3ef2d5
MD5 15db5f1ba0cb78027d2a6218c0430347
BLAKE2b-256 7f69d56a35d8589d092203dea80f5e62fd7e50d12008481dbf0c10fab1c1c3e2

See more details on using hashes here.

File details

Details for the file temporian-0.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for temporian-0.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d67e06d73722740347be290f031fc0ab7175a6b26fa1e391f9016ea2c42d451c
MD5 d4468e89a2c8ac7fec787b45f759faf0
BLAKE2b-256 93e1036875e19e261ef8a9ff61e4000c9125ab9dfffad3b32bba6caf922e571f

See more details on using hashes here.

File details

Details for the file temporian-0.1.6-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for temporian-0.1.6-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 a8819f110ba9e7f461e34ed85d60856f23a865c7dd48207bff6223d45d49e19d
MD5 cd30e6fb33a88637c1a7d9b447988b08
BLAKE2b-256 b8745dbe76255e5f752a86f01b362a349742aac1492ba6bf4911d2d9d90b7cdc

See more details on using hashes here.

File details

Details for the file temporian-0.1.6-cp310-cp310-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for temporian-0.1.6-cp310-cp310-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 a2bb96e64580b1af6e8c9d0a4392078267df2088a2b419e58f2b4b3931f48a4a
MD5 2a8b08db86b5c896f9ba14be893c3e4a
BLAKE2b-256 5c55a5cb9275d927883e04c1b21e08163223e1be57126c3425b4dee32689ea9b

See more details on using hashes here.

File details

Details for the file temporian-0.1.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for temporian-0.1.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a520887b165b5a46b40a55dd1ddcd4cc779a22d14b00c4d6feeddae29421211a
MD5 784ce289a9007f57e2f49a0949c69a39
BLAKE2b-256 a39a9418219d9ac71dfdfbcd53686072a128e23fc11d808844494265773f840b

See more details on using hashes here.

File details

Details for the file temporian-0.1.6-cp39-cp39-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for temporian-0.1.6-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 c8cd3bcbd8baff24c84575e566285df527de6fb2aba14d2d3dfc24c363b13c5f
MD5 c91c27787a80ac82a8a9d2b2f8ade3f1
BLAKE2b-256 1763eb1c75e30c2a278c028a6e9a50817d15fd51779987e38a4bfcc0cccc163d

See more details on using hashes here.

File details

Details for the file temporian-0.1.6-cp39-cp39-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for temporian-0.1.6-cp39-cp39-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 f6e1fcfd40e92d0f4278ea15c2db45f4f0fa8fdfb12ae8255c161c8623fd57a9
MD5 3576df5dbb1c325cd13743723bb3dea5
BLAKE2b-256 18e015d6180b0bceb21f7d180ca81c0806a84ab9e4ee52bee89ad5df910d9d58

See more details on using hashes here.

File details

Details for the file temporian-0.1.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for temporian-0.1.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3cab0dcfb9ebacf8229d44a8e0939150014a3854747c36c1e7d6ec2d05665f46
MD5 ceaf9ad8cad3e9d095b6755391c0af9a
BLAKE2b-256 219247eeee8c5cecd40bcdcef265cb384588785a08459723db9f05a9b48cd185

See more details on using hashes here.

File details

Details for the file temporian-0.1.6-cp38-cp38-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for temporian-0.1.6-cp38-cp38-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 9e7904a3e79b2435b3dca74a8af9605448455769fc4acc924d39c1780dd61b69
MD5 8ce2c142487565c5f0d062536a588292
BLAKE2b-256 4ed51eecd364dbe2520fea6f6d9a77a8e9cc5738f13e47996bae6894f851cc91

See more details on using hashes here.

File details

Details for the file temporian-0.1.6-cp38-cp38-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for temporian-0.1.6-cp38-cp38-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 3fd17eb72b10c76abd25058d0e54576c2a91a64839977022a11ad7733c9a0357
MD5 abaec657991d72579ec3bcce222d3267
BLAKE2b-256 559547eb5f24cd6b658ba2818ee51633689af276719359f1744681ead1898d94

See more details on using hashes here.

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