Skip to content

coreygirard/humansort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sorting for humans

Build Status
Code style: black

Sorts filenames and similar strings the way you actually want them sorted. Instead of:

1_data.json
1_thing.json
2_data.json
2_thing.json
filename_1.py
filename_10.py
filename_11.py
filename_2.py
filename_20.py
filename_21.py

We get:

1_data.json
2_data.json
1_thing.json
2_thing.json
filename_1.py
filename_2.py
filename_10.py
filename_11.py
filename_20.py
filename_21.py

Installation

pip install humansort

Usage

import humansort

list_of_strings = humansort.sort(list_of_strings)

Many thanks to Ross Reisman for bitching about questioning the status quo and inspiring this

About

String sorting for humans

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages