{"id":18532997,"url":"https://github.com/googleapis/python-storage","last_synced_at":"2026-01-16T08:28:09.828Z","repository":{"id":37501281,"uuid":"226992639","full_name":"googleapis/python-storage","owner":"googleapis","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-08T23:58:25.000Z","size":13088,"stargazers_count":477,"open_issues_count":33,"forks_count":160,"subscribers_count":52,"default_branch":"main","last_synced_at":"2025-05-11T17:37:38.567Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/googleapis.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-12-10T00:10:14.000Z","updated_at":"2025-05-08T23:58:02.000Z","dependencies_parsed_at":"2023-09-27T01:50:03.761Z","dependency_job_id":"caa47c42-3462-49e1-8d5a-bb66487efa8f","html_url":"https://github.com/googleapis/python-storage","commit_stats":{"total_commits":999,"total_committers":93,"mean_commits":"10.741935483870968","dds":0.8298298298298299,"last_synced_commit":"2e94ad0eba8f24fbdf51bb615caf120911e4daab"},"previous_names":[],"tags_count":94,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fpython-storage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fpython-storage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fpython-storage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fpython-storage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/googleapis","download_url":"https://codeload.github.com/googleapis/python-storage/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253900595,"owners_count":21981273,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T19:08:40.691Z","updated_at":"2026-01-16T08:28:09.765Z","avatar_url":"https://github.com/googleapis.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Python Client for Google Cloud Storage\n======================================\n\n|stable| |pypi| |versions|\n\n`Google Cloud Storage`_ is a managed service for storing unstructured data. Cloud Storage\nallows world-wide storage and retrieval of any amount of data at any time. You can use\nCloud Storage for a range of scenarios including serving website content, storing data\nfor archival and disaster recovery, or distributing large data objects to users via direct download.\n\n**NOTE**: `3.0 Major Version Notes`_ are available. Feedback welcome.\n\nA comprehensive list of changes in each version may be found in the `CHANGELOG`_.\n\n- `Product Documentation`_\n- `Client Library Documentation`_\n- `github.com/googleapis/python-storage`_\n\nCertain control plane and long-running operations for Cloud Storage (including Folder\nand Managed Folder operations) are supported via the `Storage Control Client`_.\nThe `Storage Control API`_ creates one space to perform metadata-specific, control plane,\nand long-running operations apart from the Storage API.\n\nRead more about the client libraries for Cloud APIs, including the older\nGoogle APIs Client Libraries, in `Client Libraries Explained`_.\n\n.. |stable| image:: https://img.shields.io/badge/support-stable-gold.svg\n   :target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#stability-levels\n.. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-storage.svg\n   :target: https://pypi.org/project/google-cloud-storage/\n.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-storage.svg\n   :target: https://pypi.org/project/google-cloud-storage/\n.. _Google Cloud Storage: https://cloud.google.com/storage\n.. _Client Library Documentation: https://cloud.google.com/python/docs/reference/storage/latest/summary_overview\n.. _Product Documentation:  https://cloud.google.com/storage\n.. _CHANGELOG:  https://github.com/googleapis/python-storage/blob/main/CHANGELOG.md\n.. _github.com/googleapis/python-storage: https://github.com/googleapis/python-storage\n.. _Storage Control Client: https://cloud.google.com/python/docs/reference/google-cloud-storage-control/latest\n.. _Storage Control API: https://cloud.google.com/storage/docs/reference/rpc/google.storage.control.v2\n.. _Client Libraries Explained: https://cloud.google.com/apis/docs/client-libraries-explained\n\n\nQuick Start\n-----------\n\nIn order to use this library, you first need to go through the following steps.\nA step-by-step guide may also be found in `Get Started with Client Libraries`_.\n\n1. `Select or create a Cloud Platform project.`_\n2. `Enable billing for your project.`_\n3. `Enable the Google Cloud Storage API.`_\n4. `Setup Authentication.`_\n\n.. _Get Started with Client Libraries: https://cloud.google.com/storage/docs/reference/libraries#client-libraries-install-python\n.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project\n.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project\n.. _Enable the Google Cloud Storage API.:  https://console.cloud.google.com/flows/enableapi?apiid=storage-api.googleapis.com\n.. _Setup Authentication.: https://cloud.google.com/docs/authentication/client-libraries\n\nInstallation\n~~~~~~~~~~~~\n\nInstall this library in a virtual environment using `venv`_. `venv`_ is a tool that\ncreates isolated Python environments. These isolated environments can have separate\nversions of Python packages, which allows you to isolate one project's dependencies\nfrom the dependencies of other projects.\n\nWith `venv`_, it's possible to install this library without needing system\ninstall permissions, and without clashing with the installed system\ndependencies.\n\n.. _`venv`: https://docs.python.org/3/library/venv.html\n\n\nCode samples and snippets\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\nCode samples and snippets live in the `samples/`_ folder.\n\n.. _`samples/`: https://github.com/googleapis/python-storage/tree/main/samples\n\n\nSupported Python Versions\n^^^^^^^^^^^^^^^^^^^^^^^^^\nOur client libraries are compatible with all current `active`_ and `maintenance`_ versions of\nPython.\n\nPython \u003e= 3.7\n\n.. _active: https://devguide.python.org/devcycle/#in-development-main-branch\n.. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches\n\nUnsupported Python Versions\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\nPython \u003c= 3.6\n\nIf you are using an `end-of-life`_\nversion of Python, we recommend that you update as soon as possible to an actively supported version.\n\n.. _end-of-life: https://devguide.python.org/devcycle/#end-of-life-branches\n\nMac/Linux\n^^^^^^^^^\n\n.. code-block:: console\n\n    python3 -m venv \u003cyour-env\u003e\n    source \u003cyour-env\u003e/bin/activate\n    pip install google-cloud-storage\n\n\nWindows\n^^^^^^^\n\n.. code-block:: console\n\n    py -m venv \u003cyour-env\u003e\n    .\\\u003cyour-env\u003e\\Scripts\\activate\n    pip install google-cloud-storage\n\n\nExample Usage\n~~~~~~~~~~~~~\n\n.. code-block:: python\n\n    # Imports the Google Cloud client library\n    from google.cloud import storage\n\n    # Instantiates a client\n    storage_client = storage.Client()\n\n    # The name for the new bucket\n    bucket_name = \"my-new-bucket\"\n\n    # Creates the new bucket\n    bucket = storage_client.create_bucket(bucket_name)\n\n    print(f\"Bucket {bucket.name} created.\")\n\n\nTracing With OpenTelemetry\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThis is a PREVIEW FEATURE: Coverage and functionality are still in development and subject to change.\n\nThis library can be configured to use `OpenTelemetry`_ to generate traces on calls to Google Cloud Storage.\nFor information on the benefits and utility of tracing, read the `Cloud Trace Overview \u003chttps://cloud.google.com/trace/docs/overview\u003e`_.\n\nTo enable OpenTelemetry tracing in the Cloud Storage client, first install OpenTelemetry:\n\n.. code-block:: console\n\n    pip install google-cloud-storage[tracing]\n\nSet the ``ENABLE_GCS_PYTHON_CLIENT_OTEL_TRACES`` environment variable to selectively opt-in tracing for the Cloud Storage client:\n\n.. code-block:: console\n\n    export ENABLE_GCS_PYTHON_CLIENT_OTEL_TRACES=True\n\nYou will also need to tell OpenTelemetry which exporter to use. An example to export traces to Google Cloud Trace can be found below.\n\n.. code-block:: console\n\n    # Install the Google Cloud Trace exporter and propagator, however you can use any exporter of your choice.\n    pip install opentelemetry-exporter-gcp-trace opentelemetry-propagator-gcp\n\n    # [Optional] Install the OpenTelemetry Requests Instrumentation to trace the underlying HTTP requests.\n    pip install opentelemetry-instrumentation-requests\n\n.. code-block:: python\n\n    from opentelemetry import trace\n    from opentelemetry.sdk.trace import TracerProvider\n    from opentelemetry.sdk.trace.export import BatchSpanProcessor\n    from opentelemetry.exporter.cloud_trace import CloudTraceSpanExporter\n\n    tracer_provider = TracerProvider()\n    tracer_provider.add_span_processor(BatchSpanProcessor(CloudTraceSpanExporter()))\n    trace.set_tracer_provider(tracer_provider)\n\n    # Optional yet recommended to instrument the requests HTTP library\n    from opentelemetry.instrumentation.requests import RequestsInstrumentor\n    RequestsInstrumentor().instrument(tracer_provider=tracer_provider)\n\nIn this example, tracing data will be published to the `Google Cloud Trace`_ console.\nTracing is most effective when many libraries are instrumented to provide insight over the entire lifespan of a request.\nFor a list of libraries that can be instrumented, refer to the `OpenTelemetry Registry`_.\n\n.. _OpenTelemetry: https://opentelemetry.io\n.. _OpenTelemetry Registry: https://opentelemetry.io/ecosystem/registry\n.. _Google Cloud Trace: https://cloud.google.com/trace\n\n\n3.0 Major Version Notes\n-----------------------\n\nFeedback Welcome\n~~~~~~~~~~~~~~~~\n\nIf you experience that backwards compatibility for your application is broken\nwith this major version release, please let us know through the Github issues\nsystem. While some breaks of backwards compatibility may be unavoidable due to\nnew features in the major version release, we will do our best to minimize\nthem. Thank you.\n\nException Handling\n~~~~~~~~~~~~~~~~~~\n\nIn Python Storage 3.0, the dependency ``google-resumable-media`` was integrated.\nThe ``google-resumable-media`` dependency included exceptions\n``google.resumable_media.common.InvalidResponse`` and\n``google.resumable_media.common.DataCorruption``, which were often imported\ndirectly in user application code. The replacements for these exceptions are\n``google.cloud.storage.exceptions.InvalidResponse`` and\n``google.cloud.storage.exceptions.DataCorruption``. Please update application code\nto import and use these exceptions instead.\n\nFor backwards compatibility, if ``google-resumable-media`` is installed, the new\nexceptions will be defined as subclasses of the old exceptions, so applications\nshould continue to work without modification. This backwards compatibility\nfeature may be removed in a future major version update.\n\nSome users may be using the original exception classes from the\n``google-resumable-media`` library without explicitly installing that library. So\nas not to break user applications following this pattern,\n``google-resumable-media`` is still in the list of dependencies in this package's\nsetup.py file. Applications which do not import directly from\n``google-resumable-media`` can safely disregard this dependency.\nThis backwards compatibility feature **will be removed** in a future major\nversion update. Please migrate to using the ``google.cloud.storage.exceptions``\nclasses as above.\n\nChecksum Defaults\n~~~~~~~~~~~~~~~~~\n\nIn Python Storage 3.0, uploads and downloads now have a default of \"auto\" where\napplicable. \"Auto\" will use crc32c checksums, except for unusual cases where the\nfast (C extension) crc32c implementation is not available, in which case it will\nuse md5 instead. Before Python Storage 3.0, the default was md5 for most\ndownloads and None for most uploads. Note that ranged downloads (\"start\" or\n\"end\" set) still do not support any checksumming, and some features in\n``transfer_manager.py`` still support crc32c only.\n\nNote: The method ``Blob.upload_from_file()`` requires a file in bytes mode, but\nwhen checksum is set to None, as was the previous default, would not throw an\nerror if passed a file in string mode under some circumstances. With the new\ndefaults, it will now raise a TypeError. Please use a file opened in bytes\nreading mode as required.\n\nMiscellaneous\n~~~~~~~~~~~~~\n\n- The ``BlobWriter`` class now attempts to terminate an ongoing resumable upload if\n  the writer exits with an exception.\n- Retry behavior is now identical between media operations (uploads and\n  downloads) and other operations, and custom predicates are now supported for\n  media operations as well.\n- ``Blob.download_as_filename()`` will now delete the empty file if it results in a\n  google.cloud.exceptions.NotFound exception (HTTP 404).\n- Previously, object upload, metadata update, and delete methods had retries\n  disabled by default unless the generation or metageneration was specified in\n  the request. This has now changed so that retries are enabled by default.\n\n\nNext Steps\n~~~~~~~~~~\n\n-  Read the `Google Cloud Storage Product documentation`_ to learn\n   more about the product and see How-to Guides.\n-  Read the `Client Library Documentation`_ for Google Cloud Storage API\n   to see other available methods on the client.\n-  View this `README`_ to see the full list of Cloud\n   APIs that we cover.\n\n.. _Google Cloud Storage Product documentation:  https://cloud.google.com/storage\n.. _README: https://github.com/googleapis/google-cloud-python/blob/main/README.rst\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogleapis%2Fpython-storage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogleapis%2Fpython-storage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogleapis%2Fpython-storage/lists"}