IPython Pick
Sublimetext plugin for inserting statements from IPython log at caret position
Details
Installs
- Total 2K
- Win 1K
- Mac 341
- Linux 371
| Jun 13 | Jun 12 | Jun 11 | Jun 10 | Jun 9 | Jun 8 | Jun 7 | Jun 6 | Jun 5 | Jun 4 | Jun 3 | Jun 2 | Jun 1 | May 31 | May 30 | May 29 | May 28 | May 27 | May 26 | May 25 | May 24 | May 23 | May 22 | May 21 | May 20 | May 19 | May 18 | May 17 | May 16 | May 15 | May 14 | May 13 | May 12 | May 11 | May 10 | May 9 | May 8 | May 7 | May 6 | May 5 | May 4 | May 3 | May 2 | May 1 | Apr 30 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 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 |
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_pickto 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