-
Notifications
You must be signed in to change notification settings - Fork 172
Add CODE_SUMMARY.md #1762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
+51
−0
Closed
Add CODE_SUMMARY.md #1762
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,51 @@ | ||||||||||||||
| # Codebase Summary: `google-cloud-storage` | ||||||||||||||
|
|
||||||||||||||
| This document provides a high-level overview of the main components of the Google Cloud Storage Python client library. | ||||||||||||||
|
|
||||||||||||||
| ## Main Components | ||||||||||||||
|
|
||||||||||||||
| ### 1. Client (`google/cloud/storage/client.py`) | ||||||||||||||
| The `Client` class is the entry point for interacting with the Google Cloud Storage API. It handles authentication and project configuration. | ||||||||||||||
| - **Key Responsibilities**: | ||||||||||||||
| - Authenticating with Google Cloud. | ||||||||||||||
| - Creating, retrieving, and listing buckets. | ||||||||||||||
| - Managing batch operations. | ||||||||||||||
| - Creating HMAC keys. | ||||||||||||||
|
|
||||||||||||||
| ### 2. Bucket (`google/cloud/storage/bucket.py`) | ||||||||||||||
| The `Bucket` class represents a Google Cloud Storage bucket. It provides methods to manage the bucket itself and the objects (blobs) within it. | ||||||||||||||
| - **Key Responsibilities**: | ||||||||||||||
| - Creating and deleting the bucket. | ||||||||||||||
| - Configuring bucket properties (ACLs, lifecycle rules, versioning, CORS, website configuration, etc.). | ||||||||||||||
| - Creating, listing, getting, and deleting blobs. | ||||||||||||||
| - Managing IAM policies for the bucket. | ||||||||||||||
|
|
||||||||||||||
| ### 3. Blob (`google/cloud/storage/blob.py`) | ||||||||||||||
| The `Blob` class represents an object (file) within a GCS bucket. It provides methods to upload, download, and manage the object. | ||||||||||||||
| - **Key Responsibilities**: | ||||||||||||||
| - Uploading data (from file, filename, or string). | ||||||||||||||
| - Downloading data (to file, filename, bytes, or text). | ||||||||||||||
| - Managing object metadata and ACLs. | ||||||||||||||
| - Deleting the object. | ||||||||||||||
| - Generating signed URLs for temporary access. | ||||||||||||||
|
|
||||||||||||||
| ### 4. Batch (`google/cloud/storage/batch.py`) | ||||||||||||||
| The `Batch` class allows grouping multiple API calls into a single HTTP request. This is useful for performing multiple operations (like patching or deleting multiple blobs) efficiently. | ||||||||||||||
| - **Key Responsibilities**: | ||||||||||||||
| - Accumulating multiple requests. | ||||||||||||||
| - Sending them in a single `multipart/mixed` HTTP request. | ||||||||||||||
| - Processing the responses. | ||||||||||||||
|
|
||||||||||||||
| ### 5. Transfer Manager (`google/cloud/storage/transfer_manager.py`) | ||||||||||||||
| The `transfer_manager` module provides utilities for concurrent uploads and downloads, which can significantly improve performance for large numbers of files or large files. | ||||||||||||||
| - **Key Responsibilities**: | ||||||||||||||
| - `upload_many` / `upload_many_from_filenames`: Uploading multiple files concurrently. | ||||||||||||||
| - `download_many` / `download_many_to_path`: Downloading multiple blobs concurrently. | ||||||||||||||
| - `download_chunks_concurrently`: Downloading a single large file in chunks concurrently. | ||||||||||||||
| - `upload_chunks_concurrently`: Uploading a single large file in chunks concurrently (using XML Multi-Part Upload). | ||||||||||||||
|
|
||||||||||||||
| ## Directory Structure | ||||||||||||||
|
|
||||||||||||||
| - `google/cloud/storage/`: Contains the source code for the library. | ||||||||||||||
| - `tests/`: Contains unit and system tests. | ||||||||||||||
| - `samples/`: Contains code samples demonstrating how to use the library. | ||||||||||||||
|
Comment on lines
+49
to
+51
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To improve developer experience and ease of navigation, consider making the directory paths clickable links.
Suggested change
|
||||||||||||||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To improve developer experience and ease of navigation, consider making the file paths for the main components clickable links to the respective files in the repository.