Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emacsorphanage/pyimpsort
Sort python imports
https://github.com/emacsorphanage/pyimpsort
Last synced: 3 months ago
JSON representation
Sort python imports
- Host: GitHub
- URL: https://github.com/emacsorphanage/pyimpsort
- Owner: emacsorphanage
- Created: 2014-12-24T19:44:36.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2022-10-21T20:50:32.000Z (about 2 years ago)
- Last Synced: 2024-05-23T04:46:47.159Z (6 months ago)
- Language: Python
- Size: 14.6 KB
- Stars: 5
- Watchers: 3
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## pyimpsort.el
*Sort python imports.*---
[![License GPLv3](https://img.shields.io/badge/license-GPL_v3-green.svg)](http://www.gnu.org/licenses/gpl-3.0.html)
[![MELPA](http://melpa.org/packages/pyimpsort-badge.svg)](http://melpa.org/#/pyimpsort)`pyimpsort.el` sort the python imports of a file.
Currently uses [pyimpsort.py](pyimpsort.py) to process the way to sort python
imports.### Setup
Add the following snippet to your `init.el`:
(require 'pyimpsort)
(eval-after-load 'python
'(define-key python-mode-map "\C-c\C-u" #'pyimpsort-buffer))### Troubleshooting
+ **Doesn't sort correctly third party libraries**
`pyimpsort.el` tries to identify the third party libraries if are installed
in in the PYTHONPATH, if a package is not installed it is assumed that
belongs to the application.
`pyimpsort.el` also tries to identify if a python virtualenv
is activated.### Related projects
+ [isort][] ([emacs integration](https://github.com/paetzke/py-isort.el))
[isort]: https://github.com/timothycrosley/isort
### Customization Documentation
#### `pyimpsort-display-error-buffer`
Display error buffer on error.
#### `pyimpsort-error-buffer-name`
Buffer name of pyimpsort error.
### Function and Macro Documentation
#### `(pyimpsort-region BEGIN END)`
Sort python imports from region BEGIN to END points.
#### `(pyimpsort-buffer)`
Sort python imports from current buffer.
-----