Skip to content

Latest commit

 

History

History
58 lines (43 loc) · 1.24 KB

File metadata and controls

58 lines (43 loc) · 1.24 KB
.. toctree::
  :maxdepth: 0
  :hidden:

  datastore-api
  datastore-dataset
  datastore-entities
  datastore-keys
  datastore-transactions
  datastore-queries
  storage-api
  storage-buckets
  storage-keys
  storage-acl


Getting started

Cloud Datastore

Google Cloud Datastore is a fully managed, schemaless database for storing non-relational data.

from gcloud import datastore
dataset = datastore.get_dataset(
    '<your-project-id>',
    '<service-account-email>',
    '/path/to/your/key')
entity = dataset.entity('Person')
entity['name'] = 'Your name'
entity['age'] = 25
entity.save()

Cloud Storage

Google Cloud Storage allows you to store data on Google infrastructure.

from gcloud import storage
bucket = storage.get_bucket(
    '<your-bucket-name>',
    '<your-project-id>',
    '<service-account-email>',
    '/path/to/your/key')
key = bucket.new_key('my-test-file.txt')
key = key.upload_contents_from_string('this is test content!')