Metadata-Version: 2.4
Name: cfin-merge-sort
Version: 0.3.2
Summary: Pure Python external merge sort implementation
Author-email: Chris Finan <c.finan@ucl.ac.uk>
License-Expression: GPL-3.0-or-later
Project-URL: Homepage, https://cfinan.gitlab.io/merge-sort
Project-URL: Repository, https://gitlab.com/cfinan/merge-sort
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: <3.14,>=3.9
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: sortedcontainers
Requires-Dist: stdopen
Requires-Dist: cfin-pyaddons
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-dependency; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Requires-Dist: bump2version; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: license-file

# Getting started with merge-sort

__version__: `0.3.2`

[This](https://gitlab.com/cfinan/merge-sort) 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](https://cfinan.gitlab.io/merge-sort/index.html) 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).
