Skip to main content

rowlens

rowlens is a streaming CSV search CLI for very large files. It scans row by row, keeps memory usage flat, and prints matches in a readable terminal report with column names beside each value.

Why it exists

When a CSV is 17 GB, the usual "open it in a spreadsheet" workflow is already dead. rowlens is built for the needle-in-a-haystack case:

  • Match one or more exact cell values with repeated --keyword
  • Require one or more substring filters with repeated --filter
  • Stream the file without loading it into memory
  • Print each matching row in a bordered, columnar CLI layout
  • Optionally save the same report to a text file with --output

Install

poetry install

Usage

poetry run rowlens --file "data.csv" --keyword "1213131" --filter "AAA"
poetry run rowlens \
  --file "huge.csv" \
  --keyword "1213131" \
  --keyword "YYYY" \
  --filter "AAA" \
  --filter "needle" \
  --ignore-case \
  --max-results 5 \
  --output "output/results.txt"

Matching rules

  • Every --keyword must match a full cell value in the row.
  • Every --filter must appear as a substring in at least one cell in the row.
  • A row is returned only if it satisfies all supplied criteria.
  • Reported row numbers are CSV record numbers, so the header is row 1 and the first data row is row 2.

Options

--file         CSV file to search
--keyword      Exact cell value to match; repeatable
--filter       Substring to require; repeatable
--delimiter    CSV delimiter, default ","
--encoding     File encoding, default "utf-8-sig"
--ignore-case  Case-insensitive matching
--max-results  Stop after N matches
--output       Write the rendered report to a text file

Packaging

The project uses Poetry and exposes a console script named rowlens, so it is ready to publish to PyPI after you set the final author metadata and repository URLs in pyproject.toml.

Tests

poetry run pytest

Metadata

Release files for rowlens 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 rowlens 1.0.0
File Size Uploaded
rowlens-1.0.0.tar.gz 5.4 kB Details

Built distribution (wheel)

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

Total release size: 12.4 kB

Release files / rowlens-1.0.0.tar.gz

Download URL rowlens-1.0.0.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9f99e21958fe81bd95ffb60f2cbd0cf7e49414c8ccf43462ccab86b4a570f5f6
BLAKE2b-256 checksum
How to use checksums
598813699e36b5d054dc2ee00be3e18e8fdfcb72c1ceaf68dbbef4cefb6c8cb8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.5 CPython/3.12.7 Windows/11

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

Download URL rowlens-1.0.0-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a8d65b37cc23118027358b6b8b71c7835b52e1ab9ccad213edaf7fc5e86f75df
BLAKE2b-256 checksum
How to use checksums
978a1a9c3a20ce61ea06d2777d1772264de52bf0ef6e5cd57a5d6c6961727e0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.5 CPython/3.12.7 Windows/11

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

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