Skip to main content

sort big file or streams

Project description

bigsort

sort or shuffle big file/stream

usage

pip install bigsort

shell

bigsort -i  readme.md -o sorted.txt  # default sort in increase 
cat readme.md |  bigsort --sortType=d --unique=1 > sorted.txt  # sort pipe, order in descend, unique
bigsort -i sorted.txt -c ">"  # check order
bigsort -i  readme.md --unique=1   | bigsort --sortType=R > sorted.txt   # unique and shufle 
head -c 100000000  /dev/urandom  | python bigsort.py -C=1000 -m=0.999 --sortType=R -T="./" > sorted.txt
wc -l *.py | bigsort   -k 1n,2  -b 1 -t " "   # sort by key
bigsort -i  readme.md -s R -g 10   # get first 10 lines

python

import os
from bigsort import  bigsort, sortFile, check

# sort in file
sortFile("cat readme.md","sorted.txt")
check(open("sorted.txt"),"<=")

# sort in pipe
bigsort(os.popen("cat readme.md"),open("sorted.txt",'w'),unique=1,sortType="d")
check(open("sorted.txt"),">")

custom sort

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

bigsort-0.2.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

bigsort-0.2.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file bigsort-0.2.1.tar.gz.

File metadata

  • Download URL: bigsort-0.2.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for bigsort-0.2.1.tar.gz
Algorithm Hash digest
SHA256 5fe943b0dd3b1305023e23938ae2f7ffdad8d9d923c85acfe73725f9e463f6a9
MD5 df90a562bd0f63cebef2a1fd80d41a5b
BLAKE2b-256 c3cdefc1da57ace9819cecbc9545b9aae94690969a8162ffed98aafd584daf34

See more details on using hashes here.

File details

Details for the file bigsort-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: bigsort-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for bigsort-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 645f66e9e561f68bed9320838b015bbf5b183df2fac0895d293cb8dd71c1f454
MD5 0de1cb0b066a58037020c0547b11d3bd
BLAKE2b-256 ae37ef9169904f1d03b0238c7f62649bd914612ee02c329085f4ea7fd2088e0b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page