Skip to main content

ptar-index

Python interface for parallel-tar index files (.etr and .idx).

Load binary index files generated by parallel-idx and work with them using native Python data types — dataclasses, iterators, dicts, and optional pandas DataFrames.

Installation

uv sync

With pandas support:

uv sync --extra pandas

Quick start

from ptar_index import load_index

idx = load_index("example.idx")
print(idx)
# <PtarIndex [IDX] '/global/projects/data'  4821995 files, 417285 dirs, 1.65 TB>

# Browse the tree
idx.root.print_tree(max_depth=2)

# Navigate like a dict
lcls = idx.root["LCLS"]
psdm = idx.resolve("LCLS/sit_psdm_data/psdm")

# Iterate all files
for f in idx.walk_files():
    print(f.path, f.human_size, f.hash_hex)

# Glob search
for f in idx.glob("**/*.tar"):
    print(f.path, f.size)

# Export to pandas DataFrame
df = idx.to_dataframe()

# Compare two indexes
old = load_index("before.idx")
new = load_index("after.idx")
diff = old.diff(new)
print(diff.summary())  # "42 added, 3 removed, 17 changed"

CLI

The package installs a ptar-index command:

# Summary + tree view
ptar-index example.idx

# Inspect raw msgpack structure (for debugging)
ptar-index example.idx --raw

# List all file entries
ptar-index example.idx --files

# Filter by glob pattern
ptar-index example.idx --glob "**/*.tar"

# Full JSON export
ptar-index example.idx --json

Debugging format issues

If the auto-detection doesn't map fields correctly, dump the raw MessagePack structure first:

from ptar_index import describe_raw
print(describe_raw("example.idx", max_depth=3))

This shows the exact field names and types as stored in the binary file, making it straightforward to adjust the parser.

License

MIT

Metadata

Release files for ptar-index 1.0.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 ptar-index 1.0.0
File Size Uploaded Provenance Actions
ptar_index-1.0.0.tar.gz 56.4 kB With provenance Details for ptar_index-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ptar-index 1.0.0
File Interpreter ABI Platform Actions
ptar_index-1.0.0-py3-none-any.whl Python 3 none any Details for ptar_index-1.0.0-py3-none-any.whl

Total release size: 69.7 kB

Release files / ptar_index-1.0.0.tar.gz

Download URL ptar_index-1.0.0.tar.gz
Size 56.4 kB
Tags Source
SHA-256 checksum
How to use checksums
543bb7259b7ebfc074abb6c7d3647475a5fb29573e43383031d1691d60be80d0
BLAKE2b-256 checksum
How to use checksums
273583826fa2a9fadb33b3c820e4cd900293c6857b37ea6f97e222cee67a73ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 30, 2026.

Transparency log

Release files / ptar_index-1.0.0-py3-none-any.whl

Download URL ptar_index-1.0.0-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f4aea2fa603c9a8fcdf177c0c2b43543ccd4b4236de742d9436c81b7f997713d
BLAKE2b-256 checksum
How to use checksums
b003d821c8600dcc2e0f997c46831e9e3245867a0fbf8b2e433acc8126f0595b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 30, 2026.

Transparency log

Security for ptar-index 1.0.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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ptar_index-1.0.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 Mar 30, 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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files Full 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