{ "info": { "author": "Valentin Lab", "author_email": "valentin.lab@kalysto.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Topic :: Software Development", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "=========================\r\nkids.txt\r\n=========================\r\n\r\n.. image:: http://img.shields.io/pypi/v/kids.txt.svg?style=flat\r\n :target: https://pypi.python.org/pypi/kids.txt/\r\n :alt: Latest PyPI version\r\n\r\n.. image:: http://img.shields.io/pypi/dm/kids.txt.svg?style=flat\r\n :target: https://pypi.python.org/pypi/kids.txt/\r\n :alt: Number of PyPI downloads\r\n\r\n.. image:: http://img.shields.io/travis/0k/kids.txt/master.svg?style=flat\r\n :target: https://travis-ci.org/0k/kids.txt/\r\n :alt: Travis CI build status\r\n\r\n.. image:: http://img.shields.io/coveralls/0k/kids.txt/master.svg?style=flat\r\n :target: https://coveralls.io/r/0k/kids.txt\r\n :alt: Test coverage\r\n\r\n\r\n``kids.txt`` is a Python library providing helpers to manage text.\r\nIt's part of 'Kids' (for Keep It Dead Simple) library.\r\n\r\nIt is, for now, a very humble package.\r\n\r\n\r\nFeatures\r\n========\r\n\r\nusing ``kids.txt``:\r\n\r\n- You'll have a ``indent`` / ``dedent`` / ``shorten`` command also in python 2.\r\n- You'll be able to ``wrap`` text keeping the paragraph separated.\r\n- minor helper like ``ucfirst`` function.\r\n- produce unified diffs between 2 strings easily with ``udiff``.\r\n\r\n\r\nInstallation\r\n============\r\n\r\nYou don't need to download the GIT version of the code as ``kids.txt`` is\r\navailable on the PyPI. So you should be able to run::\r\n\r\n pip install kids.txt\r\n\r\nIf you have downloaded the GIT sources, then you could add install\r\nthe current version via traditional::\r\n\r\n python setup.py install\r\n\r\nAnd if you don't have the GIT sources but would like to get the latest\r\nmaster or branch from github, you could also::\r\n\r\n pip install git+https://github.com/0k/kids.txt\r\n\r\nOr even select a specific revision (branch/tag/commit)::\r\n\r\n pip install git+https://github.com/0k/kids.txt@master\r\n\r\n\r\nUsage\r\n=====\r\n\r\n\r\nindent\r\n------\r\n\r\nYou can easily indent text with::\r\n\r\n >>> from __future__ import print_function\r\n >>> from kids import txt\r\n\r\n >>> string = 'This is first line.\\nThis is second line\\n'\r\n\r\n >>> print(txt.indent(string, prefix=\"| \"))\r\n | This is first line.\r\n | This is second line\r\n |\r\n\r\n\r\ndedent\r\n------\r\n\r\nYou can also dedent text::\r\n\r\n >>> print(txt.dedent(\r\n ... '''This is a doc\r\n ...\r\n ... with fancy indentation, that should just work also.\r\n ... Without removing too much neither as:\r\n ... - more space.'''))\r\n This is a doc\r\n \r\n with fancy indentation, that should just work also.\r\n Without removing too much neither as:\r\n - more space.\r\n\r\n\r\nparagrap_wrap\r\n-------------\r\n\r\nWrap paragraph separately::\r\n\r\n >>> string = 'This is first paragraph which is quite long don\\'t you \\\r\n ... think ? Well, I think so.\\n\\nThis is second paragraph\\n'\r\n\r\n >>> print(txt.paragraph_wrap(string))\r\n This is first paragraph which is quite long don't you think ? Well, I\r\n think so.\r\n This is second paragraph\r\n\r\n Notice that that each paragraph has been wrapped separately.\r\n\r\n\r\nucfirst\r\n-------\r\n\r\nThis function will return the given string with the first character forced to\r\nuppercase::\r\n\r\n >>> txt.ucfirst('foo')\r\n 'Foo'\r\n\r\n\r\nshorten\r\n-------\r\n\r\nThis function will truncate the given string to the given length, if necessary. It'll\r\nreplace the last 2 characters by a '..' to indicate truncation::\r\n\r\n >>> txt.shorten('fool', l=5)\r\n 'fool'\r\n >>> txt.shorten('supercalifragilisticexpialidocious', l=5)\r\n 'sup..'\r\n\r\n\r\nudiff\r\n-----\r\n\r\nShows the unified diff between to text::\r\n\r\n >>> print(txt.udiff('a\\n\\nc', 'b\\n\\nc'))\r\n --- None\r\n +++ None\r\n @@ -1,3 +1,3 @@\r\n -a\r\n +b\r\n \r\n c\r\n \r\n\r\n\r\nContributing\r\n============\r\n\r\nAny suggestion or issue is welcome. Push request are very welcome,\r\nplease check out the guidelines.\r\n\r\n\r\nPush Request Guidelines\r\n-----------------------\r\n\r\nYou can send any code. I'll look at it and will integrate it myself in\r\nthe code base and leave you as the author. This process can take time and\r\nit'll take less time if you follow the following guidelines:\r\n\r\n- check your code with PEP8 or pylint. Try to stick to 80 columns wide.\r\n- separate your commits per smallest concern.\r\n- each commit should pass the tests (to allow easy bisect)\r\n- each functionality/bugfix commit should contain the code, tests,\r\n and doc.\r\n- prior minor commit with typographic or code cosmetic changes are\r\n very welcome. These should be tagged in their commit summary with\r\n ``!minor``.\r\n- the commit message should follow gitchangelog rules (check the git\r\n log to get examples)\r\n- if the commit fixes an issue or finished the implementation of a\r\n feature, please mention it in the summary.\r\n\r\nIf you have some questions about guidelines which is not answered here,\r\nplease check the current ``git log``, you might find previous commit that\r\nwould show you how to deal with your issue.\r\n\r\n\r\nLicense\r\n=======\r\n\r\nCopyright (c) 2015 Valentin Lab.\r\n\r\nLicensed under the `BSD License`_.\r\n\r\n.. _BSD License: http://raw.github.com/0k/kids.txt/master/LICENSE\r\n\r\nChangelog\r\n=========\r\n\r\n0.0.2 (2015-02-04)\r\n------------------\r\n\r\nNew\r\n~~~\r\n\r\n- Added ``udiff`` to get unified diffs of strings. [Valentin Lab]\r\n\r\n- Added ``ucfirst`` and ``shorten``. [Valentin Lab]\r\n\r\n- Added a ``dedent()`` function. [Valentin Lab]\r\n\r\nFix\r\n~~~\r\n\r\n- ``indent`` would ignore ``first`` set to empty string. [Valentin Lab]\r\n\r\n\r\n0.0.1 (2014-05-13)\r\n------------------\r\n\r\n- First import. [Valentin Lab]", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/0k/kids.txt", "keywords": "", "license": "UNKNOWN", "maintainer": "", "maintainer_email": "", "name": "kids.txt", "package_url": "https://pypi.org/project/kids.txt/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/kids.txt/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/0k/kids.txt" }, "release_url": "https://pypi.org/project/kids.txt/0.0.2/", "requires_dist": null, "requires_python": null, "summary": "Kids text manipulation helpers.", "version": "0.0.2" }, "last_serial": 1409350, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "9077a44cf64fecb872c13fb3dfe7c684", "sha256": "99d04dd54e94df8189cd78db3d4affa30a812ec9698d71cb1e3a98fc153a0300" }, "downloads": -1, "filename": "kids.txt-0.0.1.tar.gz", "has_sig": false, "md5_digest": "9077a44cf64fecb872c13fb3dfe7c684", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3317, "upload_time": "2014-05-13T21:32:40", "url": "https://files.pythonhosted.org/packages/58/b3/c04b38f5984279dc0a2f6b00c4c9ea367d69cad6c6f6820a100a663de4b2/kids.txt-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "28581aabc3aaa11932615814d1a4d5c5", "sha256": "231d8a2f00ba24f71f818c0d417efaa711b0694a9d38ccd9e34c2f022888a75d" }, "downloads": -1, "filename": "kids.txt-0.0.2.tar.gz", "has_sig": false, "md5_digest": "28581aabc3aaa11932615814d1a4d5c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6109, "upload_time": "2015-02-04T12:29:31", "url": "https://files.pythonhosted.org/packages/af/ad/fb29638e8325170496492d3ccfacd4215162b076a52a5ba63e0f10669082/kids.txt-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "28581aabc3aaa11932615814d1a4d5c5", "sha256": "231d8a2f00ba24f71f818c0d417efaa711b0694a9d38ccd9e34c2f022888a75d" }, "downloads": -1, "filename": "kids.txt-0.0.2.tar.gz", "has_sig": false, "md5_digest": "28581aabc3aaa11932615814d1a4d5c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6109, "upload_time": "2015-02-04T12:29:31", "url": "https://files.pythonhosted.org/packages/af/ad/fb29638e8325170496492d3ccfacd4215162b076a52a5ba63e0f10669082/kids.txt-0.0.2.tar.gz" } ] }