Skip to main content

pytde

A Python parser for legacy Tableau Data Extract (TDE) files.

Overview

pytde reads TDE files (the legacy Tableau data format used before Hyper) and converts them to pandas DataFrames. This is useful for accessing data from older Tableau extracts without needing Tableau Desktop or Server.

Installation

pip install pytde

Or install from source:

git clone https://github.com/ronreiter/pytde.git
cd pytde
pip install -e .

Quick Start

from pytde import read_tde

# Read a TDE file
tables = read_tde('data.tde')

# Get the Extract table as a DataFrame
df = tables['Extract']

# Work with the data
print(df.head())
print(df.describe())

API Reference

read_tde(file_path: str) -> dict[str, pd.DataFrame]

Read a TDE file and return its contents as pandas DataFrames.

from pytde import read_tde

tables = read_tde('sales_data.tde')
df = tables['Extract']

read_tde_metadata(file_path: str) -> dict

Read TDE file metadata without fully parsing the data.

from pytde import read_tde_metadata

metadata = read_tde_metadata('sales_data.tde')
print(metadata['columns'])       # List of column names
print(metadata['column_types'])  # Column data types
print(metadata['file_size'])     # File size in bytes
print(metadata['format_version']) # TDE format version

TDEParser class

For more control over parsing, use the TDEParser class directly:

from pytde import TDEParser

parser = TDEParser('data.tde')
tables = parser.parse()
metadata = parser.get_metadata()

# Access internal state
print(parser.xml_metadata)  # Embedded XML schema
print(parser.column_entries)  # Column index entries

Command Line Interface

pytde includes a CLI tool for quick inspection of TDE files:

pytde data.tde

Output:

Parsing TDE file: data.tde
------------------------------------------------------------
Format version: 2
File size: 51306 bytes
Columns found: ['Region', 'Sales', 'Sales Person']
Column types: {'Region': 'string', 'Sales': 'double', 'Sales Person': 'string'}

============================================================
Table: Extract
Shape: (43, 3)
Columns: ['Region', 'Sales', 'Sales Person']
...

Supported Data Types

TDE Type Python/Pandas Type
string object (str)
double float64
integer int64
date object*
datetime object*
boolean bool

*Date/datetime support is limited in the current version.

TDE File Format

TDE files are binary files that store columnar data optimized for Tableau's data engine. Key features:

  • Little-endian byte ordering
  • Block-based structure with markers (f0ca1278 for data, f1ca1278 for index)
  • Dictionary encoding for string columns
  • Embedded XML metadata for schema definitions

For detailed format specification, see TDE.MD.

Limitations

  • Index decoding: String column row-to-value mapping uses fallback distribution when exact indices cannot be decoded
  • Date/time columns: Limited support for date and datetime types
  • Compression: Some compressed TDE files may not be fully supported
  • Large files: Memory usage scales with file size (entire file is loaded into memory)

Development

Setup

git clone https://github.com/ronreiter/pytde.git
cd pytde
pip install -e ".[dev]"

Running Tests

pytest

Running Tests with Coverage

pytest --cov=pytde --cov-report=html

License

MIT License - see LICENSE for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Acknowledgments

This parser was developed through reverse engineering of the TDE file format. Special thanks to the open source community for their work on understanding proprietary file formats.

Metadata

Release files for pytde 0.1.2

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

Source distribution (sdist)

Source distribution for pytde 0.1.2
File Size Uploaded Provenance
pytde-0.1.2.tar.gz 14.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pytde 0.1.2
File Interpreter ABI Platform
pytde-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 25.8 kB

Release files / pytde-0.1.2.tar.gz

Download URL pytde-0.1.2.tar.gz
Size 14.8 kB
Tags Source
SHA-256 checksum
How to use checksums
cffd99934939c6687b5abe941d6b435596129e2860a170d76df0bcbb4bdc1745
BLAKE2b-256 checksum
How to use checksums
8dc573cd8d27cca40a6912f122086a415b690777135345ca2a2f5569060165f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.8

Release files / pytde-0.1.2-py3-none-any.whl

Download URL pytde-0.1.2-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ce23851bea13b48fe930d76758fe707b89370653c2ce333a30728eeec26713ae
BLAKE2b-256 checksum
How to use checksums
409d18b4281159a8627425145e8ebcf0d005edba8410cfd64333339d3697aabe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.8

Security for pytde 0.1.2

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.

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