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:

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.1.1

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.1.1
File Size Uploaded Provenance Actions
tstokenizers-0.1.1.tar.gz 12.6 kB With provenance Details for tstokenizers-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 27.2 kB

Release files / tstokenizers-0.1.1.tar.gz

Download URL tstokenizers-0.1.1.tar.gz
Size 12.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6eb6ef32eefbbbf3c77f49d5b1cc4b2e776292c7e95dc91ba5a1e19e7543e080
BLAKE2b-256 checksum
How to use checksums
db971ca20d9ab6812e16efba57d8627f67527a45893da643f486c2cd96e9116b
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 10, 2026.

Transparency log

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

Download URL tstokenizers-0.1.1-py2.py3-none-any.whl
Size 14.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
cd1126e1ef4822b1a93ef0fa12bfbf45e57159c459d8ea35f368f12ddbecae97
BLAKE2b-256 checksum
How to use checksums
4b7bfb75beb98a0d3ab7b8d2b574015bada604c0e09bd670c26db55013d1cf4b
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 10, 2026.

Transparency log

Security for tstokenizers 0.1.1

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.1.1.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 10, 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