Skip to main content

A virtual environment utility for saving the commands you use in python projects.

Project description

Keep a local history of everything you do inside your virtual python environment.

Installation

After activating your virtual environment, install the module with:

pip install pystory

Add the following line to your .bashrc/.bash_profile file to enable pystory:

export PROMPT_COMMAND='if [ ! -z ${VIRTUAL_ENV+x} ]; then echo "$(date "+%Y-%m-%d.%H:%M:%S") $(pwd) $(history 1)" >> $VIRTUAL_ENV/.pystory; fi'

The contents of PROMPT_COMMAND are executed as a regular Bash command just before Bash displays a prompt.

This line adds your last command as an entry to the .pystory file, which will be placed in your $VIRTUAL_ENV/ folder.

Ex:

/Users/username/project/.venv/.pystory

Usage

Check your pystory by typing pystory while your virtual environment is activated.

$ pystory
Hist    Count    Command
1       1.       pip install requests
2       1.       pip install Django
5       3.       python
...

Note that the output is compressed, so only the last history entry of a command is listed, with the count of times the command is used.

$ pystory find Django
Commands matching `Django`:
Hist    Count     Command
2       1         pip install Django

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
pystory-0.2-py2.py3-none-any.whl (7.5 kB) Copy SHA256 hash SHA256 Wheel 3.5
pystory-0.2.tar.gz (4.6 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page