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

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


Branch: CURRENT, Version: 8.4.0, Package name: py310-natsort-8.4.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/python310]

Master sites:

Filesize: 74.78 KB

Version history: (Expand)


CVS history: (Expand)


   2023-06-28 10:43:18 by Thomas Klausner | Files touched by this commit (2) | Package updated
Log message:
py-natsort: update to 8.4.0.

[8.4.0] - 2023-06-19
---

### Changed

- The changelog now only explictly exists in the repository
  (issue [#162](https://github.com/SethMMorton/natsort/issues/162))

### Fixed

- Inputs with spaces near adjascent to the extension are now sorted
  correctly for `os_sorted` on Windows (issues
  [#165](https://github.com/SethMMorton/natsort/issues/165) and
  [#166](https://github.com/SethMMorton/natsort/pull/166))
   2023-03-08 13:18:09 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-natsort: updated to 8.3.1

8.3.1
Fixed
- Broken test on FreeBSD due to a broken `locale.strxfrm`.
  **This change has no effect outside fixing tests**
   2023-02-28 07:16:23 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-natsort: updated to 8.3.0

8.3.0

Added
- The `PRESORT` option to the `ns` enum to attain consistent
  sort order in certain corner cases
- Logic to ensure `None` and NaN are sorted in a consistent order
- Explict Python 3.11 support

Changed
- Only convert to `str` if necessary in `os_sorted`
- Attempt to use new `fastnumbers` functionality if available
- Move non-API documentation to the GitHub wiki

Removed
- Support for EOL Python 3.6
   2022-09-02 09:37:15 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-natsort: updated to 8.2.0

8.2.0

Changed
- Auto-coerce `pathlib.Path` objects to `str` since it is the least astonishing
  behavior
- Reduce strictness of type hints to avoid over-constraining client code
   2022-04-26 19:55:37 by Adam Ciarcinski | Files touched by this commit (3) | Package updated
Log message:
py-natsort: updated to 8.1.0

8.1.0 - 2022-01-30

Changed

When using ns.PATH, only split off a maximum of two suffixes from a file name.

8.0.2 - 2021-12-14

Fixed

Bug where sorting paths fail if one of the paths is '.'

8.0.1 - 2021-12-10

Fixed

Compose unicode characters when using locale to ensure sorting is correct across \ 
all locales

8.0.0 - 2021-11-03

Re-release 7.2.0 as 8.0.0 because introduction of type hints can break CI builds
   2022-01-05 16:41:32 by Thomas Klausner | Files touched by this commit (289)
Log message:
python: egg.mk: add USE_PKG_RESOURCES flag

This flag should be set for packages that import pkg_resources
and thus need setuptools after the build step.

Set this flag for packages that need it and bump PKGREVISION.
   2022-01-04 21:55:40 by Thomas Klausner | Files touched by this commit (1595)
Log message:
*: bump PKGREVISION for egg.mk users

They now have a tool dependency on py-setuptools instead of a DEPENDS
   2021-10-26 13:23:42 by Nia Alarie | Files touched by this commit (1161)
Log message:
textproc: Replace RMD160 checksums with BLAKE2s checksums

All checksums have been double-checked against existing RMD160 and
SHA512 hashes

Unfetchable distfiles (fetched conditionally?):
./textproc/convertlit/distinfo clit18src.zip