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: str) tuple[str, str]
Get short form of commit hash given directory
pkg_pathWe 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: str) dict
Return dict describing the context of this package
- IPython.utils.sysinfo.get_sys_info() dict
Return useful information about IPython and the system, as a dict.
- IPython.utils.sysinfo.sys_info() str
Return useful information about IPython and the system, as a string.
Examples
In [2]: print(sys_info()) {'commit_hash': '144fdae', # random 'commit_source': 'repository', 'ipython_path': '/home/fperez/usr/lib/python2.6/site-packages/IPython', 'ipython_version': '0.11.dev', 'os_name': 'posix', 'platform': 'Linux-2.6.35-22-generic-i686-with-Ubuntu-10.10-maverick', 'sys_executable': '/usr/bin/python', 'sys_platform': 'linux2', 'sys_version': '2.6.6 (r266:84292, Sep 15 2010, 15:52:39) \n[GCC 4.4.5]'}