Skip to main content

Stream large CSV files and surface exact row matches with a readable CLI report.

Project description

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

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

rowlens-1.0.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

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

rowlens-1.0.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file rowlens-1.0.0.tar.gz.

File metadata

  • Download URL: rowlens-1.0.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.7 Windows/11

File hashes

Hashes for rowlens-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9f99e21958fe81bd95ffb60f2cbd0cf7e49414c8ccf43462ccab86b4a570f5f6
MD5 8813fd14a3982e9cfe6b4b4c95e33c2f
BLAKE2b-256 598813699e36b5d054dc2ee00be3e18e8fdfcb72c1ceaf68dbbef4cefb6c8cb8

See more details on using hashes here.

File details

Details for the file rowlens-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: rowlens-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.7 Windows/11

File hashes

Hashes for rowlens-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a8d65b37cc23118027358b6b8b71c7835b52e1ab9ccad213edaf7fc5e86f75df
MD5 93f22b673d910669236ff5a2b37092e5
BLAKE2b-256 978a1a9c3a20ce61ea06d2777d1772264de52bf0ef6e5cd57a5d6c6961727e0a

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