8000 docs: refresh readme instructions (#667) · googleapis/python-storage@ceb9314 · GitHub 8000
[go: up one dir, main page]

Skip to content

Commit ceb9314

Browse files
authored
docs: refresh readme instructions (#667)
Update instructions and links in quick start/ samples readme per @cbonnie friction log :)
1 parent 10cdad6 commit ceb9314

File tree

2 files changed

+33
-23
lines changed

2 files changed

+33
-23
lines changed

README.rst

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,22 @@ In order to use this library, you first need to go through the following steps:
3434
.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project
3535
.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project
3636
.. _Enable the Google Cloud Storage API.: https://cloud.google.com/storage
37-
.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html
37+
.. _Setup Authentication.: https://cloud.google.com/storage/docs/reference/libraries#setting_up_authentication
3838

3939
Installation
4040
~~~~~~~~~~~~
4141

42-
Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to
43-
create isolated Python environments. The basic problem it addresses is one of
44-
dependencies and versions, and indirectly permissions.
42+
`Set up a Python development environment`_ and install this library in a `venv`.
43+
`venv`_ is a tool to create isolated Python environments. The basic problem it
44+
addresses is one of dependencies and versions, and indirectly permissions.
4545

46-
With `virtualenv`_, it's possible to install this library without needing system
46+
Make sure you're using Python 3.3 or later, which includes `venv`_ by default.
47+
With `venv`, it's possible to install this library without needing system
4748
install permissions, and without clashing with the installed system
4849
dependencies.
4950

50-
.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/
51+
.. _Set up a Python development environment: https://cloud.google.com/python/docs/setup
52+
.. _`venv`: https://docs.python.org/3/library/venv.html
5153

5254

5355
Supported Python Versions
@@ -68,30 +70,33 @@ Mac/Linux
6870

6971
.. code-block:: console
7072
71-
pip install virtualenv
72-
virtualenv <your-env>
73-
source <your-env>/bin/activate
74-
<your-env>/bin/pip install google-cloud-storage
73+
python -m venv env
74+
source env/bin/activate
75+
pip install google-cloud-storage
7576
7677
7778
Windows
7879
^^^^^^^
7980

8081
.. code-block:: console
8182
82-
pip install virtualenv
83-
virtualenv <your-env>
84-
<your-env>\Scripts\activate
85-
<your-env>\Scripts\pip.exe install google-cloud-storage
83+
py -m venv env
84+
.\env\Scripts\activate
85+
pip install google-cloud-storage
8686
8787
8888
Example Usage
8989
~~~~~~~~~~~~~
9090

9191
.. code:: python
9292
93+
# Imports the Google Cloud client library
9394
from google.cloud import storage
95+
96+
# Instantiates a client
9497
client = storage.Client()
98+
99+
# Creates a new bucket and uploads an object
95100
new_bucket = client.create_bucket('new-bucket-id')
96101
new_blob = new_bucket.blob('remote/path/storage.txt')
97102
new_blob.upload_from_filename(filename='/local/path.txt')
@@ -103,4 +108,12 @@ Example Usage
103108
blob = bucket.get_blob('remote/path/to/file.txt')
104109
print(blob.download_as_bytes())
105110
blob.upload_from_string('New contents!')
106-
111+
112+
113+
What's Next
114+
~~~~~~~~~~~
115+
116+
Now that you've set up your Python client for Cloud Storage,
117+
you can get started running `Storage samples.`_
118+
119+
.. _Storage samples.: https://github.com/googleapis/python-storage/tree/main/samples

samples/README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,21 @@ Before running the samples, make sure you've followed the steps outlined in
2121
[Quick Start](https://github.com/googleapis/python-storage#quick-start).
2222

2323
### Authentication
24-
This sample requires you to have authentication setup. Refer to the [Authentication Getting Started Guide](https://cloud.google.com/docs/authentication/getting-started)
25-
for instructions on setting up credentials for applications.
24+
Refer to the [Authentication Set Up Guide](https://cloud.google.com/storage/docs/reference/libraries#setting_up_authentication)
25+
for more detailed instructions.
2626

2727
### Install Dependencies
2828
1. Clone this repository and change to the sample directory you want to use.
2929
```
3030
git clone https://github.com/googleapis/python-storage.git
3131
```
3232
33-
2. Install [pip](https://pip.pypa.io/) and [virtualenv](https://virtualenv.pypa.io) if you do not already have them. You may want to refer to the [Python Development Environment Setup Guide](https://cloud.google.com/python/setup) for Google Cloud Platform for instructions.
34-
35-
3. Create a virtualenv. Samples are compatible with Python 3.6+.
33+
2. Activate a venv if you have not already from the [Quick Start](https://github.com/googleapis/python-storage#quick-start).
3634
```
37-
virtualenv env
38-
source env/bin/activate
35+
source <your-venv>/bin/activate
3936
```
4037
41-
4. Install the dependencies needed to run the samples.
38+
3. Install the dependencies needed to run the samples.
4239
```
4340
cd samples/snippets
4441
pip install -r requirements.txt

0 commit comments

Comments
 (0)
0