Python Client for Google Cloud Storage¶
Google Cloud Storage is a managed service for storing unstructured data. Cloud Storage allows world-wide storage and retrieval of any amount of data at any time. You can use Cloud Storage for a range of scenarios including serving website content, storing data for archival and disaster recovery, or distributing large data objects to users via direct download.
A comprehensive list of changes in each version may be found in the CHANGELOG.
Certain control plane and long-running operations for Cloud Storage (including Folder and Managed Folder operations) are supported via the Storage Control Client. The Storage Control API creates one space to perform metadata-specific, control plane, and long-running operations apart from the Storage API.
Read more about the client libraries for Cloud APIs, including the older Google APIs Client Libraries, in Client Libraries Explained.
Quick Start¶
In order to use this library, you first need to go through the following steps. A step-by-step guide may also be found in Get Started with Client Libraries.
Installation¶
Install this library in a virtual environment using venv. venv is a tool that creates isolated Python environments. These isolated environments can have separate versions of Python packages, which allows you to isolate one project’s dependencies from the dependencies of other projects.
With venv, it’s possible to install this library without needing system install permissions, and without clashing with the installed system dependencies.
Code samples and snippets¶
Code samples and snippets live in the samples/ folder.
Supported Python Versions¶
Our client libraries are compatible with all current active and maintenance versions of Python.
Python >= 3.7
Unsupported Python Versions¶
Python <= 3.6
If you are using an end-of-life version of Python, we recommend that you update as soon as possible to an actively supported version.
Mac/Linux¶
python3 -m venv <your-env>
source <your-env>/bin/activate
pip install google-cloud-storage
Windows¶
py -m venv <your-env>
.\<your-env>\Scripts\activate
pip install google-cloud-storage
Next Steps¶
Read the Google Cloud Storage Product documentation to learn more about the product and see How-to Guides.
Read the Client Library Documentation for Google Cloud Storage API to see other available methods on the client.
View this README to see the full list of Cloud APIs that we cover.
Note
Because the storage client uses the third-party requests
library by
default, it is safe to share instances across threads. In multiprocessing
scenarious, best practice is to create client instances after
multiprocessing.Pool
or multiprocessing.Process
invokes
os.fork()
.
Guides¶
API Reference¶
More Examples¶
Changelog¶
- Changelog
- 2.17.0 (2024-05-22)
- 2.16.0 (2024-03-18)
- 2.15.0 (2024-02-28)
- 2.14.0 (2023-12-10)
- 2.13.0 (2023-10-31)
- 2.12.0 (2023-10-12)
- 2.11.0 (2023-09-19)
- 2.10.0 (2023-06-14)
- 2.9.0 (2023-05-04)
- 2.8.0 (2023-03-29)
- 2.7.0 (2022-12-07)
- 2.6.0 (2022-11-07)
- 2.5.0 (2022-07-24)
- 2.4.0 (2022-06-07)
- 2.3.0 (2022-04-12)
- 2.2.1 (2022-03-15)
- 2.2.0 (2022-03-14)
- 2.1.0 (2022-01-19)
- 2.0.0 (2022-01-12)
- 1.44.0 (2022-01-05)
- 1.43.0 (2021-11-15)
- 1.42.3 (2021-09-30)
- 1.42.2 (2021-09-16)
- 1.42.1 (2021-09-07)
- 1.42.0 (2021-08-05)
- 1.41.1 (2021-07-20)
- 1.41.0 (2021-07-13)
- 1.40.0 (2021-06-30)
- 1.39.0 (2021-06-21)
- 1.38.0 (2021-04-26)
- 1.37.1 (2021-04-02)
- 1.37.0 (2021-03-24)
- 1.36.2 (2021-03-09)
- 1.36.1 (2021-02-19)
- 1.36.0 (2021-02-10)
- 1.35.1 (2021-01-28)
- 1.35.0 (2020-12-14)
- 1.34.0 (2020-12-11)
- 1.33.0 (2020-11-16)
- 1.32.0 (2020-10-16)
- 1.31.2 (2020-09-23)
- 1.31.1 (2020-09-16)
- 1.31.0 (2020-08-26)
- 1.30.0 (2020-07-24)
- 1.29.0 (2020-06-09)
- 1.28.1 (2020-04-28)
- 1.28.0 (2020-04-22)
- 1.27.0 (2020-04-01)
- 1.26.0 (2020-02-12)
- 1.25.0
- 1.24.1
- 1.24.0
- 1.23.0
- 1.22.0
- 1.21.0
- 1.20.0
- 1.19.0
- 1.18.0
- 1.17.0
- 1.16.1
- 1.16.0
- 1.15.0
- 1.14.0
- 1.13.2
- 1.13.1
- 1.13.0
- 1.12.0
- 1.11.0
- 1.10.0
- 1.9.0
- 1.8.0
- 1.7.0
- 1.6.0