A blazing fast natural sorting library for Python
Project description
natsort-rs
A blazing fast natural sorting library for Python written in Rust 🚀
Warning: This is a pre-alpha library. It should not yet be used for production code.
Installation
Find package files on PyPI.
Note: Currently, there exist no builds for Apple Silicon chips.
Examples
from natsort_rs import natsort
Sort a list of strings
items = ['item 1', 'item 10', 'item 3']
print(natsort(items))
# ['item 1', 'item 3', 'item 10']
Sort case insensitively
items = ['Item 1', 'Item 3', 'item 2']
print(natsort(items, ignore_case=True))
# ['Item 1', 'item 2', 'Item 3']
Sort complex objects based on property
items = [
{'name': 'item 1', 'id': 1},
{'name': 'item 3', 'id': 3},
{'name': 'item 2', 'id': 2}
]
print(natsort(items, key=lambda d: d['name']))
# [{'name': 'item 1', 'id': 1}, {'name': 'item 2', 'id': 2}, {'name': 'item 3', 'id': 3}]
Credits
This Python module is build on top of the human-sort
crate.
License
MIT License
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 Distributions
Built Distributions
File details
Details for the file natsort_rs-0.1.4-cp311-none-win_amd64.whl
.
File metadata
- Download URL: natsort_rs-0.1.4-cp311-none-win_amd64.whl
- Upload date:
- Size: 122.8 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8846ea768296ef7d18dcabda3af9abfbbaadd711c1e8183dd39e23eb80acd6ea |
|
MD5 | bc4022a346aeb5141e090f49910b3cae |
|
BLAKE2b-256 | 865d62ce27b917dd02a01378a6a05baa0dd22909be0bab69bf4f159f593e9feb |
File details
Details for the file natsort_rs-0.1.4-cp311-cp311-manylinux_2_34_x86_64.whl
.
File metadata
- Download URL: natsort_rs-0.1.4-cp311-cp311-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 222.9 kB
- Tags: CPython 3.11, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d27870bbcd1c3d6776ca6916331e696a1a6fae568a1052c66c6fe61c8721c38 |
|
MD5 | a014249b218054c9fe0707d8711cb3e8 |
|
BLAKE2b-256 | 92ea287fc0451d2dce53c73a24cab346b8109379c990c5d53b2c8d235993157d |
File details
Details for the file natsort_rs-0.1.4-cp311-cp311-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: natsort_rs-0.1.4-cp311-cp311-macosx_10_7_x86_64.whl
- Upload date:
- Size: 200.5 kB
- Tags: CPython 3.11, macOS 10.7+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea941ae4cc984e6b3f5237c952013ef1c0695c6afc8ec369dd932585d26da754 |
|
MD5 | afb46db3afcbca64a45ba2c164eff011 |
|
BLAKE2b-256 | 28f364f9dab7cc21c0ce08147e9faa97a64893a4ad5d2fbddd8cf7573fc416cf |
File details
Details for the file natsort_rs-0.1.4-cp310-none-win_amd64.whl
.
File metadata
- Download URL: natsort_rs-0.1.4-cp310-none-win_amd64.whl
- Upload date:
- Size: 122.8 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fa8691d72af0c096338c6a2724da890c62c99ca9bd22eb698f1ce49df504215 |
|
MD5 | b9466076b5f877eecc577c912becd552 |
|
BLAKE2b-256 | 683d28bc62e17bf6353f6c40d8a4ff2981208f141a1bdd3b40b0a9a538618da9 |
File details
Details for the file natsort_rs-0.1.4-cp310-cp310-manylinux_2_34_x86_64.whl
.
File metadata
- Download URL: natsort_rs-0.1.4-cp310-cp310-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 222.9 kB
- Tags: CPython 3.10, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04c4f74af46a1c07817b614accf38fd185bc3ad098e0fe6f18f9f34991b168a7 |
|
MD5 | ce0ee37926c894154209348c5e1189f7 |
|
BLAKE2b-256 | 1565b4e40b73e3b4fbbf92c5231cb2dec8ba6d434e71828d7c7f290c69bbf471 |
File details
Details for the file natsort_rs-0.1.4-cp310-cp310-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: natsort_rs-0.1.4-cp310-cp310-macosx_10_7_x86_64.whl
- Upload date:
- Size: 200.5 kB
- Tags: CPython 3.10, macOS 10.7+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a38542567217bdd0b9fb96a0a3696c003f2ff9685cbd741294dc841f8370361 |
|
MD5 | 7e965df84d02420dba40c859e46375c6 |
|
BLAKE2b-256 | ad8a4ef59986fca5db82a050c89ff2c31cce154fda740a7e5e10e24bbe3bc85c |
File details
Details for the file natsort_rs-0.1.4-cp39-none-win_amd64.whl
.
File metadata
- Download URL: natsort_rs-0.1.4-cp39-none-win_amd64.whl
- Upload date:
- Size: 122.8 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa09c76c06a8da443124c94f5dbc2deb65c23183d71d7872ac7bb867f28bb72f |
|
MD5 | 3e2d83b3bc1e05923147d3bc04cdf28e |
|
BLAKE2b-256 | 50088e3eb8ff12520ea80b2c57ed169a7d044f2da13a70ed2b92e8daeaf1371d |
File details
Details for the file natsort_rs-0.1.4-cp39-cp39-manylinux_2_34_x86_64.whl
.
File metadata
- Download URL: natsort_rs-0.1.4-cp39-cp39-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 222.9 kB
- Tags: CPython 3.9, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cb0c48bc6df7449ca253c9c06d80d68d636de01be7c0a95f88d691ea9aedaa0 |
|
MD5 | d25f348f6ac97be1ff4a2014d54f9fa0 |
|
BLAKE2b-256 | 02918aefce20813476bd80bde63607819607dcfc7cd912ddc3cc340c45d9abb6 |
File details
Details for the file natsort_rs-0.1.4-cp39-cp39-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: natsort_rs-0.1.4-cp39-cp39-macosx_10_7_x86_64.whl
- Upload date:
- Size: 200.3 kB
- Tags: CPython 3.9, macOS 10.7+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a5e876a809d6050fd40da6e6970c901f4e1cffe8694818bd744bbba9cd48d1e |
|
MD5 | 7f197de098287f205db4b015dd72bce8 |
|
BLAKE2b-256 | 96bd15721e6703e8a670c481a28bd460a4d81645f952626a445948acb0dee94e |
File details
Details for the file natsort_rs-0.1.4-cp38-none-win_amd64.whl
.
File metadata
- Download URL: natsort_rs-0.1.4-cp38-none-win_amd64.whl
- Upload date:
- Size: 122.5 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a94dc16fcb0334d143a05d670ddc4d2864a78b89b1f124c151a411ceac7601e |
|
MD5 | 9dbe6c8a1733dbccaae1824eb849e08c |
|
BLAKE2b-256 | c114d97804fa5909ba86c7c49fef42ff67d92b4d30a34a602b058d8abcc71362 |
File details
Details for the file natsort_rs-0.1.4-cp38-cp38-manylinux_2_34_x86_64.whl
.
File metadata
- Download URL: natsort_rs-0.1.4-cp38-cp38-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 222.9 kB
- Tags: CPython 3.8, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f754d06dc5dd4ffe303317dcf4dd373c539308b99ff8ff32b6227cbdc8654228 |
|
MD5 | a3011550ec241b8f88718c35a7cf017a |
|
BLAKE2b-256 | 2949171db22276e59f82cc1f342450605bef3ac7a45fb59ea3d0aaececdcb434 |
File details
Details for the file natsort_rs-0.1.4-cp38-cp38-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: natsort_rs-0.1.4-cp38-cp38-macosx_10_7_x86_64.whl
- Upload date:
- Size: 200.5 kB
- Tags: CPython 3.8, macOS 10.7+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a26fcff7934d5b1aff7530cc23730bb10e5d2e3c5ecc474d32f6d97c77a9b3a5 |
|
MD5 | c5df1b106c9ad34123ff7a8df105f5fa |
|
BLAKE2b-256 | 34751ec140179629ad36b9faecdac4c789ec1a7377f702205fc71eaa4045bb21 |