Skip to main content

Teapy

Build PyPI codecov

Blazingly fast datadict library in Python

Teapy is a high-performance data dictionary library implemented in Rust, designed for blazingly fast operations. It offers the following features:

  • Lazy evaluation
  • Handling of NaN values
  • Multi-threaded processing
  • Support for any dimensionality

Setup

Install the latest teapy version with: pip install teapy

Basic Usage

Creating Expressions

# Expressions can be created in various ways
import numpy as np
import pandas as pd
import polars as pl
import teapy as tp

e1 = tp.Expr([1, 2, 3])  # Create from list
e2 = tp.Expr((1, 2, 3))  # Create from tuple
e3 = tp.Expr(np.array([1, 2, 3]), 'e3')  # Create from numpy.ndarray, name is e3
e4 = tp.Expr(pd.Series([1, 2, 3]))  # Create from pandas.Series
e5 = tp.Expr(pl.Series([1, 2, 3]))  # Create from polars.Series

Creating DataDicts

# DataDicts can be created in different ways
dd1 = tp.DataDict({'a': [1, 2], 'b': [2, 3]}, c=[3, 4])  # Create from dictionary
dd2 = tp.DataDict([tp.Expr([1, 2], 'a'), tp.Expr([2, 3], 'b')])  # Create from list of expressions
dd3 = tp.DataDict(a=[1, 2], b=[2, 3], c=np.array([3, 6, 2]))  # Create by specifying key-value pairs

Evaluating Expressions and DataDicts

# Evaluating Expressions
e = tp.Expr([1, 2, 3]).mean()
e.eval()  # Execute the expression
e.view  # View the memory of the array
e.eview()  # Execute the expression and view the memory of the array
e.value()  # Execute the expression and copy the memory of the array to a new numpy.ndarray

# Evaluating DataDicts
dd = tp.DataDict({'a': [1, 2]*10, 'b': [2, 3]*10}, c=[3, 4])
dd = dd.select([
    dd['a'].ts_mean(3).alias('d'), 
    dd['b'].ts_std(4).alias('e')
])
dd.eval(['d', 'e'])  # Evaluate specific keys in parallel
dd.eval()  # Or evaluate all expressions in parallel
print(dd['d'])

Metadata

Release files for teapy 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for teapy 0.9.0
File Interpreter ABI Platform Actions
teapy-0.9.0-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details for teapy-0.9.0-cp38-abi3-win_amd64.whl
teapy-0.9.0-cp38-abi3-manylinux_2_34_x86_64.whl CPython 3.8 abi3 Linux glibc 2.34+ x86-64 Details for teapy-0.9.0-cp38-abi3-manylinux_2_34_x86_64.whl
teapy-0.9.0-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details for teapy-0.9.0-cp38-abi3-macosx_11_0_arm64.whl

Total release size: 38.3 MB

Release files / teapy-0.9.0-cp38-abi3-win_amd64.whl

Download URL teapy-0.9.0-cp38-abi3-win_amd64.whl
Size 13.2 MB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
3b64c1b273c3eed9506c9ba2fd6041ba81d8e2c1ede5d380437f90ab30679296
BLAKE2b-256 checksum
How to use checksums
d0059b8a0edd9e502bde4f63c6d25e63b9f1f8bb0b334608cd0cc1a94951e9a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.9.2

Release files / teapy-0.9.0-cp38-abi3-manylinux_2_34_x86_64.whl

Download URL teapy-0.9.0-cp38-abi3-manylinux_2_34_x86_64.whl
Size 15.9 MB
Tags CPython 3.8 Linux glibc 2.34+ x86-64 abi3
SHA-256 checksum
How to use checksums
95bbc3bb3f3d2cca07d09fd45219f74bb684fcdebfb0b37a1f24e51049a51867
BLAKE2b-256 checksum
How to use checksums
1bca6318eef10fe763a4ec22211f76381dc39029abe82273fb80773b8a5f3dd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.9.2

Release files / teapy-0.9.0-cp38-abi3-macosx_11_0_arm64.whl

Download URL teapy-0.9.0-cp38-abi3-macosx_11_0_arm64.whl
Size 9.1 MB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
8a408c5b502a0d51d8f9ed2b69ab3bcf58da791e5ad5da9fb495feabc199b23c
BLAKE2b-256 checksum
How to use checksums
6ad77c3640ee91af055f139cf5bb202a417b419dcb52f41cfd155c1826c8425d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.9.2

Security for teapy 0.9.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.9.0 This release

3 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page