Skip to main content

Easy access to shell commands from python

Project description

Pretending python is a shell
============================

We all like python for scripting, because it's so much more powerful than a
shell. But sometimes we really need to call a shell command because it's so
much easier than writing yet another library in python or adding a dependency::

from whelk import shell
shell.zgrep("-r", "downloads", "/var/log/httpd")
# Here goes code to process the log

You can even pipe commands together::

from whelk import pipe
pipe(pipe.getent("group") | pipe.grep(":1...:"))

Much more usage info can de found at http://seveas.github.io/whelk/

Installing
----------

Installing the latest released version is as simple as::

pip install whelk

If you want to tinker with the source, you can install the latest source from
github::

git clone https://github.com/seveas/whelk.git

And finally, Ubuntu users can install whelk from my ppa::

sudo apt-add-repository ppa:dennis/python
sudo apt-get update
sudo apt-get install python-whelk python3-whelk

License
-------
Copyright (c) 2010-2015 Dennis Kaarsemaker <dennis@kaarsemaker.net>
All rights reserved.

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

whelk-2.6.tar.gz (15.0 kB view details)

Uploaded Source

File details

Details for the file whelk-2.6.tar.gz.

File metadata

  • Download URL: whelk-2.6.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for whelk-2.6.tar.gz
Algorithm Hash digest
SHA256 44a4317a0971c7cdc3ed7463714a59dd541b8e6857a40586ed516f656ed4c3f0
MD5 0b53bd812ebc08dc4215bf3511fe2477
BLAKE2b-256 11578d14f349063a61a1491544d5fdc5446bf8d050807ea4a59f1ca768ebea99

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page