Skip to content
👞 Quickly open Python modules in your text editor
Python Shell
Branch: master
Clone or download

Latest commit

dependabot-preview Bump flake8 from 3.8.1 to 3.8.2
Bumps [flake8]( from 3.8.1 to 3.8.2.
- [Release notes](
- [Commits](

Signed-off-by: dependabot-preview[bot] <>
Latest commit 6313311 May 25, 2020


Type Name Latest commit message Commit time
Failed to load latest commit information.
ped Bump version and update changelog Mar 18, 2020
.gitignore Update tooling (#54) Mar 18, 2020
.pre-commit-config.yaml Update flake8; remove unnecessary config (#57) May 16, 2020
LICENSE Bump copyright year Jan 15, 2020 Add LICENSE to sdist Jan 31, 2019
NOTICE Add NOTICE Sep 7, 2015
README.rst Replace travis with AP (#56) May 16, 2020
azure-pipelines.yml Replace travis with AP (#56) May 16, 2020
pyproject.toml Update tooling (#54) Mar 18, 2020
setup.cfg Replace legacy license_file option Jan 31, 2019 Bump flake8 from 3.8.1 to 3.8.2 May 25, 2020 open directory instead of (#51) Mar 18, 2020
tox.ini Update tooling (#54) Mar 18, 2020



pypi badge Build Status Code style: Black

Quickly open Python modules in your text editor.

$ ped django
$ ped django.core.urlresolvers
$ ped django.views.generic.TemplateView

# Partial name matching
$ ped django.http.resp
Editing django.http.response...

# Specify which editor to use
$ PED_EDITOR=vim ped django.shortcuts

ped will find your modules in the currently-active virtual environment.

Get it now

From PyPI:

$ pip install ped

Or, run it with pipx:

$ pipx run ped --help

Changing the default editor

ped will try to use your favorite text editor. If you want to override the editor ped uses, set the PED_EDITOR environment variable.

# .zshrc or .bashrc
# Use Sublime Text with ped
export PED_EDITOR=subl

Opening directories

By default, ped will open files when a package name is passed. If you would rather open the package's directory, set the PED_OPEN_DIRECTORIES environment variable.

# .zshrc or .bashrc
# Open package directories instead of


The ped package contains tab-completion scripts for bash and zsh. Place these files in your system's completion directories. The ped.install_completion module can be run as a script to output the files to a given location. It determines the correct completion file from the $SHELL environment variable.

Bash completion

To install bash completion, run:

# The path given here will depend on your OS
$ python -m ped.install_completion > /usr/local/etc/bash_completion.d

Zsh completion

To install zsh completion, run:

# The path given here will depend on your OS
$ python -m ped.install_completion > /usr/local/share/zsh/site-functions

Editor integrations


This was inspired by IPython's %edit magic.


2.1.0 (2019-03-18)

  • Set PED_OPEN_DIRECTORIES=1 to open package directories instead of opening files. Thanks Alex Nordin.

2.0.1 (2018-01-27)

Bug fixes:

  • Properly handle imports that don't correspond to a file.

2.0.0 (2019-01-22)

  • Drop support for Python 2.7 and 3.5. Only Python>=3.6 is supported.
  • ped can be run its own virtual environment separate from the user's virtual environment. Therefore, ped can be installed with pipsi or pipx.
  • install_completion script writes to stdout and detemrmines script from $SHELL.

1.6.0 (2019-01-14)

  • Test against Python 3.7.

Note: This is the last version to support Python 2.


  • Minor code cleanups.
  • Test against Python 2.7, 3.5, and 3.6. Support for older versions is dropped.



  • Add --info argument for outputting name, file path, and line number of modules/functions/classes.
  • Fix: Support line numbers in gvim.


  • If a class or function is passed, the editor will open up the file at the correct line number (for supported editors).


  • Fix for Py2 compatibility.


  • Add partial name matching.


  • Add support for editing functions and classes.


  • Fix for editing subpackages, e.g. ped pkg.subpkg.
You can’t perform that action at this time.