{"id":9934,"library":"memfabric-hybrid","title":"Memfabric Hybrid Python API","description":"The `memfabric-hybrid` library provides a Python API client for interacting with the Memfabric Hybrid data platform. It simplifies operations like endpoint management and data access within a hybrid cloud environment. The current version is 1.0.8, with releases appearing to be made as features are developed or bugs are fixed, indicating an active development status.","status":"active","version":"1.0.8","language":"en","source_language":"en","source_url":"https://github.com/memfabric/memfabric-hybrid-python-api","tags":["API client","hybrid cloud","data fabric","cloud integration"],"install":[{"cmd":"pip install memfabric-hybrid","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Used for making HTTP requests to the Memfabric API.","package":"requests","optional":false},{"reason":"Used for data validation and settings management (e.g., client configuration).","package":"pydantic","optional":false}],"imports":[{"note":"The primary client class is nested within the `client` submodule.","wrong":"from memfabric_hybrid import MemfabricClient","symbol":"MemfabricClient","correct":"from memfabric_hybrid.client import MemfabricClient"}],"quickstart":{"code":"import os\nfrom memfabric_hybrid.client import MemfabricClient\nfrom memfabric_hybrid.exceptions import AuthError, APIError\n\n# Configure API credentials and URL using environment variables\n# For example:\n# export MEMFABRIC_API_KEY=\"your_api_key_here\"\n# export MEMFABRIC_API_URL=\"https://api.memfabric.com\"\n\n# Ensure environment variables are set for a successful connection\napi_key = os.environ.get('MEMFABRIC_API_KEY', '')\napi_url = os.environ.get('MEMFABRIC_API_URL', '')\n\nif not api_key or not api_url:\n    print(\"Warning: MEMFABRIC_API_KEY and MEMFABRIC_API_URL environment variables are not set.\")\n    print(\"Please set them to run this example successfully.\")\nelse:\n    try:\n        client = MemfabricClient()\n        print(\"MemfabricClient initialized successfully.\")\n        \n        # Example: List available endpoints\n        endpoints = client.get_endpoints()\n        print(f\"Available endpoints: {endpoints}\")\n        \n    except AuthError as e:\n        print(f\"Authentication error: {e}. Check your API key.\")\n    except APIError as e:\n        print(f\"Memfabric API error: {e}\")\n    except Exception as e:\n        print(f\"An unexpected error occurred: {e}\")\n","lang":"python","description":"This quickstart initializes the `MemfabricClient` which relies on `MEMFABRIC_API_KEY` and `MEMFABRIC_API_URL` environment variables for configuration. It then demonstrates fetching available endpoints. Remember to set your environment variables before running."},"warnings":[{"fix":"Always ensure `MEMFABRIC_API_KEY` and `MEMFABRIC_API_URL` are correctly set in your environment before initializing `MemfabricClient` or explicitly pass them during initialization if supported (check documentation).","message":"The `MemfabricClient` relies heavily on environment variables (`MEMFABRIC_API_KEY`, `MEMFABRIC_API_URL`) for configuration. If these are not set or are incorrect, the client will fail to authenticate or connect.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Verify your internet connection, firewall settings, and ensure the `MEMFABRIC_API_URL` is correct and reachable from your environment. Use `ping` or `curl` to test connectivity to the API endpoint if troubleshooting.","message":"Direct network connectivity to the Memfabric API endpoint is crucial. Connection issues, firewalls, or incorrect `MEMFABRIC_API_URL` can lead to `requests.exceptions.ConnectionError`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Implement specific exception handling for `memfabric_hybrid.exceptions.AuthError` and `memfabric_hybrid.exceptions.APIError` to provide more informative error messages and recovery logic, as shown in the quickstart.","message":"API operations can raise specific exceptions like `AuthError` (for authentication failures) or `APIError` (for general API-side errors). Generic `Exception` catching might hide specific issues.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Run `pip install memfabric-hybrid` to install the library.","cause":"The `memfabric-hybrid` package has not been installed in the current Python environment.","error":"ModuleNotFoundError: No module named 'memfabric_hybrid'"},{"fix":"Verify that `MEMFABRIC_API_KEY` is set to a valid and active API key for your Memfabric account. Example: `export MEMFABRIC_API_KEY=\"your_valid_key\"`","cause":"The `MEMFABRIC_API_KEY` environment variable is either missing, incorrect, or expired.","error":"memfabric_hybrid.exceptions.AuthError: Authentication failed. Please check your API key."},{"fix":"Check the value of `MEMFABRIC_API_URL` environment variable. Ensure there are no network restrictions (e.g., firewalls) preventing access to the Memfabric API. Verify the API endpoint status if possible.","cause":"The client could not establish a connection to the specified `MEMFABRIC_API_URL`. This could be due to an incorrect URL, network issues, or the API being unavailable.","error":"requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.memfabric.com', port=443): Max retries exceeded with url: /api/v1/endpoints (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x...>: Failed to establish a new connection: [Errno 111] Connection refused'))"}]}