Registry / devops / csvsort

csvsort

JSON →
library1.6.1pypypi✓ verified 85d ago

Sort large CSV files on disk rather than in memory. Version 1.6.1 is current. Released irregularly; maintained by Richard Penman.

pip install csvsort
INSTALL
IMPORT
SIG · CSVSORT
C
csvsort
devopspythonv1.6.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

csvsort
from csvsort import csvsort
correct import path

Sort a CSV file by the first column, writing to a new file.

from csvsort import csvsort csvsort('input.csv', output='sorted.csv', columns=[0])
Debug
Known issues
gotchaOnly the first line is treated as a header. If your CSV has no header, set `has_header_line=False`.
fix
Use `has_header_line=False` parameter.
affects: all
gotchaColumns are zero-indexed by default. Use `columns=[0]` for first column.
fix
Remember zero-indexing when specifying column indices.
affects: all
gotchaSorting is case-sensitive by default. Use `ignore_case=True` for case-insensitive sort.
fix
Set `ignore_case=True` if needed.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'csvsort'
csvsort not installed.
fix
pip install csvsort
csvsort.output_len must be <= memory_len
Output file size exceeds memory limit for in-memory merge step.
fix
Use larger `memory` parameter or smaller input.
Upgrade
Version history
1.6.1latest on PyPI · released Jun 17, 2020
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
10
Amazon
1
Resources
csvsort — pip install csvsort · libregistry