Skip to main content

sinfo outputs version information for modules loaded in the current session, Python, and the OS.

Project description

sinfo

Note the new name

The sinfo package has changed name and is now called session_info to become more discoverable and self-explanatory. The sinfo PyPI package will be kept around to avoid breaking old installs and you can downgrade to 0.3.2 if you want to use it without seeing this message. For the latest features and bug fixes, please install session_info instead. The usage and defaults also changed slightly, so please review the latest README at https://gitlab.com/joelostblom/session_info.

sinfo outputs version information for modules loaded in the current session, Python, the OS, and the CPU. It is designed as a minimum measure to increase reproducibility and provides similar information as sessionInfo in R. The name is shortened to encourage regular usage through reduced typing =)

Motivation

sinfo is particularly useful when conducting exploratory data analysis in Jupyter notebooks. Listing the version numbers of all loaded modules after importing them is a simple way to ensure a minimum level of reproducibility while requiring little additional effort. This practice is useful both when revisiting notebooks and when sharing them with colleagues. sinfo is meant to complement more robust practices such as frozen virtual environments, containers, and binder.

Installation

sinfo can be installed via pip install sinfo. It does not depend on a package manager to find version numbers since it fetches them from the module's version string. Its only dependency is stdlib_list, which is used to distinguish between standard library and third party modules.

Usage

import math

import natsort
import numpy
import pandas
from sinfo import sinfo


sinfo()

Output:


-----
natsort     5.3.3
numpy       1.17.3
pandas      0.25.1
sinfo       0.3.0
-----
Python 3.7.3 | packaged by conda-forge | (default, Dec  6 2019, 08:54:18) [GCC 7.3.0]
Linux-5.4.2-arch1-1-x86_64-with-arch
4 logical CPU cores
-----
Session information updated at 2019-12-14 16:14

The default behavior is to only output modules not in the standard library, which is why the math module is omitted above (it can be included by specifying std_lib=True). To include not only the explicitly imported modules, but also any dependencies they import internally, specify dependencies=True. The notebook output is concealed in <details> tags by default to not take up too much visual real estate. When called from a notebook, sinfo writes the module dependencies to a file called to <notebook_name>-requirements.txt, which is compatible with pip install -r /path/to/requirements.txt. See the docstring for complete parameter info.

Background

sinfo started as minor modifications of py_session, and as it grew it became convenient to create a new package. sinfo was built with the help of information provided in stackoverflow answers and existing similar packages, including

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sinfo-0.3.4.tar.gz (24.5 kB view details)

Uploaded Source

File details

Details for the file sinfo-0.3.4.tar.gz.

File metadata

  • Download URL: sinfo-0.3.4.tar.gz
  • Upload date:
  • Size: 24.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.3

File hashes

Hashes for sinfo-0.3.4.tar.gz
Algorithm Hash digest
SHA256 81ea91c69a875de178e10bada9476d7300a1f712e1823dbd7714f43a10baba4d
MD5 cff8af2927236dd994c26d101523f285
BLAKE2b-256 cd373bedd499ae24c765fa2a165f96bb05d86ad0dd40fdf9917adbf80434445a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page