{"id":1404,"library":"boostedblob","title":"BoostedBlob","description":"BoostedBlob is a Python library and command-line tool designed for efficient, async-first file operations across local filesystems, Google Cloud Storage, and Azure Blob Storage. It provides a unified API for common tasks like copying, moving, listing, reading, and writing files. The current version is 1.0.0, which introduced significant API changes, moving from a single generic `Path` object to specific `LocalPath`, `GooglePath`, and `AzurePath` types. Its primary release cadence has been irregular but reached a stable `1.0.0` in April 2024.","status":"active","version":"1.0.0","language":"en","source_language":"en","source_url":"https://github.com/microsoft/boostedblob","tags":["async","blob-storage","azure","gcs","file-operations","cli"],"install":[{"cmd":"pip install boostedblob","lang":"bash","label":"Local-only operations"},{"cmd":"pip install boostedblob[gcs,azure]","lang":"bash","label":"With Google Cloud Storage and Azure Blob Storage support"}],"dependencies":[{"reason":"Required for Azure Blob Storage functionality (optional extra)","package":"azure-storage-blob","optional":true},{"reason":"Required for Azure authentication (optional extra)","package":"azure-identity","optional":true},{"reason":"Required for Google Cloud Storage functionality (optional extra)","package":"google-cloud-storage","optional":true}],"imports":[{"note":"As of v1.0.0, the generic `Path` object was removed in favor of specific path types from `boostedblob.path`.","wrong":"from boostedblob import Path","symbol":"LocalPath, AzurePath, GooglePath","correct":"from boostedblob.path import LocalPath, AzurePath, GooglePath"},{"note":"As of v1.0.0, `read_json` and `write_json` (and other specific operations like `copy`, `move`) were moved into dedicated submodules (`.read`, `.write`, `.copy`, `.move`). Top-level `delete`, `list_dir` are still available.","wrong":"from boostedblob import read_json, write_json","symbol":"read_json, write_json","correct":"from boostedblob.read import read_json\nfrom boostedblob.write import write_json"},{"symbol":"delete, list_dir","correct":"from boostedblob import delete, list_dir"}],"quickstart":{"code":"import asyncio\nimport os\nfrom boostedblob.path import LocalPath, AzurePath\nfrom boostedblob import delete, list_dir\nfrom boostedblob.read import read_json\nfrom boostedblob.write import write_json\n\nasync def main():\n    # 1. Local File Operations\n    print(\"--- Local File Operations ---\")\n    local_path = LocalPath(\"./boostedblob_quickstart_test.json\")\n    try:\n        await write_json({\"message\": \"Hello from BoostedBlob local!\"}, local_path)\n        print(f\"Wrote to {local_path}\")\n        content = await read_json(local_path)\n        print(f\"Read from {local_path}: {content}\")\n        # Clean up\n        await delete(local_path)\n        print(f\"Deleted {local_path}\")\n    except Exception as e:\n        print(f\"Error during local operations: {e}\")\n\n    # 2. Azure Blob Storage Operations (requires environment variables)\n    print(\"\\n--- Azure Blob Storage Operations ---\")\n    azure_account = os.environ.get('AZURE_STORAGE_ACCOUNT_NAME')\n    azure_container = os.environ.get('AZURE_STORAGE_CONTAINER')\n\n    if azure_account and azure_container:\n        # Example Azure path\n        azure_path = AzurePath(f\"az://{azure_account}/{azure_container}/boostedblob_quickstart_azure.json\")\n        print(f\"Target Azure Path: {azure_path}\")\n        try:\n            await write_json({\"message\": \"Hello from BoostedBlob Azure!\"}, azure_path)\n            print(f\"Wrote to {azure_path}\")\n            content = await read_json(azure_path)\n            print(f\"Read from {azure_path}: {content}\")\n            # Uncomment the line below to delete the file after reading\n            # await delete(azure_path)\n            # print(f\"Deleted {azure_path}\")\n            print(\"Azure operations completed. (Deletion is commented out for safety).\")\n        except Exception as e:\n            print(f\"Azure operations failed (check credentials, account, container, permissions): {e}\")\n    else:\n        print(\"Skipping Azure operations: Set AZURE_STORAGE_ACCOUNT_NAME and AZURE_STORAGE_CONTAINER environment variables to enable.\")\n        print(\"For GCS, install with `boostedblob[gcs]` and set `GOOGLE_APPLICATION_CREDENTIALS` and `GCS_BUCKET_NAME`.\")\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n","lang":"python","description":"This quickstart demonstrates basic file operations for local paths, and conditional operations for Azure Blob Storage. To run the Azure part, set `AZURE_STORAGE_ACCOUNT_NAME` and `AZURE_STORAGE_CONTAINER` environment variables. For Google Cloud Storage, ensure `boostedblob[gcs]` is installed and set `GOOGLE_APPLICATION_CREDENTIALS` and `GCS_BUCKET_NAME`."},"warnings":[{"fix":"Replace `Path(...)` with `LocalPath(...)`, `GooglePath(...)`, or `AzurePath(...)` and update imports accordingly (e.g., `from boostedblob.path import AzurePath`).","message":"The generic `boostedblob.Path` object was removed in v1.0.0. You must now use specific path types: `LocalPath`, `GooglePath`, or `AzurePath` imported from `boostedblob.path`.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Update imports from `from boostedblob import read_json` to `from boostedblob.read import read_json` (and similarly for `write`, `copy`, `move`). Note that `delete` and `list_dir` remain top-level imports for convenience.","message":"Specific operations like `read_json`, `write_json`, `copy`, and `move` were moved from top-level `boostedblob` imports to dedicated submodules in v1.0.0.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Adjust code that processes `list_dir` results to expect `BasePath` objects instead of raw strings. Access the path string via `.path` attribute if needed (e.g., `async for item in list_dir(...): print(item.path)`).","message":"The return type of `list_dir` changed from `AsyncIterator[str]` to `AsyncIterator[boostedblob.path.BasePath]` in v1.0.0.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Instead of modifying an existing `BasePath` object, create a new one with the desired changes if you need a different path (e.g., `new_path = old_path.joinpath('new_segment')`).","message":"As of v1.0.0, `boostedblob.path.BasePath` objects are immutable. Modifying their attributes directly is no longer possible.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}