Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

LazySort

LazySort provides a wrapper around any sequence with random access. It computes and sorts only the necessary chunks of data on-demand when items or slices are accessed.

Installation

Using uv:

uv add lazysort

Or using pip:

pip install lazysort

Usage

from lazysort import LazySort

# An unsorted dataset.
data = [42, 15, 8, 23, 4, 16, 99, 51, 3]

# Wrap the dataset with LazySort.
# work_items_limit defines the maximum number of elements loaded into memory.
ls = LazySort(data, work_items_limit=4)

# Access elements as if the collection were sorted.
print(ls[0]) # Output: 3
print(ls[1]) # Output: 4
print(ls[-1]) # Output: 99

# Slicing is also fully supported.
print(tuple(ls[2:6]))

# Iteration yields elements in sorted order.
for item in ls: print(item)

# Using a custom key function and reverse sorting
complex_ls = LazySort(data, work_items_limit=4, key_fn=lambda x: x, reverse=True)

Changelog

v2

  • Stable production release with improved clustering algorithms and full test coverage.

v1

  • Initial release featuring core lazy sorting capabilities, indexing, and key function support. It has a bug in the processing of equal values.

License

This project is licensed under the MIT License.

Contact

LinkedIn

GitLab

Metadata

Release files for lazysort 2.1.0.dev1791025588

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for lazysort 2.1.0.dev1791025588
File Interpreter ABI Platform Actions
lazysort-2.1.0.dev1791025588-py3-none-any.whl Python 3 none any Details for lazysort-2.1.0.dev1791025588-py3-none-any.whl

Release files / lazysort-2.1.0.dev1791025588-py3-none-any.whl

Download URL lazysort-2.1.0.dev1791025588-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
614c8462929518cc500e2772165cb7687f0366c486e721520bed225730115b62
BLAKE2b-256 checksum
How to use checksums
215cc3bbc2f0999b8f070feca7bf9a2327077ca4c49dea94eb920a6ba53f5254
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for lazysort 2.1.0.dev1791025588

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page