{"library":"python-dxf","title":"Python DXF (Docker Registry Client)","description":"python-dxf is a Python module and command-line tool for storing and retrieving data in a Docker v2 registry. It functions as a Docker registry v2 client, enabling tasks like transferring Docker images between registries, especially useful for disconnected environments. The library creates payloads directly from the registry, which can be faster than `docker save` and `docker load`, and can compute diffs to reduce transfer size. The current version is 12.1.1 and it appears to be actively maintained.","language":"python","status":"active","last_verified":"Thu Apr 16","install":{"commands":["pip install python-dxf"],"cli":{"name":"dxf","version":"usage: dxf [-h]"}},"imports":["from dxf import Dxf"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nfrom dxf import Dxf\n\n# Configure registry connection via environment variables or direct arguments\n# DXF_HOST, DXF_USERNAME, DXF_PASSWORD, DXF_INSECURE, etc.\n\nhost = os.environ.get('DXF_HOST', 'registry.example.com')\nusername = os.environ.get('DXF_USERNAME', '')\npassword = os.environ.get('DXF_PASSWORD', '')\ninsecure = os.environ.get('DXF_INSECURE', '0') == '1'\n\ntry:\n    # Connect to the registry\n    # In a real scenario, handle credentials securely (e.g., from a vault)\n    client = Dxf(host, username=username, password=password, insecure=insecure)\n    print(f\"Connected to registry: {host}\")\n\n    # Example: List repositories (requires appropriate permissions)\n    # NOTE: Dxf API might not directly expose 'list_repositories' in all versions,\n    # this is a conceptual example based on its registry client nature.\n    # Refer to the official library documentation for exact API calls.\n    # if hasattr(client, 'list_repositories'): # Illustrative, actual method names vary\n    #     repositories = client.list_repositories()\n    #     print(f\"Repositories: {repositories}\")\n    # else:\n    #     print(\"Method to list repositories not found or not directly exposed by Dxf object.\")\n\n    # More likely usage involves specific image/layer operations, e.g.:\n    # blob_digest = client.push_blob('my-repo/my-image', 'sha256:...')\n    # manifest = client.get_manifest('my-repo/my-image', 'latest')\n    print(\"Dxf client initialized. You can now perform registry operations.\")\n\nexcept Exception as e:\n    print(f\"Failed to connect or perform operation: {e}\")","lang":"python","description":"This quickstart demonstrates how to initialize the `Dxf` client for a Docker registry, using environment variables for configuration. It shows the basic connection pattern. Actual registry operations (like listing repositories, pushing/pulling blobs or manifests) require specific API calls which might vary depending on the exact version and intended functionality. Ensure environment variables like `DXF_HOST`, `DXF_USERNAME`, and `DXF_PASSWORD` are set for authentication and host connection.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}