IPython Documentation

Table Of Contents

Previous topic

Module: html.tree.handlers

Next topic

Module: html.widgets.interaction

This Page

Note

This documentation is for a development version of IPython. There may be significant differences from the latest stable release.

Module: html.utils

Notebook related utilities

8 Functions

IPython.html.utils.url_path_join(*pieces)

Join components of url into a relative url

Use to prevent double slash when joining subpath. This will leave the initial and final / in place

IPython.html.utils.path2url(path)

Convert a local file path to a URL

IPython.html.utils.url2path(url)

Convert a URL to a local file path

IPython.html.utils.url_escape(path)

Escape special characters in a URL path

Turns ‘/foo bar/’ into ‘/foo%20bar/’

IPython.html.utils.url_unescape(path)

Unescape special characters in a URL path

Turns ‘/foo%20bar/’ into ‘/foo bar/’

IPython.html.utils.is_hidden(abs_path, abs_root='')

Is a file hidden or contained in a hidden directory?

This will start with the rightmost path element and work backwards to the given root to see if a path is hidden or in a hidden directory. Hidden is determined by either name starting with ‘.’ or the UF_HIDDEN flag as reported by stat.

Parameters:

abs_path : unicode

The absolute path to check for hidden directories.

abs_root : unicode

The absolute path of the root directory in which hidden directories should be checked for.

IPython.html.utils.to_os_path(path, root='')

Convert an API path to a filesystem path

If given, root will be prepended to the path. root must be a filesystem path already.

IPython.html.utils.to_api_path(os_path, root='')

Convert a filesystem path to an API path

If given, root will be removed from the path. root must be a filesystem path already.