Skip to main content

Quickly open Python modules in your text editor.

Project description

pypi badge travis-ci 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 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

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

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.

Project details


Download files

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

Source Distribution

ped-2.0.0.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

ped-2.0.0-py2.py3-none-any.whl (11.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file ped-2.0.0.tar.gz.

File metadata

  • Download URL: ped-2.0.0.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.3

File hashes

Hashes for ped-2.0.0.tar.gz
Algorithm Hash digest
SHA256 9234e7f625270542ac93d5fac4ce996a39a879e8d4c281049c30929707b0413c
MD5 51dc8668e1e116ae075e50e21cd8b52d
BLAKE2b-256 1349338e6520948231dbec0c82e96f29e1d62d9195383d54c0d9578cdb2f0e56

See more details on using hashes here.

Provenance

File details

Details for the file ped-2.0.0-py2.py3-none-any.whl.

File metadata

  • Download URL: ped-2.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.3

File hashes

Hashes for ped-2.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1674e796c7149d86875f65e400c246509e19d118e0182f441f59f54a177b9750
MD5 157bc0bccf97ce437526a8d20619cacc
BLAKE2b-256 83d10acd220b8d24da0c8a5ebd73bd9bc716ebcbc5833895dbabf59f718ce51d

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page