Skip to main content

Inspect complex data files and nested Python objects with readable summaries.

Project description

PyDataPeekr

PyDataPeekr is a Python tool for inspecting nested data files and complex in-memory objects with readable tree and Markdown output. It helps you debug data structure types directly in the terminal, and it also gives agents a fast way to inspect the contents and schema of otherwise hard-to-read or invisible data files.

Full API guide

README(中文版) API (中文版)

Supported File Extensions

*.pkl *.pickle *.parquet *.json *.jsonl *.csv *.tsv *.yaml *.yml *.npy *.npz

Installation

Stable release from PyPI:

pip install pydatapeekr
# or
uv pip install pydatapeekr

Latest version from the repository (beta, may be unstable):

pip install "git+https://github.com/slkhms777/pydatapeekr.git"
# or
uv pip install "git+https://github.com/slkhms777/pydatapeekr.git"

CLI Usage

Quick Start:

peek your_file_path

API Usage

import pydatapeekr as peekr

# Get rendered text from a file or Python object.
file_text = peekr.inspect_file("data.parquet")
obj_text = peekr.inspect_obj(
    {"user": {"id": 1}, "items": [1, 2, 3]},  # or any Python object
    format="markdown",
)

print(file_text)
print(obj_text)

# Print directly with a terminal-friendly wrapper.
peekr.display_file("data.parquet")  # default style="-"
peekr.display_obj(
    your_object,
    style="#",
)

For the full API reference and more examples, see docs/api.md.

Examples

Case 1: Inspect an In-Memory Object

import pydatapeekr as peekr

# Suppose `raw_image_data` is an intermediate DataFrame variable.
peekr.display_obj(raw_image_data, style="-")

Terminal output:

------------- PEEKR INFO -------------
root: DataFrame (2 columns, 2500 rows)
├── "image": list (len=2500)
│   ├── [0]: dict (2 keys)
│   │   ├── <key_types>: {"str": 2}
│   │   ├── "bytes": bytes
│   │   └── "path": str
│   └── ... 2499 more item(s)
└── "label": list (len=2500)
    ├── [0]: numpy.int64
    └── ... 2499 more item(s)
--------------------------------------

Case 2: Inspect a Data File

import pydatapeekr as peekr

# Example file:
# https://huggingface.co/datasets/timm/mini-imagenet/tree/main/data
peekr.display_file("test-00000-of-00002.parquet", style="-")

Terminal output:

------------------------- PEEKR INFO -------------------------
test-00000-of-00002.parquet: DataFrame (2 columns, 2500 rows)
├── "image": list (len=2500)
│   ├── [0]: dict (2 keys)
│   │   ├── <key_types>: {"str": 2}
│   │   ├── "bytes": bytes
│   │   └── "path": str
│   └── ... 2499 more item(s)
└── "label": list (len=2500)
    ├── [0]: numpy.int64
    └── ... 2499 more item(s)
--------------------------------------------------------------

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydatapeekr-0.2.0.tar.gz (23.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydatapeekr-0.2.0-py3-none-any.whl (30.0 kB view details)

Uploaded Python 3

File details

Details for the file pydatapeekr-0.2.0.tar.gz.

File metadata

  • Download URL: pydatapeekr-0.2.0.tar.gz
  • Upload date:
  • Size: 23.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for pydatapeekr-0.2.0.tar.gz
Algorithm Hash digest
SHA256 bb8236b47858e388941aa06965f2d1997ef34805dd3d5ddee0ff8c96750671a7
MD5 09f21f391d8b49195e696db3dce3c540
BLAKE2b-256 9452b9c2ec9e461757496e348c669eff31e7d1141200fe5d7a35c1c8c5a97238

See more details on using hashes here.

File details

Details for the file pydatapeekr-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pydatapeekr-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 30.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for pydatapeekr-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a7d52d1c4052f3a01565d214d3209bdd20d295aec82b74bab709b4cdda4158d
MD5 bc4b55ba4289df7cdf329eeea3a9bd78
BLAKE2b-256 c36a77a54c94a2815d105e3bd4f409464321983636186c0059052aae72024ed5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page