IPython Generic Utilities
ipython-genutils (version 0.2.0) is a collection of IPython-specific utility functions and modules that were extracted from the main IPython project. It served as a dependency for older IPython components and related projects during the Python 2 to 3 transition. It is considered vestigial, no longer actively developed, with its last release in 2017. New projects should avoid direct reliance on it.
Warnings
- deprecated This library is considered vestigial and is no longer actively maintained. Its utilities have largely been superseded by modern Python standard library features (e.g., `pathlib`, `tempfile`) or integrated into other active projects (e.g., `jupyter_core.paths` for path utilities).
- gotcha Due to its lack of maintenance, `ipython-genutils` does not receive updates for new Python versions. While it currently works on recent Python 3, future Python versions may introduce incompatibilities that will not be addressed.
- gotcha The utilities within `ipython-genutils` were extracted from IPython's internal codebase and are generally low-level. They are not intended for direct end-user application development in most cases and may have unexpected edge cases or limited scope.
Install
-
pip install ipython-genutils
Imports
- version_info
from ipython_genutils.version import version_info
- PY3
from ipython_genutils.py3compat import PY3
- get_ipython_dir
from ipython_genutils.path import get_ipython_dir
- TemporaryDirectory
from ipython_genutils.tempdir import TemporaryDirectory
Quickstart
from ipython_genutils.version import version_info
from ipython_genutils.py3compat import PY3
from ipython_genutils.path import get_ipython_dir
print(f"ipython-genutils version: {'.'.join(map(str, version_info))}")
print(f"Running on Python 3: {PY3}")
# Note: This path utility is largely internal to IPython/Jupyter now.
# For new projects, consider `jupyter_core.paths` or `pathlib`.
ipython_dir = get_ipython_dir()
print(f"Detected IPython directory (if configured): {ipython_dir}")