{ "info": { "author": "Robert Blackwell", "author_email": "rob@whiteacorn.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7", "Topic :: System :: Systems Administration", "Topic :: Utilities" ], "description": "pyargs, Python Args Utility\n===========================\n\n``pyargs`` is a python cli program to run a series of scripts or\ncommands using multiple set or arguments provided from a file or stdin\nand to use more than one process to achieve some parallel execution.\n\nThe name is deliberately a play on ``xargs`` as pyargs is a simplified\nalternative to ``xargs``.\n\nThe motivation for this project was to get parallel execution of\ncommands where the output from each command invocation is kept in a\ncontigous block rather than being intermixed.\n\nTo make for easy replacement of ``xargs`` in existing scripts I used the\nsame general usage pattern as ``xargs`` and kept of few of the option\nshort names the same.\n\nI should offer an apology to the **python** community. This is my first\npython effort so there is probably a lot in this small project the is no\nvery ***pythonic***.\n\nUsage\n-----\n\n::\n\n usage: wg-runner.py [-h] [-v] [--in INFILE_PATH] [--out OUTFILE_PATH]\n [-n NARGS] [-P NPROCS] [--stream] [--debug] [--mark]\n [--lines]\n cmd [cmd_args [cmd_args ...]]\n\n Runs multiple instances of a command in parallel with different arguments.\n Think xargs.\n\n positional arguments:\n cmd Command to execute\n cmd_args Arguments for command to be used for every execution.\n If any of these are options like -c you might have to\n enclose them in quotes.\n\n optional arguments:\n -h, --help show this help message and exit\n -v, --version Prints the version number.\n --in INFILE_PATH Path to input file, each line has arguments for\n command. If not provided uses stdin.\n --out OUTFILE_PATH Path to output from all commands go to this file path.\n If not provided stdout.\n -n NARGS, --nargs NARGS\n Number of args to be found on each line of infile,\n default = 1.\n -P NPROCS, --nprocs NPROCS\n Number of parallel process, default = 1.\n --stream Treat input as a single string rather than a series of\n line for the purposes of tokenizing into arguments\n --debug Prints out the command to be executed rather than\n execute the command, to help problem solve\n --mark, -m Put markers in the output to make visible the start\n and output of each command.\n --lines, -L Send the output line by line rather than keep output\n frm each execution together.\n\nInstall\n-------\n\nUsing ``pip``\n\n::\n\n pip install pyargs\n\nAlternatively download or clone the `github\nrepo `__ and from the project\ndirectory\n\n::\n\n python setup.py install\n\nTesting\n-------\n\nPythonic testing is via\n\n::\n\n python setup.py test\n\nThere are only two test cases each of which reside in the\n``tests/test_pyargs.py``. These tests cases execute shell scripts\n\n::\n\n ./tests/end_to_end_test.sh\n\nand\n\n::\n\n ./tests/writer_to_reader_test.sh\n\n./tests/end_to_end_test.sh\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThis script executes multiple instances of ``./tests/writer_cmd.py``\nusing ``pyargs`` with arguments provided from ``tests/test_args``. The\noutput is piped into, and inspected by ``tests/reader_cmd.py`` which\nparses that output and verifies that it is as expected.\n\n./tests/writer_to_reader_test.sh\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nPipes the output form ``writer_cmd.py`` into ``reader_cmd.py`` to ensure\nthat the previous test is using valid test data.\n\nCommand options - a bit more detail\n-----------------------------------\n\nThe options ``--debug``, ``--mark``, ``--lines`` maybe require a little\nmore explanation.\n\nThe script ``./tests/ping_example.sh`` demonstrates the ``--line`` and\n``--mark`` options, and ``./tests/ping_example_nl_m.sh`` demonstrates\nthe ``--mark`` option without ``--lines``.\n\n- \u2013debug\n\n When set ``pyargs`` does not execute the commands but rather outputs\n the full command that would have been executed. This enables a user\n to see how ``pyargs`` has interpreted its options and input. This\n option can be helpful in debugging commands that fail.\n\n- \u2013lines\n\n The original motivation for ``pyargs`` was to keep all the output\n from a single command invocation in a single contiguous block.\n However this may not always be necessary so this option allows or\n requires that ``pyargs`` will print each line of output from command\n invocations as soon as possible without waiting for the command to\n complete. This means that lines from different command invocations\n can be intermixed. Though **note** that concurrent output is still\n coordinated to ensure that lines do not corrupt each other.\n\n In order that each line of output can be attributed to the command\n that created it, in this mode, each output line is prefixed with the\n command string of the command that caused the output.\n\n- \u2013mark\n\n Sometimes it is difficult to be sure that the output from different\n command invocations have not intermixed (this is when \u2013list is NOT\n set), particularly when many commands are being executed and each\n command generates a lot of output.\n\n To assist users examine such a situation the \\`\\ ``--mark`` options\n is provided.\n\n When ``--mark`` is set ``pyargs`` will modify the output in the\n following manner:\n\n - just before the execution of a command instance starts ``pyargs``\n will output a string like\n\n ::\n\n MARK: ===================\n\n - the output from each command invocation will be bracketed (that is\n have a additional marker line before and after the actual command\n output). This lines will look like this:\n\n ::\n\n START OUTPUT[]\n\n ...... output lines in here\n\n END OUTPUT[]\n\n These lines (between and including START and END) should be\n contiguous and should be the output from only one command and that\n command should be the one identified in the START and END lines\n (which or course should be the same command). If any of this is\n not the case you have found a bug in ``pyargs``.\n\nExamples\n--------\n\nThe two scripts ``tests/ping_example.sh`` and ``tests/curl_example.sh``\ndemonstrate the usage of ``pyargs``.\n\nNote that both these examples attempt to contact hosts/urls that do not\nexist and will hence timeout. Hence the output include error messages.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/robertoblackwell/pyargs.git", "keywords": "xargs", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pyargs", "package_url": "https://pypi.org/project/pyargs/", "platform": "", "project_url": "https://pypi.org/project/pyargs/", "project_urls": { "Homepage": "http://github.com/robertoblackwell/pyargs.git" }, "release_url": "https://pypi.org/project/pyargs/0.11.0/", "requires_dist": null, "requires_python": "", "summary": "A python script to run commands in parallel (think xargs and GNU parallel) without intermixing the output.", "version": "0.11.0" }, "last_serial": 3441016, "releases": { "0.10.0": [ { "comment_text": "", "digests": { "md5": "5a3583ef085ed942bb9875e044c8f582", "sha256": "eefc28083a69eb78ce9cd6854e38ee9ae1e55d57d18d0c486fba2b77bdf32a9d" }, "downloads": -1, "filename": "pyargs-0.10.0.tar.gz", "has_sig": false, "md5_digest": "5a3583ef085ed942bb9875e044c8f582", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19276, "upload_time": "2017-12-24T22:20:45", "url": "https://files.pythonhosted.org/packages/da/24/ad7aa958697e5dd3ad79da18a1bf17d6c3b36438f427f4d5844b3ca7f5b0/pyargs-0.10.0.tar.gz" } ], "0.11.0": [ { "comment_text": "", "digests": { "md5": "6504feea8d870128be32704a5eb15b2d", "sha256": "cbc910a7c9b737c5d42c180d7fa93f32b831f60b4df2153cdda9ddcc20425988" }, "downloads": -1, "filename": "pyargs-0.11.0.tar.gz", "has_sig": false, "md5_digest": "6504feea8d870128be32704a5eb15b2d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19276, "upload_time": "2017-12-24T22:21:45", "url": "https://files.pythonhosted.org/packages/e6/8b/8ff520b533090cb2acfa160e301005cd81ff9b127fc31e0d7769ce053df0/pyargs-0.11.0.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "4b97c3ebb9022371e8a6d2ae4e6d3518", "sha256": "bafe53fa4f7186fb0dcf1ad89439881d8a271abd9a841091b5e4d57e5067675a" }, "downloads": -1, "filename": "pyargs-0.6.0.tar.gz", "has_sig": false, "md5_digest": "4b97c3ebb9022371e8a6d2ae4e6d3518", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18053, "upload_time": "2017-12-24T21:51:33", "url": "https://files.pythonhosted.org/packages/c4/69/f724b2856d7612a19595c10db3cb17dd8735d931f19cfc070f77c4fa9d56/pyargs-0.6.0.tar.gz" } ], "0.7.0": [ { "comment_text": "", "digests": { "md5": "56823f11041714d09a9cee9254e73f09", "sha256": "5db8d8ba07f40880a574943784e66ccae5b6991ddcf5dbe8f536f52b5ac1de56" }, "downloads": -1, "filename": "pyargs-0.7.0.tar.gz", "has_sig": false, "md5_digest": "56823f11041714d09a9cee9254e73f09", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19147, "upload_time": "2017-12-24T22:02:59", "url": "https://files.pythonhosted.org/packages/86/09/8b5d7716de73315d855071a616a31ed894b28e90c8dac80b3e06e92eca32/pyargs-0.7.0.tar.gz" } ], "0.8.0": [ { "comment_text": "", "digests": { "md5": "4a024d15618815a0b22078ab644ef315", "sha256": "3ad7dbb4a67ae35aec53dabfd4d702fa5387803ea9fb51c0e794946ca8afb899" }, "downloads": -1, "filename": "pyargs-0.8.0.tar.gz", "has_sig": false, "md5_digest": "4a024d15618815a0b22078ab644ef315", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19174, "upload_time": "2017-12-24T22:06:47", "url": "https://files.pythonhosted.org/packages/70/64/3a41bf67bd11459688024cc381b289a3c5c4e9b97a9bf289a9ae46e74d04/pyargs-0.8.0.tar.gz" } ], "0.9.0": [ { "comment_text": "", "digests": { "md5": "b83263b0f440f5134496e7ab5e0c3d9e", "sha256": "19dfa1b10b81ea3feac3255a8875deb46d635f95283158ef984c8b7d72d05e8c" }, "downloads": -1, "filename": "pyargs-0.9.0.tar.gz", "has_sig": false, "md5_digest": "b83263b0f440f5134496e7ab5e0c3d9e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19173, "upload_time": "2017-12-24T22:09:33", "url": "https://files.pythonhosted.org/packages/97/19/3b33bfe828180235d6d88120de154ae89e1a0c9c7cc04f32ff386a49d4b3/pyargs-0.9.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6504feea8d870128be32704a5eb15b2d", "sha256": "cbc910a7c9b737c5d42c180d7fa93f32b831f60b4df2153cdda9ddcc20425988" }, "downloads": -1, "filename": "pyargs-0.11.0.tar.gz", "has_sig": false, "md5_digest": "6504feea8d870128be32704a5eb15b2d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19276, "upload_time": "2017-12-24T22:21:45", "url": "https://files.pythonhosted.org/packages/e6/8b/8ff520b533090cb2acfa160e301005cd81ff9b127fc31e0d7769ce053df0/pyargs-0.11.0.tar.gz" } ] }