python, stackoverflow, tutorial

4 Command-line tools for more Python productivity

Hi there folks. In this post I would be sharing a couple of command-line tools which can help to increase your python productivity. These tools have helped me a lot and might help you as well! This post is inspired by another post.

1. IPython

IPython is the Python REPL on steroids. It has some really nice editions on top of the standard REPL. I am sure that if you use it once you will fall in love with it. The easiest way to install IPython is using pip:

$ pip install ipython

Now you can use it by typing this in your terminal:

$ ipython

You can read more about the nice features and tricks of IPython over here.

You can also automatically import modules when you enter the Python or IPython interpreter. Here is the Stackoverflow link which shows you how to do it.

more information.


2. Autoenv

This is a simple tool built by Kenneth Reitz. It allows you to automatically activate your projects virtual environment.

You can install it using pip:

$ pip install autoenv

You can also use git:

$ git clone git:// ~/.autoenv
$ echo 'source ~/.autoenv/' >> ~/.bashrc

And if you are on Mac OSX then Homebrew is also an option:

$ brew install autoenv
$ echo 'source /usr/local/opt/autoenv/' >> ~/.bash_profile

What you have to do is make a file with the name of .env in your projects directory. The contents of that file will be somewhat like this:

# .env
source env/bin/activate

This is the command which you use to activate your virtual environment. It might be different for you. For instance if you use virtualenvwrapper then it would be something like this:

workon project

You can also use smartcd for more control and power. I have used it in the past.

more information.


3. Cookie Cutter

You can use Cookie Cutter to make project boilerplates and then quickly start new projects based on those boilerplates. It is extremely useful and I have used it countless times. Currently there are a lot of Python project templates on GitHub which use Cookie Cutter.

You can install it using pip:

$ pip install cookiecutter

Now you can simply clone Cookie Cutter templates on GitHub using it:

$ cookiecutter

Now answer a couple of questions and your project is good to go!

more information.


4. Bash Git Prompt

This is not strictly Python related. It is a bash prompt that displays information about the current git repository. In particular the branch name, difference with remote branch, number of files staged, changed, etc.

You can install it using git:

cd ~
git clone .bash-git-prompt

This tool can help you a lot if you are a regular git user. It saves you countless minutes if not hours.

more information.


I would also like to remind you that I have started a Python newsletter which lists curated articles and news regarding Python and it’s community. You can signup over here!


Which tools do you use for increasing your Python productivity? Share them with me in the comments section below!


6 thoughts on “4 Command-line tools for more Python productivity

  1. Thanks for the Bash Git Prompt tip. I’ve thought about hacking together something like this many times myself, but never got around to it. Great to see that it already exists. Definitely going to try it.

  2. Pingback: 4 Command-line tools for more Python productivity | Dinesh Ram Kali.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s