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
--keywordmust match a full cell value in the row. - Every
--filtermust 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
1and the first data row is row2.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f99e21958fe81bd95ffb60f2cbd0cf7e49414c8ccf43462ccab86b4a570f5f6
|
|
| MD5 |
8813fd14a3982e9cfe6b4b4c95e33c2f
|
|
| BLAKE2b-256 |
598813699e36b5d054dc2ee00be3e18e8fdfcb72c1ceaf68dbbef4cefb6c8cb8
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8d65b37cc23118027358b6b8b71c7835b52e1ab9ccad213edaf7fc5e86f75df
|
|
| MD5 |
93f22b673d910669236ff5a2b37092e5
|
|
| BLAKE2b-256 |
978a1a9c3a20ce61ea06d2777d1772264de52bf0ef6e5cd57a5d6c6961727e0a
|