.. image:: https://badgen.net/pypi/v/ped :alt: pypi badge :target: https://pypi.org/project/ped/
.. image:: https://github.com/sloria/ped/actions/workflows/build-release.yml/badge.svg :alt: build status :target: https://github.com/sloria/ped/actions/workflows/build-release.yml
Quickly open Python modules in your text editor.
.. code-block:: bash
$ ped django
$ ped django.core.urlresolvers
$ ped django.views.generic.TemplateView
# Partial name matching
$ ped django.http.resp
Editing django.http.response...
...Done.
# 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 <https://github.com/pipxproject/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.
.. code-block:: bash
# .zshrc or .bashrc
# Use vim with ped
export PED_EDITOR=vim
Opening directories
By default, ped
will open __init__.py
files when a package name is passed.
If you would rather open the package's directory, set the PED_OPEN_DIRECTORIES
environment variable.
.. code-block:: bash
# .zshrc or .bashrc
# Open package directories instead of __init__.py
export PED_OPEN_DIRECTORIES=1
Tab-completion
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.
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
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/_ped
Editor integrations
vim-ped <https://github.com/sloria/vim-ped>
_Kudos
This was inspired by IPython's <https://ipython.org/>
_ %edit
magic.
Changelog
ped.__version__
attribute.importlib.metadata.version("ped")
instead.PED_OPEN_DIRECTORIES=1
to open package directories instead of__init__.py
files. Thanks Alex Nordin <https://github.com/anordin95>
_.Bug fixes:
ped
can be run its own virtual environment separate from theinstall_completion
script writes to stdout
and detemrmines$SHELL
.Note: This is the last version to support Python 2.
Thomas Kluyver <https://github.com/takluyver>
_.--info
argument for outputting name, file path, and line number of modules/functions/classes.ped pkg.subpkg
.