module ipythonhelper.kindofcompletion

Inheritance diagram of pyquickhelper.ipythonhelper.kindofcompletion

Short summary

module pyquickhelper.ipythonhelper.kindofcompletion

A custom way to add auto completion to IPython

source on GitHub

Classes

class

truncated documentation

AutoCompletion

You can add auto completion object to IPython by adding member to an instance of this class. All members must begin …

AutoCompletionFile

builds a tree based on a list of files, the class adds A__ before every folder or file starting with _

Properties

property

truncated documentation

_

return the value

_

return the value

_members

returns all the members

_members

returns all the members

Methods

method

truncated documentation

__init__

constructor

__init__

constructor

__len__

returns the number of elements

__len__

returns the number of elements

__str__

returns a string

__str__

returns a string

_add

add a member to this class, add an AutoCompletion instance, creates one if value is not from AutoCompletion

_add

add a member to this class, add an AutoCompletion instance, creates one if value is not from AutoCompletion

_filter

Removes unexpected characters for a file name.

_populate

populate the class with files and folder in the folder this class holds

Documentation

A custom way to add auto completion to IPython

source on GitHub

class pyquickhelper.ipythonhelper.kindofcompletion.AutoCompletion(value=None)[source]

Bases: object

You can add auto completion object to IPython by adding member to an instance of this class.

All members must begin by _

source on GitHub

constructor

Parameters:

value – any value of object

source on GitHub

property _[source]

return the value

source on GitHub

__init__(value=None)[source]

constructor

Parameters:

value – any value of object

source on GitHub

__len__()[source]

returns the number of elements

source on GitHub

__str__()[source]

returns a string

source on GitHub

_add(member, value)[source]

add a member to this class, add an AutoCompletion instance, creates one if value is not from AutoCompletion type

Parameters:
  • member – name of the new member

  • value – value to add

Returns:

(AutoCompletion)

source on GitHub

property _members[source]

returns all the members

source on GitHub

class pyquickhelper.ipythonhelper.kindofcompletion.AutoCompletionFile(value)[source]

Bases: AutoCompletion

builds a tree based on a list of files, the class adds A__ before every folder or file starting with _

File autocompletion in IPython

The following code:

from pyquickhelper.ipythonhelper import AutoCompletionFile
d = AutoCompletionFile(".")

Will produce the following auto completion picture:

../../_images/completion.png

source on GitHub

constructor

Parameters:

value – directory

source on GitHub

__init__(value)[source]

constructor

Parameters:

value – directory

source on GitHub

_filter(s)[source]

Removes unexpected characters for a file name.

Parameters:

s – filename

Returns:

cleaned filename

source on GitHub

_populate()[source]

populate the class with files and folder in the folder this class holds

source on GitHub