Skip to main content

Get suggestions on misspelled names, and do system wide symbol searching.

Project description

IPython Extension: ipython-suggestions

(i) Number one feature: system wide symbol searching! When ipython is loaded, suggestions module will scan your python paths for symbols and will create a cache. On the author's old 2008 computer (this readme is from 2017), 50000 symbols load in 10 seconds. But then you get a very easy way to import any symbol, without typing or remembering the entrine import path. First example:

In [1]: %findsymbol DecisionTreeClasifir # two typos here on purpose Out[1]: 0 (C) from sklearn.tree import DecisionTreeClassifier

In [2]: %suggestion 0 from sklearn.tree import DecisionTreeClassifier # it's now imported!

%findsymbol searches string up to two character edits (deletion, substitution, transpose and insertion).

Second example:

In [1]: %findsymbol pypl  # now hit tab!
[this completes to:]
In [1]: %findsymbol pyplot...matplotlib  # press enter now.
from matplotlib import pyplot
[pyplot is now imported]

Even better example:

In [1]: %findsymbol pypl  # now hit tab!
[this completes to:]
In [1]: %findsymbol pyplot...matplotlib
[now add -as parameter]
In [1]: %findsymbol pyplot...matplotlib -as plt
from matplotlib import pyplot as plt
[pyplot is now imported as plt]

The completions offered by pressing tab in a %findsymbol line are all the symbols that begin with what you wrote. Note that this is case-sensitive.

This also works in jupyter :)

(ii) Get suggestions on misspelled names:

In [1]: my_awesome_variable = 10

In [2]: 10 * my_awsome_variable ** 3

NameError Traceback (most recent call last) in () ----> 1 10 * my_awsome_variable ** 3

NameError: name 'my_awsome_variable' is not defined Did you mean: 0 my_awesome_variable

In [3]: %suggestion 0 [ipython automatically fills the next line] In [4]: 10 * my_awesome_variable ** 3

Auto-filling of corrected code currently only works inside the shell and not in jupyter.

Installation

Run:

pip install git+https://github.com/drorspei/ipython-suggestions # from Github

then append the output of ipython -m ipython_suggestions to the output of ipython profile locate (typically ~/.ipython/profile_default/ipython_config.py).

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

ipython-suggestions-1.0.0.tar.gz (35.8 kB view details)

Uploaded Source

Built Distribution

ipython_suggestions-1.0.0-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file ipython-suggestions-1.0.0.tar.gz.

File metadata

  • Download URL: ipython-suggestions-1.0.0.tar.gz
  • Upload date:
  • Size: 35.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for ipython-suggestions-1.0.0.tar.gz
Algorithm Hash digest
SHA256 740015953c399d6bdba74f4e46f016cc3747dd90f3b6779a6ea157c06d8a10c9
MD5 4eae5da3cdb3e4a54246f683ab393d0c
BLAKE2b-256 569e316a668ddd159f21cb8c134c47bfc9ba14c8cdb5c508d0faf3200ae6508c

See more details on using hashes here.

File details

Details for the file ipython_suggestions-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: ipython_suggestions-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for ipython_suggestions-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b77a0aaf1b78d5036724692feff1c2f30c24498c49d371659827e1698b2af9bc
MD5 16ce51c83eb28f7467e6d81a551035bb
BLAKE2b-256 e6bab97303373038a5c8ea4e949e1a81841728e5fb4f29267ea5a3201934a9de

See more details on using hashes here.

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