sleepydatapeek
A quick way to peek at local datafiles.
Welcome to sleepydatapeek!
One often needs to spit out a configurable preview of a data file. It would also be nice if said tool could detect and read several formats automatically.
sleepydatapeek has entered the chat!
Quickly summarize data files of type:
csvparquetjsonpklxlsx
And glance metadata for files:
pdfpngjpg|jpeg
ℹ️ Note that this tool presumes format by file extension. If you leave out extensions, or give csv data a
.jsonextension for funsies, then you're being silly.
ℹ️ Due to how metadata formats vary across file types, how metadata is presented varies.
Get Started 🚀
pip install sleepydatapeek
pip install --upgrade sleepydatapeek
python -m sleepydatapeek --help
python -m sleepydatapeek data.csv
python -m sleepydatapeek doc.pdf
Usage ⚙
Set a function in your shell environment to run a script like:
alias datapeek='python -m sleepydatapeek'
Presuming you've named said macro datapeek, print the help message:
$ datapeek data.xlsx
════════════════════ data.xlsx ════════════════════
Unnamed: 0 CustomerID ProductName Quantity OrderDate Price
-- ------------ ------------ ------------- ---------- ----------- -------
0 0 101 Laptop 2 2023-10-26 1200
1 1 102 Mouse 1 2023-10-26 25
2 2 103 Keyboard 1 2023-10-27 50
3 3 104 Monitor 1 2023-10-27 300
4 4 105 Headphones 3 2023-10-28 80
═══Summary Stats
╭──────────────┬─────────────────╮
│ Index Column │ (no_name):int64 │
├──────────────┼─────────────────┤
│ Row Count │ 30 │
├──────────────┼─────────────────┤
│ Column Count │ 6 │
├──────────────┼─────────────────┤
│ Memory Usage │ < 0.00 bytes │
╰──────────────┴─────────────────╯
═══Schema
╭─────────────┬────────╮
│ Unnamed: 0 │ int64 │
├─────────────┼────────┤
│ CustomerID │ int64 │
├─────────────┼────────┤
│ ProductName │ object │
├─────────────┼────────┤
│ Quantity │ int64 │
├─────────────┼────────┤
│ OrderDate │ object │
├─────────────┼────────┤
│ Price │ int64 │
╰─────────────┴────────╯
═══════════════════════════════════════════════════
Optionally, you can also get group-by counts for distinct values of a given column:
$ datapeek test.xlsx --groupby-count-column=ProductName
# typical output (elided)
═══Groupby Counts
(row counts for distinct values of ProductName)
╭──────────────┬───╮
│ Laptop │ 3 │
├──────────────┼───┤
│ Mouse │ 3 │
├──────────────┼───┤
│ Keyboard │ 3 │
├──────────────┼───┤
│ Monitor │ 3 │
├──────────────┼───┤
│ Headphones │ 3 │
├──────────────┼───┤
│ USB Drive │ 3 │
├──────────────┼───┤
│ Printer │ 3 │
├──────────────┼───┤
│ Webcam │ 3 │
├──────────────┼───┤
│ Speakers │ 3 │
├──────────────┼───┤
│ External HDD │ 3 │
╰──────────────┴───╯
═══════════════════════════════════════════════════
You can check metadata for certain file types too:
$ datapeek resume.pdf
📄test.pdf
╭──────────────┬─────────────────────────────────╮
│ CreationDate │ D:20250306111007-06'00' │
├──────────────┼─────────────────────────────────┤
│ Creator │ Adobe InDesign 20.1 (Macintosh) │
├──────────────┼─────────────────────────────────┤
│ ModDate │ D:20250306111048-06'00' │
├──────────────┼─────────────────────────────────┤
│ Producer │ Adobe PDF Library 17.0 │
├──────────────┼─────────────────────────────────┤
│ Trapped │ /False │
├──────────────┼─────────────────────────────────┤
│ Length │ 48 pages │
╰──────────────┴─────────────────────────────────╯
Technologies 🧰
Contribute 🤝
If you have thoughts on how to make the tool more pragmatic, submit a PR 😊.
To add support for more data/file types:
- append extension name to
supported_formatsinsleepydatapeek_toolchain.params.py - add detection logic branch to the
mainfunction insleepydatapeek_toolchain/command_logic.py - update this readme
License, Stats, Author 📜
See License for the full license text.
This package was authored by Isaac Yep.
Metadata
Release files for sleepydatapeek 1.6.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sleepydatapeek-1.6.4.tar.gz | 32.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sleepydatapeek-1.6.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 64.6 kB
Release files / sleepydatapeek-1.6.4.tar.gz
| Download URL | sleepydatapeek-1.6.4.tar.gz |
|---|---|
| Size | 32.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
56011aa46a82daa3128e179a13b7194155c46dfef9523cb02053e76aef733247
|
|
BLAKE2b-256 checksum How to use checksums |
7d0bf3d253e40ac367bea21125d1e271c951e9e0c04a19c096c1c68162e8ecd1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.1 CPython/3.13.2 Darwin/24.4.0
|
Release files / sleepydatapeek-1.6.4-py3-none-any.whl
| Download URL | sleepydatapeek-1.6.4-py3-none-any.whl |
|---|---|
| Size | 32.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
090a3ce2a4d75f27bb135dc0b7cf88a811def1666406a903afb6348a934d273b
|
|
BLAKE2b-256 checksum How to use checksums |
75eab84f2420b417906eee5f1e09dfd36fa17a9627efec96c6e6411c4a72c710
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.1 CPython/3.13.2 Darwin/24.4.0
|