{ "info": { "author": "Valentin Lab", "author_email": "valentin.lab@kalysto.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: Version Control" ], "description": "=========================\nkids.sh\n=========================\n\n\n.. image:: http://img.shields.io/pypi/v/kids.sh.svg?style=flat\n :target: https://pypi.python.org/pypi/kids.sh/\n :alt: Latest PyPI version\n\n.. image:: http://img.shields.io/travis/0k/kids.sh/master.svg?style=flat\n :target: https://travis-ci.org/0k/kids.sh/\n :alt: Travis CI build status\n\n.. image:: http://img.shields.io/coveralls/0k/kids.sh/master.svg?style=flat\n :target: https://coveralls.io/r/0k/kids.sh\n :alt: Test coverage\n\n\n``kids.sh`` is a Python library providing helpers when calling shell\ncommands thanks to python. It's part of 'Kids' (for Keep It Dead Simple)\nlibrary.\n\n\nMaturity\n========\n\nThis is Alpha release. More a place to store common librairies. Will\nperhaps evolve into something more consistent.\n\nIt is, for now, a very humble package.\n\n\nFeatures\n========\n\nusing ``kids.sh``:\n\n- Call ``wrap()`` when you want to call a system command and you don't\n have to bother about subprocess and other stuff. You get the standard\n output of the command as the return string.\n\nThese assumptions are in the code:\n\n- You don't want to deal with precise subprocess things, don't really need to\n care about security (because system command you launch are hard-written).\n- You don't need asynchronous code.\n\n\nInstallation\n============\n\nYou don't need to download the GIT version of the code as ``kids.sh`` is\navailable on the PyPI. So you should be able to run::\n\n pip install kids.sh\n\nIf you have downloaded the GIT sources, then you could add install\nthe current version via traditional::\n\n python setup.py install\n\nAnd if you don't have the GIT sources but would like to get the latest\nmaster or branch from github, you could also::\n\n pip install git+https://github.com/0k/kids.sh\n\nOr even select a specific revision (branch/tag/commit)::\n\n pip install git+https://github.com/0k/kids.sh@master\n\n\nUsage\n=====\n\n\nMore documentation is available in the code.\n\n\nwrap\n----\n\nIf command doesn't fail, standard output is returned::\n\n >>> from __future__ import print_function\n\n >>> from kids.sh import wrap\n >>> print(wrap('test \"$HELLO\" && echo \"foo\" || echo \"bar\"'))\n bar\n\n\nBut if command fails, then a special ``ShellError`` exception is cast::\n\n >>> wrap('test \"$HELLO\" && echo \"foo\" || { echo \"bar\" ; false ; }')\n Traceback (most recent call last):\n ...\n ShellError: Wrapped command returned with unexpected errorlevel.\n command: 'test \"$HELLO\" && echo \"foo\" || { echo \"bar\" ; false ; }'\n errlvl: 1\n stdout:\n | bar\n\nIf you provide a list instead of a string, no shell will be used to\ninterpret your command: the process and arguments will be sent\ndirectly to the system::\n\n >>> wrap([\"/bin/cat\", \"/tmp/should-not-exist-file-xxxx\"])\n Traceback (most recent call last):\n ...\n ShellError: Wrapped command returned with unexpected errorlevel.\n command: ['/bin/cat', '/should-not-exist-file-xxxx']\n errlvl: 1\n stderr:\n | /bin/cat: /tmp/should-not-exist-file-xxxx: No such file or directory\n\nNotice:\n\n- that a ``wrap(..)`` command will strip output (remove whitespaces\n and newlines from the beginning and the ending of the output). If\n you don't want this to happen, you can provide ``strip=False``.\n\n >>> from kids.sh import wrap\n >>> print(\"[%s]\" % wrap('echo \" foo \"'))\n [foo]\n >>> print(\"[%s]\" % wrap('echo \" foo \"', strip=False))\n [ foo ]\n\n- ``wrap(..)`` support nice exception message even when handling\n multi-line content (typically used for shell scripting)::\n\n >>> from kids.sh import wrap\n >>> print(wrap('''\n ... if [ \"bar\" ]; then\n ... echo \"foo\"\n ... exit 3\n ... else\n ... exit 4\n ... fi\n ... '''))\n Traceback (most recent call last):\n ...\n ShellError: Wrapped command returned with unexpected errorlevel.\n command:\n |\n | if [ \"bar\" ]; then\n | echo \"foo\"\n | exit 3\n | else\n | exit 4\n | fi\n |\n errlvl: 3\n stdout:\n | foo\n\n\ncmd\n---\n\nIf you would rather want to get all information from the command, you can\nuse ``cmd``::\n\n >>> from kids.sh import cmd\n\n >>> cmd('test \"$HELLO\" && echo \"foo\" || { echo \"bar\" ; false ; }')\n ShellOutput(out=...'bar\\n', err=...'', errlvl=1)\n\nSo, notice it doesn't cast any exception, but outputs a named tuple.\n\n``cmd(..)`` also support handling a list of arguments instead of a\ncommand string if you want to bypass shell interpretation::\n\n >>> cmd(['/bin/cat', '/file-does-not-exist-xxxx'])\n ShellOutput(out=...'', err=...'...', errlvl=1)\n\n\nContributing\n============\n\nAny suggestion or issue is welcome. Push request are very welcome,\nplease check out the guidelines.\n\n\nPush Request Guidelines\n-----------------------\n\nYou can send any code. I'll look at it and will integrate it myself in\nthe code base and leave you as the author. This process can take time and\nit'll take less time if you follow the following guidelines:\n\n- check your code with PEP8 or pylint. Try to stick to 80 columns wide.\n- separate your commits per smallest concern.\n- each commit should pass the tests (to allow easy bisect)\n- each functionality/bugfix commit should contain the code, tests,\n and doc.\n- prior minor commit with typographic or code cosmetic changes are\n very welcome. These should be tagged in their commit summary with\n ``!minor``.\n- the commit message should follow gitchangelog rules (check the git\n log to get examples)\n- if the commit fixes an issue or finished the implementation of a\n feature, please mention it in the summary.\n\nIf you have some questions about guidelines which is not answered here,\nplease check the current ``git log``, you might find previous commit that\nwould show you how to deal with your issue.\n\n\nLicense\n=======\n\nCopyright (c) 2018 Valentin Lab.\n\nLicensed under the `BSD License`_.\n\n.. _BSD License: http://raw.github.com/0k/kids.sh/master/LICENSE\n\nChangelog\n=========\n\n\n0.0.8 (2018-04-09)\n------------------\n\nChanges\n~~~~~~~\n- Removing ``swrap(..)`` in favor of ``strip=True`` keyword argument of\n ``wrap(..)``. [Valentin Lab]\n\n\n0.0.7 (2018-04-09)\n------------------\n\nNew\n~~~\n- Providing list of arguments to ``wrap``, ``swrap``, ``cmd`` allows to\n bypass shell. [Valentin Lab]\n- More docs about ``wrap(..)` and ``swrap(..)`` [Valentin Lab]\n\nFix\n~~~\n- Fixed typo. [Valentin Lab]\n\n\n0.0.6 (2015-03-12)\n------------------\n\nNew\n~~~\n- ``ShellError`` handles full output of failing shell command call.\n [Valentin Lab]\n\nFix\n~~~\n- [sh] ``set_env`` wouldn't properly set the environment variables.\n [Valentin Lab]\n\n\n0.0.5 (2015-02-06)\n------------------\n\nFix\n~~~\n- Restructured to avoid package ``.tests``. [Valentin Lab]\n\n\n0.0.2 (2015-02-06)\n------------------\n\nNew\n~~~\n- Added doc on ``cmd`` command. [Valentin Lab]\n- Provide testing facilities. [Valentin Lab]\n\n - introduction of ``set_env``\n - unittest base class ``BaseShTest``\n - using a namedtuple for truple from ``cmd``\n\n\n0.0.1 (2014-05-13)\n------------------\n- First import. [Valentin Lab]\n\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/0k/kids.sh", "keywords": "", "license": "BSD 3-Clause License", "maintainer": "", "maintainer_email": "", "name": "kids.sh", "package_url": "https://pypi.org/project/kids.sh/", "platform": "", "project_url": "https://pypi.org/project/kids.sh/", "project_urls": { "Homepage": "http://github.com/0k/kids.sh" }, "release_url": "https://pypi.org/project/kids.sh/0.0.8/", "requires_dist": [ "kids.txt", "kids.test", "kids.cache" ], "requires_python": "", "summary": "Kids shell command call wrapper", "version": "0.0.8" }, "last_serial": 3748682, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "d70a0a09f4a73e72902416f5568e3008", "sha256": "57ff0d0f95e86d996254c3a3e479e23e921396212e4af5987e4ee0e661329e9a" }, "downloads": -1, "filename": "kids.sh-0.0.1.tar.gz", "has_sig": false, "md5_digest": "d70a0a09f4a73e72902416f5568e3008", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4031, "upload_time": "2014-05-14T06:39:15", "url": "https://files.pythonhosted.org/packages/86/57/663378a92383dbdfb4746be6edc3b7ca2b5bfc2be80a875934933a175e26/kids.sh-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "1a120e1bb40310d563eeb75149f3f0ba", "sha256": "2de3f26fc2eda040c1cb261476dd8ac2b68ca7eb4293d16d9b213458e2b643de" }, "downloads": -1, "filename": "kids.sh-0.0.2.tar.gz", "has_sig": false, "md5_digest": "1a120e1bb40310d563eeb75149f3f0ba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6902, "upload_time": "2015-02-06T07:56:40", "url": "https://files.pythonhosted.org/packages/8c/3f/ab97669be4ad938dc0967d2e8bf9dce543905b3663d20c295d19672a15c7/kids.sh-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "a7e02060bc285b25ad699c29f043c623", "sha256": "af9f71c6767c3744d7555fe82ce9141cdc30db130b47b562ad031f9a353ad5de" }, "downloads": -1, "filename": "kids.sh-0.0.3.tar.gz", "has_sig": false, "md5_digest": "a7e02060bc285b25ad699c29f043c623", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6902, "upload_time": "2015-02-06T09:23:22", "url": "https://files.pythonhosted.org/packages/b0/de/c51939a9193e5a3f4ea6848cca2e14ca97b26b800313ceee4d0964c9dad2/kids.sh-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "ed7d7d429eee6c420cb62e6317171580", "sha256": "4ccfaaa4869db581605f0119e3ce39e116f7bc6c5941b60f156ad20ddf5f76a1" }, "downloads": -1, "filename": "kids.sh-0.0.4.tar.gz", "has_sig": false, "md5_digest": "ed7d7d429eee6c420cb62e6317171580", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7571, "upload_time": "2015-02-06T09:55:38", "url": "https://files.pythonhosted.org/packages/56/21/b5a46d026c3a40f1464c57d335bad15826621658987f356a2bd183238704/kids.sh-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "2e6b6adc32f38a4ce23090c0611b9828", "sha256": "ad2693444ab068a01d9d8c9361f1dab515512a8cac6bca24a3121741bf309bcd" }, "downloads": -1, "filename": "kids.sh-0.0.5.tar.gz", "has_sig": false, "md5_digest": "2e6b6adc32f38a4ce23090c0611b9828", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7572, "upload_time": "2015-02-06T10:45:35", "url": "https://files.pythonhosted.org/packages/f8/63/aa76d5300da198ed830f1a9186f83b9b74af1a32fe00d8304a340a9e5a86/kids.sh-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "ec5fd4eb22595b514e0516fd0053ad0e", "sha256": "485ecc91ec67ffa3db4b4143b76848d64dcdb8e91f7fcb08a65ed419df300598" }, "downloads": -1, "filename": "kids.sh-0.0.6.tar.gz", "has_sig": false, "md5_digest": "ec5fd4eb22595b514e0516fd0053ad0e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7687, "upload_time": "2015-03-13T01:55:52", "url": "https://files.pythonhosted.org/packages/77/fe/aa07502365afc78c06a048d83b3595120791c8e2b94d032be894b1c004b7/kids.sh-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "4cc0e3aebfead825abae1b576a4d6fc5", "sha256": "98306b70e382e31cc9ca42460dccd720e48c7b814a1357bffb8851223455de54" }, "downloads": -1, "filename": "kids.sh-0.0.7-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4cc0e3aebfead825abae1b576a4d6fc5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11837, "upload_time": "2018-04-09T12:59:53", "url": "https://files.pythonhosted.org/packages/58/e4/9b0f8e9db7fbc7295f99beac51e63e64571de1df5d73155e0087088f759c/kids.sh-0.0.7-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a20c24ba9962cd9e876ff117dab7b954", "sha256": "b88f78e0c027fa70179d4cb661f34a9951a741717f63f15ffff7ba7f49e17633" }, "downloads": -1, "filename": "kids.sh-0.0.7.tar.gz", "has_sig": false, "md5_digest": "a20c24ba9962cd9e876ff117dab7b954", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8531, "upload_time": "2018-04-09T12:59:54", "url": "https://files.pythonhosted.org/packages/6c/db/41be8f3346ef739f2f95c2b483d4ed1711ff5978ebc33c9ea02a44965540/kids.sh-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "edef4c51cb2da19f0c7e961e99480bd9", "sha256": "860d9a5178cec6925bad5b7c0281be6dbe5e58917cc1714deccbc56274e09a14" }, "downloads": -1, "filename": "kids.sh-0.0.8-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "edef4c51cb2da19f0c7e961e99480bd9", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 12013, "upload_time": "2018-04-09T13:28:44", "url": "https://files.pythonhosted.org/packages/40/ba/7c1524320d5e063f51e46b2ff97f50fc56dfa24673b153e4f23664dc2292/kids.sh-0.0.8-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "64ad358663c41e83b15c547024ce3c8d", "sha256": "a0b3572b5ba65cb2e8f61148fb3eba73e6887ed0770b4a6184c42f7a8282719f" }, "downloads": -1, "filename": "kids.sh-0.0.8.tar.gz", "has_sig": false, "md5_digest": "64ad358663c41e83b15c547024ce3c8d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8622, "upload_time": "2018-04-09T13:28:47", "url": "https://files.pythonhosted.org/packages/f4/ab/f2aba5c11dbfe0030ccfd896754373c8180cba609d46ae60bcf7bfc1d9ce/kids.sh-0.0.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "edef4c51cb2da19f0c7e961e99480bd9", "sha256": "860d9a5178cec6925bad5b7c0281be6dbe5e58917cc1714deccbc56274e09a14" }, "downloads": -1, "filename": "kids.sh-0.0.8-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "edef4c51cb2da19f0c7e961e99480bd9", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 12013, "upload_time": "2018-04-09T13:28:44", "url": "https://files.pythonhosted.org/packages/40/ba/7c1524320d5e063f51e46b2ff97f50fc56dfa24673b153e4f23664dc2292/kids.sh-0.0.8-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "64ad358663c41e83b15c547024ce3c8d", "sha256": "a0b3572b5ba65cb2e8f61148fb3eba73e6887ed0770b4a6184c42f7a8282719f" }, "downloads": -1, "filename": "kids.sh-0.0.8.tar.gz", "has_sig": false, "md5_digest": "64ad358663c41e83b15c547024ce3c8d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8622, "upload_time": "2018-04-09T13:28:47", "url": "https://files.pythonhosted.org/packages/f4/ab/f2aba5c11dbfe0030ccfd896754373c8180cba609d46ae60bcf7bfc1d9ce/kids.sh-0.0.8.tar.gz" } ] }