Registry / http-networking / redfish

redfish

JSON →
library3.3.5pypypi✓ verified 85d ago

The Redfish Python Library, developed by the DMTF, is a reference implementation enabling Python developers to communicate with Redfish-conformant APIs. It simplifies interactions by performing basic HTTP operations (GET, POST, PUT, PATCH, DELETE) on Redfish services. The library is actively maintained, currently at version 3.3.5, with new releases typically occurring every few months.

pip install redfish
INSTALL
IMPORT
SIG · REDFISH
R
redfish
http-networkingpythonv3.3.5
Install
2.5s avg
Import
607ms
Disk
21MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.3.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.639s · 22.9MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 2.5s · import 0.575s · 23MB
21MB installed
● package 21MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

redfish_client
from redfish import redfish_client
import redfish

This quickstart initializes a Redfish client, attempts to connect to the Redfish Service Root, and then fetches details about the first system if available. It demonstrates basic client creation, GET requests, and proper session logout. Credentials should be provided via environment variables for production use.

import redfish import os # Replace with your Redfish service details or use environment variables LOGIN_HOST = os.environ.get('REDFISH_HOST', 'https://192.168.1.100') LOGIN_ACCOUNT = os.environ.get('REDFISH_USERNAME', 'admin') LOGIN_PASSWORD = os.environ.get('REDFISH_PASSWORD', 'password') try: # Create a Redfish object REDFISH_OBJ = redfish.redfish_client( base_url=LOGIN_HOST, username=LOGIN_ACCOUNT, password=LOGIN_PASSWORD, default_prefix='/redfish/v1/' ) # The client automatically logs in upon creation by default. # You can explicitly call login() if check_connectivity=False was used during client creation. # REDFISH_OBJ.login() # Perform a GET operation on the Service Root response = REDFISH_OBJ.get('/redfish/v1/') if response.status == 200: print("Successfully connected to Redfish Service Root:") print(response.dict) else: print(f"Failed to connect to Redfish Service Root: {response.status} - {response.text}") # Example: Get system information systems_uri = response.dict.get('Systems', {}).get('@odata.id') if systems_uri: systems_response = REDFISH_OBJ.get(systems_uri) if systems_response.status == 200: print("\nSystems information:") # Print the first system's summary if available if systems_response.dict and 'Members' in systems_response.dict and len(systems_response.dict['Members']) > 0: first_system_uri = systems_response.dict['Members'][0].get('@odata.id') if first_system_uri: first_system_response = REDFISH_OBJ.get(first_system_uri) if first_system_response.status == 200: print(first_system_response.dict) else: print(f"Failed to get first system details: {first_system_response.status}") else: print("No systems found.") else: print(f"Failed to get systems: {systems_response.status}") else: print("Systems collection URI not found in Service Root.") except redfish.rest.v1.redfish_exception.ServerDownOrUnreachableError as e: print(f"Error: Redfish service is down or unreachable: {e}") except Exception as e: print(f"An unexpected error occurred: {e}") finally: # Ensure to log out the session if 'REDFISH_OBJ' in locals() and REDFISH_OBJ: try: REDFISH_OBJ.logout() print("\nLogged out successfully.") except Exception as e: print(f"Error during logout: {e}")
Debug
Known issues
breakingPython 2.x support was dropped in version 3.0.0. Users on Python 2 must use `redfish<3.0.0`.
fix
Upgrade to Python 3.x or pin the library version to `redfish<3.0.0`.
affects: >=3.0.0
gotchaThe OpenStack 'python-redfish' module uses a conflicting package name. This library (DMTF's 'redfish') cannot coexist with it in the same environment.
fix
Ensure the OpenStack 'python-redfish' package is uninstalled (`pip uninstall python-redfish`) before installing the DMTF 'redfish' library.
affects: All versions
gotchaBefore version 3.3.2, HTTP headers set on one `redfish_client` instance could unintentionally propagate to other instances due to a bug.
fix
Upgrade to version 3.3.2 or newer to prevent header leakage across client instances.
affects: <3.3.2
gotchaIn version 3.3.0, a workaround was added for Redfish services that incorrectly omit the 'Location' header during session login, which previously led to login failures or warnings. Services with this quirk may now work, but users might still see warnings if the workaround is triggered.
fix
Upgrade to version 3.3.0 or newer. Be aware of potential warnings if your Redfish service exhibits this behavior.
affects: <3.3.0
gotchaThe library switched its internal JSONPath implementation from `jsonpath_rw` to `jsonpath_ng` in version 3.3.5. While primarily an internal change, advanced users or those with custom logic deeply integrated with specific `jsonpath_rw` behaviors might observe subtle differences.
fix
Review any custom JSONPath-related logic if you encounter unexpected behavior after upgrading to 3.3.5, though direct public API impact is minimal.
affects: 3.3.5
gotchaRedfish sessions created with the library may persist on the server until they time out if `logout()` is not explicitly called. Although the client's destructor includes a logout, explicit calls are recommended for robust session management.
fix
Always call `REDFISH_OBJ.logout()` when you are finished interacting with the Redfish service, preferably within a `finally` block or context manager if available.
affects: All versions
Upgrade
Version history
3.3.5latest on PyPI · released Mar 13, 2026
Audit
Dependencies
jsonpatchrequiredUsed for JSON Patch operations, conditional on Python version.
jsonpath_ngrequiredUsed for JSONPath expression parsing and queries.
jsonpointerrequiredUsed for JSON Pointer operations.
requestsrequiredUnderlying HTTP library for making requests.
requests-toolbeltrequiredUtility belt for advanced requests usage.
requests-unixsocketrequiredEnables HTTP communication over UNIX domain sockets for requests.
Agent activity
9 hits · last 30 days
node
8
Resources
redfish — pip install redfish · libregistry