{ "info": { "author": "Jonathan Eunice", "author_email": "jonathan.eunice@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "========\nprefsort\n========\n\n\n.. image:: https://img.shields.io/pypi/v/prefsort.svg\n :target: https://pypi.python.org/pypi/prefsort\n\n.. image:: https://img.shields.io/travis/jonathaneunice/prefsort.svg\n :target: https://travis-ci.org/jonathaneunice/prefsort\n\n.. image:: https://readthedocs.org/projects/prefsort/badge/?version=latest\n :target: https://prefsort.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n.. image:: https://pyup.io/repos/github/jonathaneunice/prefsort/shield.svg\n :target: https://pyup.io/repos/github/jonathaneunice/prefsort/\n :alt: Updates\n\n\nPartially sort a sequence, preferring some values.\n\n.. code-block:: python\n\n from prefsort import prefsorted\n\n seq = list('abcde')\n\n seq2 = prefsorted(seq, 'c b')\n assert seq2 == ['c', 'b', 'a', 'd', 'e']\n\nNote that this doesn't sort the majority of the sequence in\nthe way Python's normal ``list.sort()`` or ``sorted()`` do.\nIt just pulls the preferred members to the front of the list.\n\nThis is particularly handy to have when organizing data columns,\nfor example with ``pandas``, the following will make sure the\nid and name columns come first in a DataFrame:\n\n.. code-block:: python\n\n df = df.reindex(columns=prefsorted(df.columns, 'id name'))\n\nThere is also a ``reverse`` parameter that will put the \"preferred\"\nitems at the end of the list. In this case it's a \"negative\npreference.\"\n\n.. code-block:: python\n\n seq2 = prefsorted(seq, 'c b', reverse=True)\n assert seq2 == ['a', 'd', 'e', 'c', 'b']\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jonathaneunice/prefsort", "keywords": "prefsort", "license": "Apache Software License 2.0", "maintainer": "", "maintainer_email": "", "name": "prefsort", "package_url": "https://pypi.org/project/prefsort/", "platform": "", "project_url": "https://pypi.org/project/prefsort/", "project_urls": { "Homepage": "https://github.com/jonathaneunice/prefsort" }, "release_url": "https://pypi.org/project/prefsort/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "Sort a sequence, preferring some values", "version": "0.1.0" }, "last_serial": 5383545, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "6b0fc913a49354f6e87fb29f320dfef8", "sha256": "24d6422792159b7883b5043fef2bb8a024caeac14d42dba5ef4b7c51736ff1a8" }, "downloads": -1, "filename": "prefsort-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6b0fc913a49354f6e87fb29f320dfef8", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3356, "upload_time": "2019-06-10T18:56:11", "url": "https://files.pythonhosted.org/packages/60/05/47d04003cbf0a136b6983df036e70112439e4252cd56411c486ea1cba3e1/prefsort-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "684cc2e05bc33a65c52ab6898b44b7b5", "sha256": "f5e1461b18dd82078fb5e11d19142c6b50ce33d964188e2b74d43617868359ef" }, "downloads": -1, "filename": "prefsort-0.0.1.tar.gz", "has_sig": false, "md5_digest": "684cc2e05bc33a65c52ab6898b44b7b5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3190, "upload_time": "2019-06-10T18:56:14", "url": "https://files.pythonhosted.org/packages/f9/2c/7041e801f82e82b6a16c616b88c63f7b8ea478cb5ab98185c51e3e7f3bf7/prefsort-0.0.1.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "68ce8ec5fa32119252d7f0714c24aa62", "sha256": "b27af30c1ee3ad86402cfffd0721872459d9eb53c06972c9de6fd0b7d4837edb" }, "downloads": -1, "filename": "prefsort-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "68ce8ec5fa32119252d7f0714c24aa62", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3404, "upload_time": "2019-06-10T21:36:24", "url": "https://files.pythonhosted.org/packages/b7/dd/c214416c70d68ccebbdf2e7392bd29f3a0c8cb8ffa3726f12ba2448bdb9f/prefsort-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d5c48727a144485dc83b2b75f7cb3457", "sha256": "22c1359cb59bde9c0af494fcd0ac241fd62302b5dfb9f875837ec41f0d2ddf3b" }, "downloads": -1, "filename": "prefsort-0.1.0.tar.gz", "has_sig": false, "md5_digest": "d5c48727a144485dc83b2b75f7cb3457", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3473, "upload_time": "2019-06-10T21:36:26", "url": "https://files.pythonhosted.org/packages/e9/8a/1b7680bb97af5088480a5d539834e7af40553e604f6947310ce870c5bc59/prefsort-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "68ce8ec5fa32119252d7f0714c24aa62", "sha256": "b27af30c1ee3ad86402cfffd0721872459d9eb53c06972c9de6fd0b7d4837edb" }, "downloads": -1, "filename": "prefsort-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "68ce8ec5fa32119252d7f0714c24aa62", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3404, "upload_time": "2019-06-10T21:36:24", "url": "https://files.pythonhosted.org/packages/b7/dd/c214416c70d68ccebbdf2e7392bd29f3a0c8cb8ffa3726f12ba2448bdb9f/prefsort-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d5c48727a144485dc83b2b75f7cb3457", "sha256": "22c1359cb59bde9c0af494fcd0ac241fd62302b5dfb9f875837ec41f0d2ddf3b" }, "downloads": -1, "filename": "prefsort-0.1.0.tar.gz", "has_sig": false, "md5_digest": "d5c48727a144485dc83b2b75f7cb3457", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3473, "upload_time": "2019-06-10T21:36:26", "url": "https://files.pythonhosted.org/packages/e9/8a/1b7680bb97af5088480a5d539834e7af40553e604f6947310ce870c5bc59/prefsort-0.1.0.tar.gz" } ] }