Skip to main content

tstokenizers

Time series tokenizer for autoregressive modeling. Converts multivariate time series into text, then trains a BPE tokenizer on it. Based on the FAST method by Physical Intelligence.

Installation

pip install tstokenizers

Usage

Serialize a DataFrame into text. Its row count must be a multiple of patch_len.

from tstokenizers import Serializer
import numpy as np
import pandas as pd

df = pd.DataFrame({
    'sin': np.sin(np.linspace(0, 10, 128)),
    'cos': np.cos(np.linspace(0, 10, 128)),
})
quantiles = df.quantile([0.01, 0.99])

serializer = Serializer(quantiles, patch_len=8, quant_scale=100)
text = serializer.encode(df)
df_decoded = serializer.decode(text)
patch_text_len = serializer.patch_text_len()

Train a BPE tokenizer on a Hugging Face dataset with a text column, where each entry is the text of one patch:

tstokenizers-train --dataset-path=path --output-path=path --vocab-size=1024

Encode text into token ids:

from transformers import AutoTokenizer
from tstokenizers import Processor

processor = Processor(AutoTokenizer.from_pretrained(path))
token_ids = processor.encode(text, patch_text_len)

Citation

This package applies the FAST approach to time series:

Pertsch et al., "FAST: Efficient Action Tokenization for Vision-Language-Action Models", 2025. https://arxiv.org/abs/2501.09747

License

Apache 2.0

Metadata

Release files for tstokenizers 0.2.0

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

Source distribution (sdist)

Source distribution for tstokenizers 0.2.0
File Size Uploaded Provenance Actions
tstokenizers-0.2.0.tar.gz 9.2 kB With provenance Details for tstokenizers-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tstokenizers 0.2.0
File Interpreter ABI Platform Actions
tstokenizers-0.2.0-py2.py3-none-any.whl Python 3, Python 2 none any Details for tstokenizers-0.2.0-py2.py3-none-any.whl

Total release size: 18.5 kB

Release files / tstokenizers-0.2.0.tar.gz

Download URL tstokenizers-0.2.0.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
028c754d505b7919e278f6efa7392984c2c4e82185c038a7f9d927efb5c90e70
BLAKE2b-256 checksum
How to use checksums
8ec1b7a2f700324467189c477f4aadd16542e7fe489abe6b3fd50a33bfe7a4ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / tstokenizers-0.2.0-py2.py3-none-any.whl

Download URL tstokenizers-0.2.0-py2.py3-none-any.whl
Size 9.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
e28d4ee474e361cb0c184e48e7ff7b419302bacfbc86595ee9b7e073bfd544da
BLAKE2b-256 checksum
How to use checksums
ec64549f09af4718af091dfcc7fa2475c28505c0612a53259bd290710fbd55cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Security for tstokenizers 0.2.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tstokenizers-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

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.

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