{ "info": { "author": "Michael Howitz", "author_email": "icemac@gmx.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Natural Language :: German", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Utilities" ], "description": "Nice, intelligent truncation of text.\n\n.. image:: https://travis-ci.com/icemac/icemac.truncatetext.svg?branch=master\n :target: https://travis-ci.com/icemac/icemac.truncatetext\n\n.. image:: https://coveralls.io/repos/github/icemac/icemac.truncatetext/badge.svg?branch=travis\n :target: https://coveralls.io/github/icemac/icemac.truncatetext?branch=travis\n\n.. image:: https://img.shields.io/pypi/v/icemac.truncatetext.svg\n :target: https://pypi.org/project/icemac.truncatetext/\n :alt: Current version on PyPI\n\n.. image:: https://img.shields.io/pypi/pyversions/icemac.truncatetext.svg\n :target: https://pypi.org/project/icemac.truncatetext/\n :alt: Supported Python versions\n\n\nFork me on: https://github.com/icemac/icemac.truncatetext\n\n\n.. contents::\n\nNicely truncate text\n====================\n\nIntelligent truncation of text means that truncation does not take\nplace inside a word but only between words. So the required length is\nonly an approximation. The result text might be a bit longer than the\nrequired length:\n\n >>> from icemac.truncatetext import truncate\n >>> 'I was here.'[:3]\n 'I w'\n >>> truncate('I was here.', 3)\n 'I was ...'\n\nWhat can get truncated?\n-----------------------\n\nOnly instances of ``basestring`` (``str`` on Python 3) can be truncated:\n\n >>> truncate(3, 3)\n Traceback (most recent call last):\n ValueError: 3 is no instance of basestring or None\n >>> print(truncate(u'Lorem ipsum', 5))\n Lorem ...\n\n``None`` is handled nicely:\n\n >>> truncate(None, 4)\n ''\n\nWhat is returned?\n-----------------\n\nAlways at least one word is returned even when it is longer than the\nrequired length:\n\n >>> truncate('Lorem ipsum', 1)\n 'Lorem ...'\n\nIf the text contains only of one word which is longer than the desired\nlength it is returned without an ellipsis:\n\n >>> truncate('The-really-long-word', 5)\n 'The-really-long-word'\n\nIf the text is shorter than the desired length it is returned without\nthe ellipsis, too:\n\n >>> truncate('Lorem ipsum', 11)\n 'Lorem ipsum'\n\nWhere gets the text truncated?\n------------------------------\n\nTruncation also takes place at tabs and linebreaks:\n\n >>> truncate(\"I was here.\\nNow I'm away\", 11)\n 'I was here. ...'\n >>> truncate(\"I was here.\\rNow I'm away\", 12)\n 'I was here.\\rNow ...'\n >>> truncate(\"I was here.\\tNow I'm away\", 11)\n 'I was here. ...'\n\nI do not want `...` as ellipsis.\n--------------------------------\n\n``truncate`` takes an optional argument which defines the ellipsis string:\n\n >>> print(truncate(u'Lorem ipsum', 5, ellipsis=u':::'))\n Lorem :::\n\n\n\nChangelog\n=========\n\n1.1.1 (2018-11-16)\n------------------\n\n- Move repository to Github.\n\n\n1.1 (2018-11-15)\n----------------\n\n- Add support for Python 3.7.\n\n\n1.0.post1 (2017-06-22)\n----------------------\n\n- Fix the `description` so PyPI accepts it.\n\n\n1.0 (2017-05-13)\n----------------\n\n- Add support for Python 3.4 up to 3.6, PyPy2 and PyPy3.\n\n- Drop support for Python 2.5 and 2.6.\n\n- Change license from ZPL to MIT.\n\n\n0.3 (2012-11-13)\n----------------\n\n- Moved sources to bitbucket.org.\n\n- Added Travis-CI.\n\n- Dropped official support for Python 2.3 and Python 2.4. (Although these\n rather old Python versions still might be used with this release.)\n\n\n0.2.1 (2011-07-28)\n------------------\n\n- Updated categories: Python 2.7 is supported, too.\n\n\n0.2 (2009-09-26)\n----------------\n\n- Added ability pass a string used as ellipsis string.\n\n\n0.1 (2009-01-31)\n----------------\n\n- Initial public release.\n\n\n\nHacking\n=======\n\nFork me on `bitbucket.org`_ or put your issues to the `issue tracker`_.\n\n.. .. image:: https://secure.travis-ci.org/icemac/icemac.truncatetext.png\n\n.. _`bitbucket.org` : https://bitbucket.org/icemac/icemac.truncatetext\n.. _`issue tracker` : https://bitbucket.org/icemac/icemac.truncatetext/issues\n\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/icemac/icemac.truncatetext", "keywords": "text truncate string intelligent", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "icemac.truncatetext", "package_url": "https://pypi.org/project/icemac.truncatetext/", "platform": "", "project_url": "https://pypi.org/project/icemac.truncatetext/", "project_urls": { "Homepage": "https://github.com/icemac/icemac.truncatetext" }, "release_url": "https://pypi.org/project/icemac.truncatetext/1.1.1/", "requires_dist": [ "setuptools" ], "requires_python": "", "summary": "Nice, intelligent truncation of text.", "version": "1.1.1" }, "last_serial": 4494852, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "773c3b52bd24a2f3c355c8550b2c7ce6", "sha256": "bee5c0b4bd04ae33fec25ded308e1847be3070812357a251634b7dde3ce3170a" }, "downloads": -1, "filename": "icemac.truncatetext-0.1.tar.gz", "has_sig": false, "md5_digest": "773c3b52bd24a2f3c355c8550b2c7ce6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3893, "upload_time": "2009-01-31T16:54:50", "url": "https://files.pythonhosted.org/packages/f4/e1/143a704e0c616718bb3e4ed7f3f7834b8c7d001978489524409123c6ccd5/icemac.truncatetext-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "ae53c20faa5dccdd148f61d01ad81a9b", "sha256": "efafd3f37c92093ea8ca1409da15692cc2e59b78b71285ed48613f3d506357eb" }, "downloads": -1, "filename": "icemac.truncatetext-0.2.tar.gz", "has_sig": false, "md5_digest": "ae53c20faa5dccdd148f61d01ad81a9b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4174, "upload_time": "2009-09-26T17:36:12", "url": "https://files.pythonhosted.org/packages/cc/83/632daf489b96ec46a6e066e7598cb1b879b598ec39d78abc60dccfc9d198/icemac.truncatetext-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "9861cbc4ed765f43f7f9516fcf6535cc", "sha256": "dea5fef29e43300bd33ed267780090ea1242df4a5434980aed61c2683f40acc4" }, "downloads": -1, "filename": "icemac.truncatetext-0.2.1.tar.gz", "has_sig": false, "md5_digest": "9861cbc4ed765f43f7f9516fcf6535cc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4247, "upload_time": "2011-07-28T14:22:31", "url": "https://files.pythonhosted.org/packages/b7/17/3c2a9fa238c5e8247f2fcd6f8f1a7f5712752df59e8aa9d7b46b84cb35ad/icemac.truncatetext-0.2.1.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "4245cfd9a809a01f5891847d1993db69", "sha256": "7881d87fe9ae320b0b4c5956b2a862f0aa219f74dbd9202033ce844688a785f2" }, "downloads": -1, "filename": "icemac.truncatetext-0.3.zip", "has_sig": false, "md5_digest": "4245cfd9a809a01f5891847d1993db69", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10604, "upload_time": "2012-11-13T10:20:45", "url": "https://files.pythonhosted.org/packages/4f/3d/8b06ab259bfb0a6bd0dfe583840ba5bd6e97bd447162f4572fc936c0cb85/icemac.truncatetext-0.3.zip" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "a4eb48a42e53922c51602a46a57faa61", "sha256": "49734710906325ffb87dd58f4809731037e237fe485d9d80c928d5a313aa743e" }, "downloads": -1, "filename": "icemac.truncatetext-1.0.tar.gz", "has_sig": false, "md5_digest": "a4eb48a42e53922c51602a46a57faa61", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4780, "upload_time": "2017-05-13T19:06:31", "url": "https://files.pythonhosted.org/packages/5f/f0/9237c66dad9039fc749fa2c7b3b719f0ec7b820b333b6de164d97991c6eb/icemac.truncatetext-1.0.tar.gz" } ], "1.0.post1": [ { "comment_text": "", "digests": { "md5": "e91ba3a324b8462b38ea49b2d8a5aa53", "sha256": "6d663c8356e2353f7caaff31ad35776bd12b3926bcadb047f41a5a99359a104e" }, "downloads": -1, "filename": "icemac.truncatetext-1.0.post1.tar.gz", "has_sig": false, "md5_digest": "e91ba3a324b8462b38ea49b2d8a5aa53", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5230, "upload_time": "2017-06-22T08:27:18", "url": "https://files.pythonhosted.org/packages/2a/d8/681fac776a9e0504314fee64d98ebee582e964113eec442393ccaef0b31b/icemac.truncatetext-1.0.post1.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "40fbf42ff0676ae8376e0c4e67a6fc63", "sha256": "1b0dd16d663189613d9f16c1f1850da77327fe8c9d0e7f430cc839e549c93c01" }, "downloads": -1, "filename": "icemac.truncatetext-1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "40fbf42ff0676ae8376e0c4e67a6fc63", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7398, "upload_time": "2018-11-15T11:06:18", "url": "https://files.pythonhosted.org/packages/8f/6e/03f07e10e23725c4bad7586ba513d1e54dd7fe3d367c9cdff630be736b1c/icemac.truncatetext-1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3e99ff21cd559953f84e4f1445cbb31b", "sha256": "34ffc92bc5e565686d8c06e66412e5bead2a8e37484dd4a8dd06f6a8a0e820cf" }, "downloads": -1, "filename": "icemac.truncatetext-1.1.tar.gz", "has_sig": false, "md5_digest": "3e99ff21cd559953f84e4f1445cbb31b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5239, "upload_time": "2018-11-15T11:06:20", "url": "https://files.pythonhosted.org/packages/45/fd/75dfdd33de3a919fb137860bcd315ff43c51f078cb8e1ed4cefd22ba381f/icemac.truncatetext-1.1.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "37b8cc171c89975f6fe710595a75089e", "sha256": "8f412e22a3c7c0ee92a084a0976fce66bdf91f2beb2efaa54fb4c1363004cf10" }, "downloads": -1, "filename": "icemac.truncatetext-1.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "37b8cc171c89975f6fe710595a75089e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7784, "upload_time": "2018-11-16T20:08:12", "url": "https://files.pythonhosted.org/packages/c0/13/416d89f9981c90a5d42d2866e9d08d78690e6788c68e1c03ed48a6649b26/icemac.truncatetext-1.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0f5d90d02c5d0543af2f54dc1c358bfe", "sha256": "7d8e0ff5ae1caa6b7e8bebb6122074d7fcc7c40259345a8f9e0eca2786cc4a18" }, "downloads": -1, "filename": "icemac.truncatetext-1.1.1.tar.gz", "has_sig": false, "md5_digest": "0f5d90d02c5d0543af2f54dc1c358bfe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5264, "upload_time": "2018-11-16T20:08:13", "url": "https://files.pythonhosted.org/packages/b3/55/1e5d31e2948da58193c769eff83bb675a001b439239cdf3ed1ab42aaac98/icemac.truncatetext-1.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "37b8cc171c89975f6fe710595a75089e", "sha256": "8f412e22a3c7c0ee92a084a0976fce66bdf91f2beb2efaa54fb4c1363004cf10" }, "downloads": -1, "filename": "icemac.truncatetext-1.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "37b8cc171c89975f6fe710595a75089e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7784, "upload_time": "2018-11-16T20:08:12", "url": "https://files.pythonhosted.org/packages/c0/13/416d89f9981c90a5d42d2866e9d08d78690e6788c68e1c03ed48a6649b26/icemac.truncatetext-1.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0f5d90d02c5d0543af2f54dc1c358bfe", "sha256": "7d8e0ff5ae1caa6b7e8bebb6122074d7fcc7c40259345a8f9e0eca2786cc4a18" }, "downloads": -1, "filename": "icemac.truncatetext-1.1.1.tar.gz", "has_sig": false, "md5_digest": "0f5d90d02c5d0543af2f54dc1c358bfe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5264, "upload_time": "2018-11-16T20:08:13", "url": "https://files.pythonhosted.org/packages/b3/55/1e5d31e2948da58193c769eff83bb675a001b439239cdf3ed1ab42aaac98/icemac.truncatetext-1.1.1.tar.gz" } ] }