Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python.announce > #2886

ANN: Version 0.1.5 of sarge (a subprocess wrapper library) has been released.

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Vinay Sajip <vinay_sajip@yahoo.co.uk>
Newsgroups comp.lang.python.announce
Subject ANN: Version 0.1.5 of sarge (a subprocess wrapper library) has been released.
Date Mon, 18 Jun 2018 11:17:15 +0000 (UTC)
Lines 58
Approved python-announce-list@python.org
Message-ID <mailman.16.1529321212.10552.python-announce-list@python.org> (permalink)
References <623045556.2285083.1529320635284.ref@mail.yahoo.com> <623045556.2285083.1529320635284@mail.yahoo.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
X-Trace news.uni-berlin.de Q0AXl3lChInolhIQefVQUAyeH/deZhbyvExNAsxlNGvA==
Return-Path <vinay_sajip@yahoo.co.uk>
X-Original-To python-announce-list@python.org
Delivered-To python-announce-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'patterns': 0.03; 'from:addr:yahoo.co.uk': 0.05; 'tries': 0.05; 'memory.': 0.07; 'pipe': 0.07; 'subject:ANN': 0.07; 'url-ip:104.192.143.1/32': 0.07; 'url-ip:104.192.143.2/32': 0.07; 'url-ip:104.192.143.3/32': 0.07; 'url-ip:104.192.143/24': 0.07; 'url-ip:104.192/16': 0.07; 'url:bitbucket': 0.07; 'oserror': 0.09; 'parsed': 0.09; 'released.': 0.09; 'stderr': 0.09; 'subject:library': 0.09; 'threads.': 0.09; 'valueerror': 0.09; 'api': 0.11; 'library': 0.11; 'useful,': 0.13; '3.3,': 0.16; 'bitbucket': 0.16; 'buffering': 0.16; 'echo': 0.16; 'found"': 0.16; 'pipelines': 0.16; 'quoted': 0.16; 'safely.': 0.16; 'shells': 0.16; 'subprocess': 0.16; '||,': 0.16; 'python': 0.16; 'argument': 0.17; 'versions': 0.19; 'install': 0.20; '&gt;&gt;&gt;': 0.21; '2.6': 0.21; '3.7': 0.21; 'replaced': 0.21; 'shell': 0.21; 'external': 0.22; '>>>': 0.23; '(not': 0.23; 'tracker': 0.23; 'tutorial': 0.23; 'syntax': 0.24; 'up.': 0.24; '3.6': 0.25; 'arguments': 0.25; 'windows': 0.26; 'fixed': 0.27; 'import': 0.27; 'lines': 0.27; 'command': 0.28; 'expected': 0.29; 'enough': 0.31; 'that.': 0.31; 'output': 0.31; 'compared': 0.31; 'correctly': 0.31; 'prevent': 0.31; 'requiring': 0.32; 'message.': 0.32; 'there.': 0.33; '"no': 0.33; 'simple.': 0.33; 'subset': 0.33; 'url:readthedocs': 0.33; 'wraps': 0.33; 'run': 0.33; 'ability': 0.34; 'filled': 0.35; 'easier': 0.36; 'but': 0.36; 'allows': 0.37; 'updated': 0.37; 'child': 0.37; 'hosted': 0.37; 'instead': 0.37; "there's": 0.38; 'to:addr:python-announce-list': 0.38; 'skip:s 30': 0.38; 'subject: (': 0.38; 'leave': 0.38; 'file': 0.38; 'example': 0.39; 'mac': 0.39; 'version': 0.39; 'url:org': 0.40; 'entire': 0.60; 'your': 0.60; 'received:77': 0.61; 'more': 0.61; 'cygwin': 0.62; 'features:': 0.62; 'injection': 0.62; 'syntax,': 0.62; 'windows,': 0.62; 'read': 0.62; 'information,': 0.62; 'capture': 0.63; 'leads': 0.63; 'received:77.238': 0.63; 'programs': 0.63; 'offers': 0.65; 'advantages': 0.70; 'avoid': 0.72; '(subject': 0.84; 'attacks.': 0.84; 'streams': 0.84; 'url- ip:162.209.114.75/32': 0.84; 'url-ip:162.209.114/24': 0.84; 'url- ip:162.209/16': 0.84; 'useful!': 0.84; 'alone.': 0.91; 'pfxlen:2': 0.93; 'received:consmr.mail.ir2.yahoo.com': 0.93
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1529320638; bh=V7xRQBM2AtTlPxVBaMBlzdBVrK6RM5WR11aSmEsOAN8=; h=Date:From:To:Subject:References:From:Subject; b=Jk04boAaqi8Vha5QrTSbEhepbWp9NTeOoQ8V0m7ooc8+zTyYQmv6cdtutK5hS5ZC1d0KWNbgGmNv83WvryaXkUGSiguXxsS2DoBRmmHuMEgGFcbPZuYRvulH/1+fXDUdTFMJuQT5feKYN6gEOEHD3eNPEX3WRw4srs61yHA+4tT+eOlpTm9KuXn8OJvzjnMjYkIURj/p3P6t6ktuSEFYuTrifEdWSccnqNt5EUVopb42wQlravg0rr11sKaQW9wXfbBe7Inwh64pWgDFt2/gr/s3J9EldRGN4GENeVu8wVJZIgNaOlc8GagYucNo/UN4iqp2HYcU4a7wFrU4C1oV6g==
X-YMail-OSG 64jmizIVM1kMVkXw_00hq4OhKTbS1dRFYm5OjlngVHVVv1GEI.ePN1IJXYUpxLo TlvXet0VfP_pGR582RGrEDsO03O7L_tvJhElAEXt7u9eOr55bJ9.bfaiRWG6ALXhGXYlo9Mw8kBI SnPWkvPtRIZg8wN4oafu93zAPl.afOXldKegrmZbZGc.osDR6KHNix7DQGq2Ubh_ukrW28MeO2ku p72LvAfHGKDoM7dXx41X.30gfjfDLqH.kKczXz21ehrE_UqoIO6.XCV6Q216eEcNVqPaahP2p9Ud EyoPrTxfJvdp9EttozsLd_671naGZbnUw_YFA5_GbBVQoK61cu76d0sPS887mhPqYpqcrxJaMoNQ JHF9FfzvZtCK_meIxejMzas64ghbybO9Py8Z_b467ibjhIrFRbbC2fjShEjPryU5xPnWSpT3DNhM qOrs_ASpVf2BJ6242rpUKA_i.0.xCbsb.6TFx1OL5Y9U48.TayE31Nvnr86RZTBKelSsO_FLHCkR su96K9NQv7kvxraq8xli2Vu2sA8dZql6P0N2jNs9UBXl1y3ThWuhvim99fqAmhlIVUEkVJuLukPC mmQ0TbQxs_l5bFKUDf22N4n4iCpHGu0tIbUibZjYxk3TrkUEXY2i4tUPG6UWYQnqFeooDhgUUKPk 0nxKjWjEIHR9UNQLdXRzVKLIKHaR6Du5226KTHap7XLP8aYLUBBggtHD7DoiCQPlgWovmcuRXewm .bPUiUvYPb5Ew6cAFAcZR.xS4i11i5Uxh5MD6mpeALmLX_4N0Cgkgqt6y1tbbxTIiUZDlNrCAr9M NbetrK7CdX3m8IPvWUh.wxR0NIL48dCm4R7WbSpswxfx01iT74gfMDZw6Tq44cXjsRdP7YjIitwY Z5F5rAbfN3xSbSvO85gMhI20S4GdW_soPJGhbldPOW7TMsvaUhVtKB_21MOqD9DiOw25FFWRWJyE qXc_RX3oWLw3jpUTOSA--
X-Mailer WebService/1.1.11988 YMailNorrin Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/66.0.3359.181 Chrome/66.0.3359.181 Safari/537.36
X-Mailman-Approved-At Mon, 18 Jun 2018 07:26:51 -0400
X-Content-Filtered-By Mailman/MimeDel 2.1.26
X-BeenThere python-announce-list@python.org
X-Mailman-Version 2.1.26
Precedence list
List-Id Announcement-only list for the Python programming language <python-announce-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-announce-list>, <mailto:python-announce-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-announce-list/>
List-Post <mailto:python-announce-list@python.org>
List-Help <mailto:python-announce-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-announce-list>, <mailto:python-announce-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID <623045556.2285083.1529320635284@mail.yahoo.com>
X-Mailman-Original-References <623045556.2285083.1529320635284.ref@mail.yahoo.com>
Xref csiph.com comp.lang.python.announce:2886

Show key headers only | View raw


Version 0.1.5 of Sarge, a cross-platform library which wraps the subprocessmodule in the standard library, has been released.
What changed?-------------
- Fixed #37: Instead of an OSError with a "no such file or directory" message,  a ValueError is raised with a more informative "Command not found" message.
- Fixed #38: Replaced ``async`` keyword argument with ``async_``, as ``async``  has become a keyword in Python 3.7.
- Fixed #39: Updated tutorial example on progress monitoring.
What does Sarge do?-------------------
Sarge tries to make interfacing with external programs from yourPython applications easier than just using subprocess alone.
Sarge offers the following features:
* A simple way to run command lines which allows a rich subset of Bash-style shell command syntax, but parsed and run by sarge so that youcan run on Windows without cygwin (subject to having those commandsavailable):
>>> from sarge import capture_stdout>>> p = capture_stdout('echo foo | cat; echo bar')>>> for line in p.stdout: print(repr(line))...'foo\n''bar\n'
* The ability to format shell commands with placeholders, such thatvariables are quoted to prevent shell injection attacks.
* The ability to capture output streams without requiring you toprogram your own threads. You just use a Capture object and then youcan read from it as and when you want.
* The ability to look for patterns in captured output and to interactaccordingly with the child process.
Advantages over subprocess---------------------------
Sarge offers the following benefits compared to using subprocess:
* The API is very simple.
* It's easier to use command pipelines - using subprocess out of thebox often leads to deadlocks because pipe buffers get filled up.
* It would be nice to use Bash-style pipe syntax on Windows, butWindows shells don't support some of the syntax which is useful, like&&, ||, |& and so on. Sarge gives you that functionality on Windows,without cygwin.
* Sometimes, subprocess.Popen.communicate() is not flexible enough forone's needs - for example, when one needs to process output a line ata time without buffering the entire output in memory.
* It's desirable to avoid shell injection problems by having theability to quote command arguments safely.
* subprocess allows you to let stderr be the same as stdout, but notthe other way around - and sometimes, you need to do that.
Python version and platform compatibility-----------------------------------------
Sarge is intended to be used on any Python version >= 2.6 and istested on Python versions 2.6, 2.7, 3.3, 3.4, 3.5, 3.6 and 3.7 on Linux,Windows, and Mac OS X (not all versions are tested on all platforms,but sarge is expected to work correctly on all these versions on allthese platforms).
Finding out more----------------
You can read the documentation at
http://sarge.readthedocs.org/
There's a lot more information, with examples, than I can put intothis post.
You can install Sarge using "pip install sarge" to try it out. Theproject is hosted on BitBucket at
https://bitbucket.org/vinay.sajip/sarge/
And you can leave feedback on the issue tracker there.
I hope you find Sarge useful!
Regards,
Vinay Sajip

Back to comp.lang.python.announce | Previous | Next | Find similar | Unroll thread


Thread

ANN: Version 0.1.5 of sarge (a subprocess wrapper library) has been released. Vinay Sajip <vinay_sajip@yahoo.co.uk> - 2018-06-18 11:17 +0000

csiph-web