Skip to main content

Customizes your Python shell.

Project description

konch is a utility libary and command line interface for creating custom Python shells.

  • Automatically import any object upon startup

  • Per-project configuration

  • Compatible with IPython and BPython (automatically falls back to built-in interpreter)

Screencast

https://dl.dropboxusercontent.com/u/1693233/github/Screenshot%202014-03-14%2001.21.31.png

Get it now

$ pip install konch

Get started

Just use the konch command to run your interactive Python interpreter.

$ konch init
$ konch

To customize your shell environment, edit the .konchrc file created when you ran konch init.

.konchrc is just a regular Python file that calls the konch.config(config_dict) function.

You can pass any of the following options:

  • context: A dictionary of objects that will be available to you in your shell session.

  • shell: Default shell to use. May be konch.IPythonShell, konch.BPythonShell, konch.PythonShell, or konch.AutoShell (default).

  • banner: Custom banner text to show.

Here is an example .konchrc file that includes some functions from the requests library in its context.

import konch
import requests

konch.config({
    'context': {
        'httpget': requests.get,
        'httppost': requests.post,
        'httpput': requests.put,
        'httpdelete': requests.delete
    },
    'banner': 'A humanistic HTTP shell'
})

For more examples, see the example_rcfiles directory.

For more info on available command-line options, run konch --help.

Requirements

  • Python 2 or 3 (tested on 2.6, 2.7, 3.2, 3.3)

License

MIT licensed. See the bundled LICENSE file for more details.

Changelog

0.1.0 (2014-03-14)

  • First release to PyPI.

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

konch-0.1.0.tar.gz (12.0 kB view hashes)

Uploaded Source

Supported by

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