Warning

This documentation is for an old version of IPython. You can find docs for newer versions here.

Module: html.utils

Notebook related utilities

Authors:

  • Brian Granger

7 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.