module ipythonhelper.magic_class_diff

Inheritance diagram of pyquickhelper.ipythonhelper.magic_class_diff

Short summary

module pyquickhelper.ipythonhelper.magic_class_diff

Magic command to handle files

source on GitHub

Classes

class

truncated documentation

MagicDiff

Defines magic commands to visualize differences between files.

Functions

function

truncated documentation

register_file_magics

register magics function, can be called from a notebook

Properties

property

truncated documentation

Context

return the context or None

cross_validation_lock

A contextmanager for running a block with our cross validation lock set to True. At the end of the block, …

Static Methods

staticmethod

truncated documentation

textdiff_parser

defines the way to parse the magic command %textdiff

Methods

method

truncated documentation

difftext

defines %difftext which calls textdiff() but should be easier to remember

textdiff

Documentation

Magic command to handle files

source on GitHub

class pyquickhelper.ipythonhelper.magic_class_diff.MagicDiff(shell=None, **kwargs)[source][source]

Bases: pyquickhelper.ipythonhelper.magic_class.MagicClassWithHelpers

Defines magic commands to visualize differences between files.

source on GitHub

_trait_default_generators = {}[source]
difftext(line)[source][source]

defines %difftext which calls textdiff but should be easier to remember

source on GitHub

textdiff(line)[source][source]

%textdiff

It displays differences between two text files, two strings, two urls, it is based on create_visual_diff_through_html_files. Check blog post Visualize differences between two files in a notebook to see an example. See also A magic command to visualize differences between two files in a notebook. The magic command is equivalent to:

from IPython.core.display import display_html, display_javascript
from pyquickhelper import docstring2html, create_visual_diff_through_html_files
html, js = create_visual_diff_through_html_files(<f1>, <f2>,
                encoding=<encoding>, notebook=True,
                context_size=None if <context> in [None, ""] else int(<context>),
                inline_view=<inline>)
display_html(html)
display_javascript(js)

source on GitHub

static textdiff_parser()[source][source]

defines the way to parse the magic command %textdiff

source on GitHub

pyquickhelper.ipythonhelper.magic_class_diff.register_file_magics(ip=None)[source][source]

register magics function, can be called from a notebook

Parameters

ip – from get_ipython()

source on GitHub