./textproc/py-natsort, Natural sorting for python

[ CVSweb ] [ Homepage ] [ RSS ] [ Required by ] [ Add to tracker ]


Branch: CURRENT, Version: 6.0.0, Package name: py27-natsort-6.0.0, Maintainer: kamelderouiche

When you try to sort a list of strings that contain numbers, the
normal python sort algorithm sorts lexicographically, so you might
not get the results that you expect:

>>> a = ['a2', 'a9', 'a1', 'a4', 'a10']
>>> sorted(a)
['a1', 'a10', 'a2', 'a4', 'a9']

Notice that it has the order ('1', '10', '2') - this is because the
list is being sorted in lexicographical order, which sorts numbers
like you would letters (i.e. 'b', 'ba', 'c').

natsort provides a function natsorted that helps sort lists
"naturally", either as real numbers (i.e. signed/unsigned floats
or ints), or as versions. Using natsorted is simple:

>>> from natsort import natsorted
>>> a = ['a2', 'a9', 'a1', 'a4', 'a10']
>>> natsorted(a)
['a1', 'a2', 'a4', 'a9', 'a10']

natsorted identifies numbers anywhere in a string and sorts them
naturally.


Required to run:
[devel/py-setuptools] [lang/python27]

Required to build:
[pkgtools/cwrappers]

Master sites:

SHA1: 819836a08f604c1c53712e37765eaa5182f2e839
RMD160: bc57ebaf0994b8c2c5286a2442173dd9506627db
Filesize: 137.42 KB

Version history: (Expand)


CVS history: (Expand)


   2019-02-08 11:52:03 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-natsort: updated to 6.0.0

6.0.0:
Drop support for Python 2.6 and 3.3
Remove deprecated APIs (kwargs number_type, signed, exp, as_path, py3_safe; \ 
enums ns.TYPESAFE, ns.DIGIT, ns.VERSION; functions versorted, index_versorted)
Remove pipenv as a dependency for building
Simply Travis-CI configuration
Fix README rendering in PyPI
   2018-11-27 17:19:05 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-natsort: updated to 5.5.0

5.5.0
- Formally deprecated old or misleading APIs
- Documentation, packaging, and CI cleanup
- Consolidate API documentation into a single page
- Add a CHANGELOG.rst to the top-level of the repository
- Add back support for very old versions of setuptools
   2018-09-24 11:43:26 by Adam Ciarcinski | Files touched by this commit (4) | Package updated
Log message:
py-natsort: updated to 5.4.1

5.4.1:
Fix error in a newly added test.
Changed code format and quality checking infrastructure.

5.4.0:
Re-expose natsort_key as "public" and remove the associated \ 
DepricationWarning.
Add better developer documentation.
Refactor tests.
Bump allowed fastnumbers version.
   2018-07-08 11:40:00 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-natsort: updated to 5.3.3

5.3.3:
Update docs with a FAQ and quick how-it-works.
Fix a StopIteration error in the testing code.
Enable Python 3.7 support in Travis-CI.
   2018-06-19 14:06:32 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-natsort: updated to 5.3.2

5.3.2:
Fix bug that prevented install on old versions of setuptools.
Revert layout from src/natsort/ back to natsort/ to make user testing simpler.
   2018-05-15 08:45:55 by Adam Ciarcinski | Files touched by this commit (3) | Package updated
Log message:
py-natsort: updated to 5.3.1

5.3.1:
- No bugfixes or features, just infrastructure and installation updates.
- Move to defining dependencies with Pipfile.
- Development layout is now src/natsort/ instead of natsort/.
- Add bumpversion infrastructure.
- Extras can be installed by "[]" notation.
   2018-04-27 09:00:41 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-natsort: updated to 5.3.0

5.3.0:
Fix bug in assessing fastnumbers version at import-time.
Add ability to consider unicode-decimal numbers as numbers.
   2018-02-20 10:32:31 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-natsort: updated to 5.2.0

v. 5.2.0
Add ns.NUMAFTER to cause numbers to be placed after non-numbers.
Add natcmp function (Python 2 only).