Skip to main content

ped

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...
...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:

$ 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 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.

# .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.

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

Kudos

This was inspired by IPython’s %edit magic.

Changelog

3.0.0 (2024-01-18)

  • Publish type information.

  • Test against Python 3.8-3.12. Older versions of Python are no longer supported.

  • Backwards-incompatible: Remove ped.__version__ attribute. Use importlib.metadata.version("ped") instead.

2.1.0 (2020-03-18)

  • Set PED_OPEN_DIRECTORIES=1 to open package directories instead of opening __init__.py 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.

1.5.1

  • Minor code cleanups.

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

1.5.0

1.4.0

  • Add --info argument for outputting name, file path, and line number of modules/functions/classes.

  • Fix: Support line numbers in gvim.

1.3.0

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

1.2.1

  • Fix for Py2 compatibility.

1.2.0

  • Add partial name matching.

1.1.0

  • Add support for editing functions and classes.

1.0.2

  • Fix for editing subpackages, e.g. ped pkg.subpkg.

Release files for ped 3.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ped 3.0.0
File Size Uploaded
ped-3.0.0.tar.gz 13.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ped 3.0.0
File Interpreter ABI Platform
ped-3.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 24.7 kB

Release files / ped-3.0.0.tar.gz

Download URL ped-3.0.0.tar.gz
Size 13.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a51c235fa60d601d8c9008eaec172771f2829db23854a5314c08d7fb7c86d997
BLAKE2b-256 checksum
How to use checksums
35a574209ec54b840429700fae4002462cd71288939cf975d0cb5bac8c570558
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / ped-3.0.0-py3-none-any.whl

Download URL ped-3.0.0-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
266bfa58b1f2544a07c9cffd78ce05c2703549e31005a0b37cfd211a8675abb3
BLAKE2b-256 checksum
How to use checksums
b7b19c2df8358962683a3f55e7e0cea65358b079a4193225cbae5d351f704c7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release history Release notifications | RSS feed

This release

3.0.0 This release

2 release files

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.6.0

2 release files

1.5.1

2 release files

1.5.0

1 release file

1.4.0

1 release file

1.3.0

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.1.0

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page