pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/textproc Add py-natsort 5.0.1 - Natural sorting for Py...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/494044d36166
branches:  trunk
changeset: 355402:494044d36166
user:      jdolecek <jdolecek%pkgsrc.org@localhost>
date:      Wed Nov 30 14:13:48 2016 +0000

description:
Add py-natsort 5.0.1 - Natural sorting for Python

based on wip version

diffstat:

 textproc/Makefile            |   3 +-
 textproc/py-natsort/DESCR    |  25 +++++++++++++++++++++++
 textproc/py-natsort/Makefile |  18 +++++++++++++++++
 textproc/py-natsort/PLIST    |  46 ++++++++++++++++++++++++++++++++++++++++++++
 textproc/py-natsort/distinfo |   6 +++++
 5 files changed, 97 insertions(+), 1 deletions(-)

diffs (129 lines):

diff -r 78ebc5c55d9f -r 494044d36166 textproc/Makefile
--- a/textproc/Makefile Wed Nov 30 13:46:24 2016 +0000
+++ b/textproc/Makefile Wed Nov 30 14:13:48 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.898 2016/11/23 09:26:31 wiz Exp $
+# $NetBSD: Makefile,v 1.899 2016/11/30 14:13:48 jdolecek Exp $
 #
 
 COMMENT=       Text processing utilities (does not include desktop publishing)
@@ -743,6 +743,7 @@
 SUBDIR+=       py-mkdocs
 SUBDIR+=       py-mkdocs-bootstrap
 SUBDIR+=       py-mkdocs-bootswatch
+SUBDIR+=       py-natsort
 SUBDIR+=       py-numpydoc
 SUBDIR+=       py-openpyxl
 SUBDIR+=       py-pdf-parser
diff -r 78ebc5c55d9f -r 494044d36166 textproc/py-natsort/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/textproc/py-natsort/DESCR Wed Nov 30 14:13:48 2016 +0000
@@ -0,0 +1,25 @@
+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. Here are some other things you can do with natsort (please
+see the examples for a quick start guide, or the api for more
+details).
diff -r 78ebc5c55d9f -r 494044d36166 textproc/py-natsort/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/textproc/py-natsort/Makefile      Wed Nov 30 14:13:48 2016 +0000
@@ -0,0 +1,18 @@
+# $NetBSD: Makefile,v 1.1 2016/11/30 14:13:48 jdolecek Exp $
+
+DISTNAME=          natsort-5.0.1
+PKGNAME=           ${PYPKGPREFIX}-${DISTNAME}
+CATEGORIES=        textproc python
+MASTER_SITES=  ${MASTER_SITE_PYPI:=n/natsort/}
+
+MAINTAINER=    kamelderouiche%yahoo.com@localhost
+HOMEPAGE=      https://github.com/SethMMorton/natsort
+COMMENT=       Natural sorting for python
+LICENSE=       mit
+
+WRKSRC=                ${WRKDIR}/natsort-5.0.1
+
+USE_LANGUAGES= # none
+
+.include "../../lang/python/egg.mk"
+.include "../../mk/bsd.pkg.mk"
\ No newline at end of file
diff -r 78ebc5c55d9f -r 494044d36166 textproc/py-natsort/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/textproc/py-natsort/PLIST Wed Nov 30 14:13:48 2016 +0000
@@ -0,0 +1,46 @@
+@comment $NetBSD: PLIST,v 1.1 2016/11/30 14:13:48 jdolecek Exp $
+bin/natsort
+${PYSITELIB}/${EGG_INFODIR}/PKG-INFO
+${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt
+${PYSITELIB}/${EGG_INFODIR}/dependency_links.txt
+${PYSITELIB}/${EGG_INFODIR}/entry_points.txt
+${PYSITELIB}/${EGG_INFODIR}/top_level.txt
+${PYSITELIB}/natsort/__init__.py
+${PYSITELIB}/natsort/__init__.pyc
+${PYSITELIB}/natsort/__init__.pyo
+${PYSITELIB}/natsort/__main__.py
+${PYSITELIB}/natsort/__main__.pyc
+${PYSITELIB}/natsort/__main__.pyo
+${PYSITELIB}/natsort/_version.py
+${PYSITELIB}/natsort/_version.pyc
+${PYSITELIB}/natsort/_version.pyo
+${PYSITELIB}/natsort/compat/__init__.py
+${PYSITELIB}/natsort/compat/__init__.pyc
+${PYSITELIB}/natsort/compat/__init__.pyo
+${PYSITELIB}/natsort/compat/fake_fastnumbers.py
+${PYSITELIB}/natsort/compat/fake_fastnumbers.pyc
+${PYSITELIB}/natsort/compat/fake_fastnumbers.pyo
+${PYSITELIB}/natsort/compat/fastnumbers.py
+${PYSITELIB}/natsort/compat/fastnumbers.pyc
+${PYSITELIB}/natsort/compat/fastnumbers.pyo
+${PYSITELIB}/natsort/compat/locale.py
+${PYSITELIB}/natsort/compat/locale.pyc
+${PYSITELIB}/natsort/compat/locale.pyo
+${PYSITELIB}/natsort/compat/pathlib.py
+${PYSITELIB}/natsort/compat/pathlib.pyc
+${PYSITELIB}/natsort/compat/pathlib.pyo
+${PYSITELIB}/natsort/compat/py23.py
+${PYSITELIB}/natsort/compat/py23.pyc
+${PYSITELIB}/natsort/compat/py23.pyo
+${PYSITELIB}/natsort/natsort.py
+${PYSITELIB}/natsort/natsort.pyc
+${PYSITELIB}/natsort/natsort.pyo
+${PYSITELIB}/natsort/ns_enum.py
+${PYSITELIB}/natsort/ns_enum.pyc
+${PYSITELIB}/natsort/ns_enum.pyo
+${PYSITELIB}/natsort/unicode_numbers.py
+${PYSITELIB}/natsort/unicode_numbers.pyc
+${PYSITELIB}/natsort/unicode_numbers.pyo
+${PYSITELIB}/natsort/utils.py
+${PYSITELIB}/natsort/utils.pyc
+${PYSITELIB}/natsort/utils.pyo
diff -r 78ebc5c55d9f -r 494044d36166 textproc/py-natsort/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/textproc/py-natsort/distinfo      Wed Nov 30 14:13:48 2016 +0000
@@ -0,0 +1,6 @@
+$NetBSD: distinfo,v 1.1 2016/11/30 14:13:48 jdolecek Exp $
+
+SHA1 (natsort-5.0.1.tar.gz) = 25e8fb806c7667d564d8881d257fc7222803d6ad
+RMD160 (natsort-5.0.1.tar.gz) = 53c8a553c00fad5bb47591fc79a886d98a6eff46
+SHA512 (natsort-5.0.1.tar.gz) = a183558b8a4be6300400b2efed901fb515efce4bb340b3bdda723f6a628aa05ad2f9e1f2c696afa3970e0c82aca47ea597985a1c6c971517ee3bf759f25241bd
+Size (natsort-5.0.1.tar.gz) = 68053 bytes



Home | Main Index | Thread Index | Old Index