GitXplorerGitXplorer
d

csvsorter

public
4 stars
7 forks
2 issues

Commits

List of commits on branch master.
Verified
a4e7e27328c6869c6c712de04db8d956bb25fe16

Merge pull request #4 from ShadenSmith/close_files

ddionysio committed 7 years ago
Verified
a3412e974979ce44bf8ee3f1f55efd38baedea0b

Merge pull request #5 from ShadenSmith/swp_files

ddionysio committed 7 years ago
Unverified
c39d96aebd9f331203e1edc3432ac14f4827a2ef

ignores vim .swp files

SShadenSmith committed 7 years ago
Unverified
8adc972acf3b5a4b8ab917eb7bde3b488fab3978

closes split CSV files

SShadenSmith committed 7 years ago
Unverified
d66852174c778dafc4b6887b99acd7ec9a753ec9

Merge pull request #2 from ofir-s2/patch-1

ddionysio committed 8 years ago
Unverified
abfac09e405a4e391f1c185fadf4c4796ec0b6f7

Update README.rst

oofir-s2 committed 8 years ago

README

The README file for this repository.

========== CSV Sorter

Fork of the csvsort_ for Python 3. For sorting CSV files on disk that do not fit into memory. The merge sort algorithm is used to break up the original file into smaller chunks, sort these in memory, and then merge these sorted files.

.. _csvsort: https://bitbucket.org/richardpenman/csvsort

============= Example usage

.. sourcecode:: python

>>> from csvsorter import csvsort
>>> # sort this CSV on the 5th and 3rd columns (columns are 0 indexed)
>>> csvsort('test1.csv', [4,2])  
>>> # sort this CSV with no header on 4th column and save results to separate file
>>> csvsort('test2.csv', [3], output_filename='test3.csv', has_header=False)  
>>> # sort this TSV on the first column and use a maximum of 10MB per split
>>> csvsort('test3.tsv', [0], max_size=10, delimiter='\t')  
>>> # sort this CSV on the first column, force quotes around every field (default is csv.QUOTE_MINIMAL) and use windows-1250 encoding
>>> import csv
>>> csvsort('test4.csv', [0], quoting=csv.QUOTE_ALL, encoding='windows-1250')

..

======= Install

.. sourcecode:: bash

$ pip install csvsorter

..