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"),">")

Attention

cat Get-Content)in PowerShell injects UTF-8 BOM (Unicode 65279, U+FEFF).

updates

  • 0.2.3 find and solve encoding case, UTF-8 BOM in PowerShell

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.3.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

bigsort-0.2.3-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bigsort-0.2.3.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for bigsort-0.2.3.tar.gz
Algorithm Hash digest
SHA256 ee21e315f5968be5f73b3b19b76986267a490381af35a563fe6a66c9a237940c
MD5 bc4ac7457e1c301dff2cd26ac78e809a
BLAKE2b-256 87624ba1375f3fa0190e3dbdc78ffc52429a969b7e661188806163b98f6e816f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bigsort-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for bigsort-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1626b0e5ae769f1ecf0383f61b23303ed448a4e1b31a1a895cfa12656bebd49b
MD5 3601078361ae6751d9ecdc9e3211534d
BLAKE2b-256 0c78bbd9947f521614beab845a41dc0093e7112e0469cb2926d19a34882c2a3e

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