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
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.639s · 22.9MB
glibcpy 3.10–3.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}")
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.