Skip to main content

Pure Python external merge sort implementation

Project description

Getting started with merge-sort

version: 0.3.2

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cfin_merge_sort-0.3.2.tar.gz (73.0 kB view details)

Uploaded Source

Built Distribution

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

cfin_merge_sort-0.3.2-py3-none-any.whl (81.0 kB view details)

Uploaded Python 3

File details

Details for the file cfin_merge_sort-0.3.2.tar.gz.

File metadata

  • Download URL: cfin_merge_sort-0.3.2.tar.gz
  • Upload date:
  • Size: 73.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for cfin_merge_sort-0.3.2.tar.gz
Algorithm Hash digest
SHA256 51de6ba81f18260db002fcd39cf8f62414b6a5ecd0c948987aa81c2eea1fad4c
MD5 5563408adc9d102c2b6ab440065ec944
BLAKE2b-256 9fd4da756d09a50f81fad3f6abb07fc27988f23a723f6e2cc4d83f76768e89b9

See more details on using hashes here.

File details

Details for the file cfin_merge_sort-0.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for cfin_merge_sort-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 be5ce23ab50bcf0d9e05a12b9ad901b8d0153b68c7181996cbdf5ed1386905fc
MD5 1ce35471a57238eb9fedf124006cbba3
BLAKE2b-256 5089e91238b10a2c933c451696d800e0db658b20a20322d8b5b821804ab7d7ff

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