Skip to main content

Easy access to shell commands from python

Project description

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

This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3, as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

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.4.tar.gz (15.1 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for whelk-2.4.tar.gz
Algorithm Hash digest
SHA256 3a53b27fcb42a1a5e657e4e33bab92617cfa6f2d93781a044f8196b02f45a69c
MD5 67d8e23c1693f705df538add179ab414
BLAKE2b-256 4c6bca58e4d2185d9626e9f49ce96c6fbc2272217b5d2c1ee1aadebc4ab3fd53

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