This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Wrapper for doing beautiful commands

Project Description

Capris is a MIT-licensed Python library built for writing composable apps that leverage the command line.

A simple example of writing your own git wrapper, complete with other command-line utilities that you love and use on a daily basis:

>>> from capris import Command
>>> git, grep = Command('git'), Command('grep')

>>> pipe = git.log(n=10, pretty="oneline") | grep(r'[a-f0-9]\{40\}', o=None)
>>> str(pipe)
"git log -n 10 --pretty=oneline | grep -o [a-f0-9]\{40\}"

>>> response = pipe.run()
>>> response.status_code
0
>>> print response.std_out
...

capris allows you to write code or tests that just calls commands and helps you focus on writing the commands that you need, not the code required to handle calling and getting responses from the commands. capris does all of the mucking around with strings and escaping for you.

Features

  • Built in support for pipes
  • DSL for command generation
  • Elegant responses and environment variables
  • High-level unit tests for all classes
  • Safe- capris doesn’t touch the shell
  • Smart option generation
  • Support for nested subcommands
  • Thread safety
  • Transactions and redirection
  • Works with both Python 2 and 3

Installation

To install Capris, simply:

$ pip install capris
Release History

Release History

This version
History Node

0.0.79

History Node

0.0.49

History Node

0.0.48

History Node

0.0.47

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
capris-0.0.79.tar.gz (7.5 kB) Copy SHA256 Checksum SHA256 Source Jul 4, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting