IPython Pick
Sublimetext plugin for inserting statements from IPython log at caret position
Details
Installs
- Total 2K
- Win 1K
- Mac 337
- Linux 365
Jan 30 | Jan 29 | Jan 28 | Jan 27 | Jan 26 | Jan 25 | Jan 24 | Jan 23 | Jan 22 | Jan 21 | Jan 20 | Jan 19 | Jan 18 | Jan 17 | Jan 16 | Jan 15 | Jan 14 | Jan 13 | Jan 12 | Jan 11 | Jan 10 | Jan 9 | Jan 8 | Jan 7 | Jan 6 | Jan 5 | Jan 4 | Jan 3 | Jan 2 | Jan 1 | Dec 31 | Dec 30 | Dec 29 | Dec 28 | Dec 27 | Dec 26 | Dec 25 | Dec 24 | Dec 23 | Dec 22 | Dec 21 | Dec 20 | Dec 19 | Dec 18 | Dec 17 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
Sublime IPython Pick
Adds a command for selecting one of the last statements in ipython_log.py
and inserting it at caret position.
How it works
While using IPython you can activate the log functionality
with %logstart.
That will save all your commands to a file named ipython_log.py
(by default).
The command will search for that file, first in the current project root (if you're using one), and then in each directory that contains the current open file, climbing the file system hierarchy.
Once found, the last statements are extracted, filtered and listed in a drop-down. Selecting one of them inserts it at caret position.
The statements are filtered by removing:
- calls to IPython magic commands
- repeated statements
- reassignments to the same variable: only the last assignment to a given variable is kept.
Limitations
- The package currently only supports the default log file name
ipython_log.py
. - The maximum number of statements is hard coded (30 statements).
Usage
(Suggestion) Bind the command
ipython_pick
to some key in your Key Bindings, e.g.{ "keys": ["ctrl+alt+a"], "command": "ipython_pick" },
Activate the command
Select a statement from the drop-down that appears
The statement is inserted at the caret position
Future improvements
- make the maximum number of statements configurable
- insert import statements at the right position at the top of the file
- select a group of statements at once