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)
-xr N Skip first N rows

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

Skip the first 2 rows of an excel file:

dfpeek data.xlsx -xr 2 

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.6.tar.gz (4.7 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.6-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dfpeek-0.1.6.tar.gz
  • Upload date:
  • Size: 4.7 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.6.tar.gz
Algorithm Hash digest
SHA256 8e9f3d02851cb5d08f401a8edd45d3a85e56b05f72a8ef123fe2476f2a2a5f57
MD5 ffd9149f10b3e5461eac925ef042a462
BLAKE2b-256 bc704622ff00f42bebd133c7a2afefc8d9cdd83bd31fbd90324be654cd4e1ae8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dfpeek-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 4.0 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 86c01fd5ea800c7452f7bd9c5ac0092baded166afd259304c23e917eab49c218
MD5 f4f04b9c00b2f37c0c5317de084e1ea9
BLAKE2b-256 f81ca85f9c1aeb882a779f75aedc5a2cf24f713c106d1a7487d88daed392cc2a

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