IPython Documentation

Table Of Contents

Previous topic

Module: utils.submodule

Next topic

Module: utils.syspathcontext

This Page

Warning

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

Module: utils.sysinfo

Utilities for getting information about IPython and the system it’s running in.

4 Functions

IPython.utils.sysinfo.pkg_commit_hash(pkg_path)

Get short form of commit hash given directory pkg_path

We get the commit hash from (in order of preference):

  • IPython.utils._sysinfo.commit
  • git output, if we are in a git repository

If these fail, we return a not-found placeholder tuple

Parameters:

pkg_path : str

directory containing package only used for getting commit from active repo

Returns:

hash_from : str

Where we got the hash from - description

hash_str : str

short form of hash

IPython.utils.sysinfo.pkg_info(pkg_path)

Return dict describing the context of this package

Parameters:

pkg_path : str

path containing __init__.py for package

Returns:

context : dict

with named parameters of interest

IPython.utils.sysinfo.sys_info()

Return useful information about IPython and the system, as a string.

IPython.utils.sysinfo.num_cpus()

Return the effective number of CPUs in the system as an integer.

This cross-platform function makes an attempt at finding the total number of available CPUs in the system, as returned by various underlying system and python calls.

If it can’t find a sensible answer, it returns 1 (though an error may make it return a large positive number that’s actually incorrect).