Skip to main content

Peek into a dataframe from the command line

Project description

dfpeek

A fast command-line tool for peeking at tabular data files (CSV, TSV, Parquet, Feather, Excel) with concise, chainable options inspired by Unix tools like ls.

Installation

Install from PyPI (recommended):

pip install dfpeek

Or, for Excel/Parquet support:

pip install dfpeek[excel,parquet]

Usage

Run from the command line:

dfpeek <datafile> [options]

Options

Option Description
-h N Show first N rows
-t N Show last N rows
-r START END Show rows in range START to END (zero-based, END excl.)
-u COL Show unique values for column COL
-c COL Show info about column COL (type, nulls, etc.)
-v COL Show value counts for column COL
-s COL Show stats for numerical column COL
-l List column names
-i Show file info (rows, columns, memory usage)
-d DELIM Set delimiter for CSV/TSV files (e.g., , or \t)
-xs N Select Excel sheet N (1-based indexing)

All options can be chained in any order.

Examples

Show first 10 rows:

dfpeek data.csv -h 10

Show last 5 rows:

dfpeek data.csv -t 5

Show rows 20 to 30:

dfpeek data.csv -r 20 30

Show unique values for column city:

dfpeek data.csv -u city

Show info about column city:

dfpeek data.csv -c city

Show value counts for column status:

dfpeek data.csv -v status

Show stats for column age:

dfpeek data.csv -s age

List columns:

dfpeek data.csv -l

Show file info:

dfpeek data.csv -i

Show info and first 5 rows (default if no options):

dfpeek data.csv

Use a custom delimiter (e.g., tab):

dfpeek data.tsv -d "\t" -h 5

Use a specific Excel sheet (e.g., the 3rd sheet):

dfpeek data.xlsx -xs 3 -h 10

Supported Formats

  • CSV (.csv)
  • TSV (.tsv)
  • Parquet (.parquet)
  • Feather (.feather)
  • Excel (.xlsx)

Notes

  • For very large files, output may be slow if printing many rows.
  • All rows/columns are shown in full (no abbreviation).
  • Requires Python 3.7+

License

MIT

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

dfpeek-0.1.5.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

dfpeek-0.1.5-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file dfpeek-0.1.5.tar.gz.

File metadata

  • Download URL: dfpeek-0.1.5.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for dfpeek-0.1.5.tar.gz
Algorithm Hash digest
SHA256 1187269e7f1bdd3d0a4e4ae3cb60fd62522bef45f97884ea0b4632e2e927c419
MD5 936868902426cc0b21d33f7fa0a4bf9f
BLAKE2b-256 94e13a6ec87a9b6ab84708fcf4f966ce27b4bc5a95f9f249468e8a1526f36442

See more details on using hashes here.

File details

Details for the file dfpeek-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: dfpeek-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for dfpeek-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c32b52234d0a2f4a922d2886a74eaa3fc67268b0daec6e676ba43bbba0814949
MD5 12c88e939f7138d249b77876439a85e1
BLAKE2b-256 0568c2256f0d47542e10b10d3479b6dd42c7067c05bc2876e520d94f333e9ced

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