# bigsort
sort or shuffle big file/stream
## usage
> pip install bigsort
### shell
```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
```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](demo.py)
Raw data
{
"_id": null,
"home_page": "https://github.com/laohur/bigsort",
"name": "bigsort",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.0",
"maintainer_email": null,
"keywords": "bigsort, sort, external sort, big file sort",
"author": "laohur",
"author_email": "laohur@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/01/8a/7e6813d8b410629c56c6933c5059b1f9868b075e6a910db3583b5fe27619/bigsort-0.2.2.tar.gz",
"platform": null,
"description": "# bigsort\r\nsort or shuffle big file/stream\r\n\r\n## usage\r\n> pip install bigsort \r\n\r\n### shell\r\n\r\n```shell\r\nbigsort -i readme.md -o sorted.txt # default sort in increase \r\ncat readme.md | bigsort --sortType=d --unique=1 > sorted.txt # sort pipe, order in descend, unique\r\nbigsort -i sorted.txt -c \">\" # check order\r\nbigsort -i readme.md --unique=1 | bigsort --sortType=R > sorted.txt # unique and shufle \r\nhead -c 100000000 /dev/urandom | python bigsort.py -C=1000 -m=0.999 --sortType=R -T=\"./\" > sorted.txt\r\nwc -l *.py | bigsort -k 1n,2 -b 1 -t \" \" # sort by key\r\nbigsort -i readme.md -s R -g 10 # get first 10 lines\r\n```\r\n\r\n### python\r\n\r\n```python\r\nimport os\r\nfrom bigsort import bigsort, sortFile, check\r\n\r\n# sort in file\r\nsortFile(\"cat readme.md\",\"sorted.txt\")\r\ncheck(open(\"sorted.txt\"),\"<=\")\r\n\r\n# sort in pipe\r\nbigsort(os.popen(\"cat readme.md\"),open(\"sorted.txt\",'w'),unique=1,sortType=\"d\")\r\ncheck(open(\"sorted.txt\"),\">\")\r\n```\r\n\r\n## [custom sort](demo.py)\r\n",
"bugtrack_url": null,
"license": "[Anti-996 License](https: // github.com/996icu/996.ICU/blob/master/LICENSE)",
"summary": "sort big file or streams",
"version": "0.2.2",
"project_urls": {
"Homepage": "https://github.com/laohur/bigsort"
},
"split_keywords": [
"bigsort",
" sort",
" external sort",
" big file sort"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "888001ab9d368872fa146addd32750dc0779d60d3e33baa6aa0d87f8faf4d939",
"md5": "54ca49e15c0b24f6e12ce3148afde0da",
"sha256": "cf3e0b60b45a9f594f557e87cd62945d8bf3e5288c883b22d1af893d58956b3a"
},
"downloads": -1,
"filename": "bigsort-0.2.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "54ca49e15c0b24f6e12ce3148afde0da",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.0",
"size": 4847,
"upload_time": "2024-12-09T13:32:36",
"upload_time_iso_8601": "2024-12-09T13:32:36.912159Z",
"url": "https://files.pythonhosted.org/packages/88/80/01ab9d368872fa146addd32750dc0779d60d3e33baa6aa0d87f8faf4d939/bigsort-0.2.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "018a7e6813d8b410629c56c6933c5059b1f9868b075e6a910db3583b5fe27619",
"md5": "bf71229a7be926b33848c869c6d971b0",
"sha256": "c936a1f1998e6889438f0c62c10de53df109881fb52342b663f9c178c96d76c4"
},
"downloads": -1,
"filename": "bigsort-0.2.2.tar.gz",
"has_sig": false,
"md5_digest": "bf71229a7be926b33848c869c6d971b0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.0",
"size": 4619,
"upload_time": "2024-12-09T13:32:38",
"upload_time_iso_8601": "2024-12-09T13:32:38.392895Z",
"url": "https://files.pythonhosted.org/packages/01/8a/7e6813d8b410629c56c6933c5059b1f9868b075e6a910db3583b5fe27619/bigsort-0.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-09 13:32:38",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "laohur",
"github_project": "bigsort",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "bigsort"
}