Pure Python external merge sort implementation
Project description
Getting started with merge-sort
version: 0.3.3
This is a pure Python external merge sort implementation. It is orders of magnitude slower then the UNIX sort but if you need to do an external merge sort and do not want to make a system call to UNIX sort then this should help you out. It uses the excellent heapq.merge under the hood.
A full external merge sort, is implemented in two separate steps. The initial subsetting and sorting of the input file into temp files, then the merging of those temp files and the iteration of the sorted rows. The merge allows you to control how many temp files are open at one time. I wrote this as I could not find many options for doing this in Python. If anyone knows of anything else please contact me and I will add it here as a possible alternative to this package.
There is online documentation for merge-sort.
Installation instructions
Install using pip
pip install merge-sort
Install using conda:
conda install -c conda-forge -c cfin merge-sort
Basic usage
There are some examples in ./resources/examples where . is the root of the merge-sort repository.
Run tests
If you have cloned the repository, you can also run the tests using pytest ./tests, if any fail please contact us (see the contribution page for contact info).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cfin_merge_sort-0.3.3.tar.gz.
File metadata
- Download URL: cfin_merge_sort-0.3.3.tar.gz
- Upload date:
- Size: 27.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63c4aaa5441e086d0c47163b30b5e7a5f538b482a91805a60082c5b474b08c2e
|
|
| MD5 |
3a30899cb819c24be0e9c81d52d777dd
|
|
| BLAKE2b-256 |
3f0350c2ea1ad766b3c7687842a4fd8b16c307101d32326d867b9619bf04594a
|
File details
Details for the file cfin_merge_sort-0.3.3-py3-none-any.whl.
File metadata
- Download URL: cfin_merge_sort-0.3.3-py3-none-any.whl
- Upload date:
- Size: 29.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0dc8a2fe39bfdb8ebfaf416236839cbd4588c4cdd7473e835406171dbb5f018
|
|
| MD5 |
36d1a3b5e1720d640245a36db330a066
|
|
| BLAKE2b-256 |
71b197449b7016cc5a869b1abdadbfb8b2c5cba86ed14a5d562245bf4212dc6d
|