Skip to content

Commit 37a1239

Browse files
authored
docs: kzb-01 update readme (#9)
1 parent 07ba1c9 commit 37a1239

2 files changed

Lines changed: 29 additions & 25 deletions

File tree

README.md

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,73 @@
11
# python-gcp-samples
2+
23
This repository contains python samples intended to use in day to day operational activities on google cloud platform.
34
Usecases for which the python scripts are written can be found [here](./usecases.md).
45

56
## Prerequisites
7+
68
Below prerequisites must be fulfilled for the successful execution of code.
79

810
### Software Requirement
11+
912
Resources in this repository are meant for use with Python 3.x (check the version using `python3 --version`) and pip3 (check the version using `pip3 --version`). If you don't have the compatible version, download it from official python repository.
1013

11-
- [python3](https://www.python.org/downloads/) >= 3.9.2
14+
- [python3](https://www.python.org/downloads/) >= 3.13.0
1215
- [pip3](https://pypi.org/project/pip/) >= 20.3.4
1316

1417
### Bootstrap Virtual Environment
18+
1519
[venv](https://docs.python.org/3/library/venv.html) 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.
1620

1721
**Linux**
18-
```
19-
cd your-project
20-
python3 -m venv env
21-
source env/bin/activate
22-
pip install -r requirements.txt
2322

24-
* If you want to stop using the virtual environment and go back to your global Python, you can deactivate it:
25-
deactivate
23+
```bash
24+
cd your-project
25+
python3 -m venv env
26+
source env/bin/activate
27+
pip install -r requirements.txt
28+
29+
# If you want to stop using the virtual environment and go back to your global Python, you can deactivate it:
30+
deactivate
2631
```
2732

2833
**Note:** Follow the [google article](https://cloud.google.com/python/docs/setup) to setup your Python development environment.
2934

3035
## Quick Start
36+
3137
If you want to quickly run and test Python samples without installing python, the recommended approach is to use Cloud Shell.
3238

3339
Cloud Shell is a Compute Engine virtual machine. The service credentials associated with this virtual machine are automatic, so there is no need to set up or download a service account key.
3440

3541
Cloud shell terminal is preloaded with softwares and utilities such as Python, gcloud command-line tool, kubectl, and more. letting you get started with less setup.
36-
- **Step-01:** Activate Cloud Shell at the top of the Google Cloud Console.
37-
- **Step-02:** Clone this repository: `git clone https://github.com/anupam-sy/python-gcp-samples.git`
38-
- **Step-03:** Setup the python virtual environment using [Bootstrap Virtual Environment](#bootstrap-virtual-environment).
42+
43+
- [x] **Step-01:** Activate Cloud Shell at the top of the Google Cloud Console.
44+
- [x] **Step-02:** Clone this repository: `git clone https://github.com/anupam-sy/python-gcp-samples.git`
45+
- [x] **Step-03:** Setup the python virtual environment using [Bootstrap Virtual Environment](#bootstrap-virtual-environment).
3946

4047
### Authentication and Authorization
48+
4149
This client library used in the python script supports authentication via Google Application Default Credentials, or by providing a JSON key file for a Service Account. Google Application Default Credentials (ADC) is the recommended way to authorize and authenticate clients.
4250

4351
## Accessing Cloud APIs
52+
4453
You can access Cloud APIs using client libraries available for many popular programming languages While you can use Google Cloud APIs directly by making raw requests to the server, client libraries provide simplifications that significantly reduce the amount of code you need to write.
4554

46-
1. Cloud Client Libraries are the recommended option for accessing Cloud APIs programmatically, where available. Cloud Client Libraries use the latest client library model.
47-
[NEW - Recommended Way] https://github.com/googleapis/google-cloud-python
55+
1. Cloud Client Libraries are the recommended option for accessing Cloud APIs programmatically, where available. Cloud Client Libraries use the latest client library model.
56+
[NEW - Recommended Way] https://github.com/googleapis/google-cloud-python
4857

49-
2. A few Google Cloud APIs don't have Cloud Client Libraries available in all languages. If you want to use one of these APIs and there is no Cloud Client Library for your preferred language, you can still use the previous style of client library, called Google API Client Libraries.
50-
[OLD - Not Recommended] https://github.com/googleapis/google-api-python-client
58+
2. A few Google Cloud APIs don't have Cloud Client Libraries available in all languages. If you want to use one of these APIs and there is no Cloud Client Library for your preferred language, you can still use the previous style of client library, called Google API Client Libraries.
59+
[OLD - Not Recommended] https://github.com/googleapis/google-api-python-client
5160

5261
**Note:** It is recommended to use Cloud Client Libraries for Python, where possible, for new code development due to the following reasons:
5362

5463
With Cloud Client Libraries for Python:
64+
5565
- There is a separate client library for each API, so you can choose which client libraries to download. Whereas, google-api-python-client is a single client library for all APIs. As a result, the total package size for google-api-python-client exceeds 50MB.
5666
- There are stricter controls for breaking changes to the underlying APIs as each client library is focused on a specific API.
5767
- There are more features in these Cloud Client Libraries as each library is focused on a specific API, and in some cases, the libraries are owned by team who specialized in that API.
5868

5969
## References
70+
6071
- https://cloud.google.com/python/docs/setup
6172
- https://cloud.google.com/apis/docs/overview
6273
- https://cloud.google.com/apis/docs/client-libraries-explained
@@ -70,7 +81,9 @@ With Cloud Client Libraries for Python:
7081
- https://github.com/GoogleCloudPlatform/python-docs-samples
7182

7283
## License
84+
7385
This repository is under MIT License.
7486

7587
## Providing feedback
76-
Open an issue in this GitHub repository.
88+
89+
Open an issue in this GitHub repository.

usecases.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)