{"id":6238,"library":"session-info2","title":"Session Info 2","description":"Session Info 2 is a Python library that prints detailed version information for all currently imported packages and system details, useful for debugging and reproducibility. It's an improved successor to the original `session-info` library. The current version is 0.4.1, with releases occurring every few months to add features and improvements.","status":"active","version":"0.4.1","language":"python","source_language":"en","source_url":"https://github.com/flying-sheep/session-info2","tags":["environment","versioning","debugging","introspection","reproducibility"],"install":[{"cmd":"pip install session-info2","lang":"bash","label":"Install with pip"}],"dependencies":[],"imports":[{"wrong":"from session_info import show","symbol":"SessionInfo","correct":"from session_info2 import SessionInfo"}],"quickstart":{"code":"import session_info\n\n# Print session information to stdout\nsession_info.show()\n\n# To get formatted output (e.g., markdown) in v0.4+\n# result = session_info.show(display_mode='text') # captures string for earlier versions\n# print(result)\n\n# In v0.4+, you can also chain .format()\n# print(session_info.show().format('markdown'))","lang":"python","description":"The most common way to use `session-info2` is to simply call `session_info.show()`. This will print a comprehensive summary of your Python environment, including package versions and system details, directly to the console. As of v0.4, you can also use the `.format()` method on the returned object for specific output types."},"warnings":[{"fix":"Confirm you have installed `session-info2` (and not `session-info`) using `pip show session-info2`. If migrating, be aware of behavioral changes.","message":"This library (`session-info2`) is a distinct successor to the original `session-info` package. While the primary import module is similar (`session_info`), their implementations and features differ. Ensure you install `session-info2` if you intend to use the newer features and improved package discovery.","severity":"gotcha","affected_versions":"All versions"},{"fix":"For JSON output, call `session_info.show(display_mode='json')` or, for v0.4+, `print(session_info.show().format('json'))`.","message":"In version 0.1.2, the default output format for `session_info.show()` changed from JSON to plain text (or rich terminal output). If your scripts relied on parsing JSON directly from the default output, you now need to explicitly specify `session_info.show(display_mode='json')`.","severity":"breaking","affected_versions":">=0.1.2"},{"fix":"Upgrade to `session-info2>=0.4` to use the `.format()` method, or use `session_info.show(display_mode='...')` for older versions.","message":"The `.format('markdown' | 'html' | ...)` method was introduced in v0.4. If you are on an older version and need formatted output, you must use the `display_mode` argument directly, e.g., `session_info.show(display_mode='markdown')`.","severity":"gotcha","affected_versions":"<0.4"}],"env_vars":null,"search_vec":"'0.4.1':45 '2':3,6 'add':53 'current':18,42 'debug':26,59 'detail':13,23 'environ':57 'everi':49 'featur':54 'import':19 'improv':32,56 'info':2,5,39 'inform':15 'introspect':60 'librari':10,40 'month':51 'occur':48 'origin':36 'packag':20 'print':12 'python':9 'releas':47 'reproduc':28,61 'session':1,4,38 'session-info':37 'successor':33 'system':22 'use':24 'version':14,43,58","created_at":"2026-04-14T18:47:57.667282+00:00","updated_at":"2026-04-16T21:37:06.432258+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.4.1","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/flying-sheep/session-info2","docs":"https://session-info2.readthedocs.io/","changelog":null,"pypi":"https://pypi.org/project/session-info2/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["observability"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-30","last_verified":"2026-06-30","next_check":"2026-07-30","install_tag":null}}