Skip to main content

Quickly open Python modules in your text editor.

Project description

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Description-Content-Type: UNKNOWN
Description: ===
ped
===

.. image:: https://img.shields.io/pypi/v/ped.svg
:target: https://pypi-hypernode.com/pypi/ped
:alt: Latest version

.. image:: https://img.shields.io/travis/sloria/ped.svg
:target: https://travis-ci.org/sloria/ped
:alt: Travis-CI

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

$ pip install ped


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 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 copy the files.

- `bash completion <https://github.com/sloria/ped/blob/master/ped/ped_bash_completion.sh>`_
- `zsh completion <https://github.com/sloria/ped/blob/master/ped/ped_zsh_completion.zsh>`_

Bash completion
---------------

To install bash completion, run::

# The path given here will depend on your OS
$ python -m ped.install_completion --bash /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 --zsh /usr/local/share/zsh/site-functions

Editor integrations
*******************

- `vim-ped <https://github.com/sloria/vim-ped>`_

Kudos
*****

This was inspired by `IPython's <https://ipython.org/>`_ ``%edit`` magic.


Changelog
*********

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

- Support tab-completion in bash and zsh. Thanks `Thomas Kluyver <https://github.com/takluyver>`_.

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

Keywords: commandline,cli,open,editor,editing
Platform: UNKNOWN
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: System :: Shells

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-1.5.1.tar.gz (11.3 kB view hashes)

Uploaded Source

Built Distribution

ped-1.5.1-py2.py3-none-any.whl (12.0 kB view hashes)

Uploaded Python 2 Python 3

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