Code samples used on cloud.google.com
Apache License 2.0
6045
302
5919

Google Cloud Platform Python Samples

Python samples for Google Cloud Platform products.

Build Status Build Status Build Status Build Status Build Status

Google Cloud Samples

Check out some of the samples found on this repository on the Google Cloud Samples page.

Setup

  1. Install pip and virtualenv if you do not already have them.

  2. Clone this repository:

    git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git
    
  3. Obtain authentication credentials.

    Create local credentials by running the following command and following the oauth2 flow (read more about the command here):

    gcloud auth application-default login
    

    Read more about Google Cloud Platform Authentication.

How to run a sample

  1. Change directory to one of the sample folders, e.g. logging/cloud-client:

    cd logging/cloud-client/
    
  2. Create a virtualenv. Samples are compatible with Python 3.6+.

    python3 -m venv env
    source env/bin/activate
    
  3. Install the dependencies needed to run the samples.

    pip install -r requirements.txt
    
  4. Run the sample:

    python snippets.py
    

Contributing

Contributions welcome! See the Contributing Guide.

Contributors

renovate-bot
gcf-owl-bot[bot]
dpebot
tmatsuo
leahecole
gguuss
engelke
busunkim96
waprin
nnegrey
m-strzelczyk
jerjou
averikitsch
tswast
msampathkumar
yoshi-automation
anguillanneuf
davidcavazos
dandhlee
noerog
puneith
dizcology
andrewsg
kurtisvg
alixhami
parthea
munkhuushmgl
telpirion
elibixby
arithmetic1728
frankyn
mco-gh
ryanmats
donmccasland
arbrown
glasnt
dinagraves
daniel-sanche
SurferJeffAtGoogle
grant
sirtorry
jsimonweb
merla18
jmdobry
jeffmendoza
kchertenko
rsamborski
holtskinner
crwilcox
bradmiro
Sita04
navinger
saicheems
melaniedejong
kweinmeister
happyhuman
peter-zheng-g
grayside
billyjacobson
crowdus
texasmichelle
shubha-rajan
beccasaurus
aman-ebay
ivanmkc
czahedi
jackwotherspoon
irataxy
cojenco
dependabot[bot]
larkee
t-karasova
tetiana-karasova
Strykrol
qiwzhang
bkuang
Mariatta
p42ul
sethvargo
BenWhitehead
devlance
FrodoTheTrue
djmailhot
jacek-izykowski
shollyman
inklesspen
lookuptable
cwxie-google
danoscarmike
danielbankhead
jlara310
hkdevandla
broady
kryzthov
KaylaNguyen
kenneth-rosario
llatif
carieshmarie
changsongd
sangramql