forked from googleapis/google-cloud-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
191 lines (153 loc) · 9.82 KB
/
index.html
File metadata and controls
191 lines (153 loc) · 9.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Google Cloud Client Library for Python — google-cloud 0.26.1 documentation</title>
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '0.26.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="shortcut icon" href="_static/favicon.ico"/>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Core" href="core/index.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head>
<body>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="toctree-wrapper compound">
</div>
<div class="section" id="google-cloud-client-library-for-python">
<h1>Google Cloud Client Library for Python<a class="headerlink" href="#google-cloud-client-library-for-python" title="Permalink to this headline">#</a></h1>
<div class="section" id="getting-started">
<h2>Getting started<a class="headerlink" href="#getting-started" title="Permalink to this headline">#</a></h2>
<p>The <code class="docutils literal"><span class="pre">google-cloud</span></code> library is <code class="docutils literal"><span class="pre">pip</span></code> install-able:</p>
<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> pip install google-cloud
</pre></div>
</div>
<div class="section" id="cloud-datastore">
<h3>Cloud Datastore<a class="headerlink" href="#cloud-datastore" title="Permalink to this headline">#</a></h3>
<p><a class="reference external" href="https://developers.google.com/datastore/">Google Cloud Datastore</a> is a fully managed, schemaless database for storing non-relational data.</p>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">google.cloud</span> <span class="kn">import</span> <span class="n">datastore</span>
<span class="n">client</span> <span class="o">=</span> <span class="n">datastore</span><span class="o">.</span><span class="n">Client</span><span class="p">()</span>
<span class="n">key</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">key</span><span class="p">(</span><span class="s1">'Person'</span><span class="p">)</span>
<span class="n">entity</span> <span class="o">=</span> <span class="n">datastore</span><span class="o">.</span><span class="n">Entity</span><span class="p">(</span><span class="n">key</span><span class="o">=</span><span class="n">key</span><span class="p">)</span>
<span class="n">entity</span><span class="p">[</span><span class="s1">'name'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'Your name'</span>
<span class="n">entity</span><span class="p">[</span><span class="s1">'age'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">25</span>
<span class="n">client</span><span class="o">.</span><span class="n">put</span><span class="p">(</span><span class="n">entity</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="section" id="cloud-storage">
<h3>Cloud Storage<a class="headerlink" href="#cloud-storage" title="Permalink to this headline">#</a></h3>
<p><a class="reference external" href="https://developers.google.com/storage/">Google Cloud Storage</a> allows you to store data on Google infrastructure.</p>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">google.cloud</span> <span class="kn">import</span> <span class="n">storage</span>
<span class="n">client</span> <span class="o">=</span> <span class="n">storage</span><span class="o">.</span><span class="n">Client</span><span class="p">()</span>
<span class="n">bucket</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_bucket</span><span class="p">(</span><span class="s1">'<your-bucket-name>'</span><span class="p">)</span>
<span class="n">blob</span> <span class="o">=</span> <span class="n">bucket</span><span class="o">.</span><span class="n">blob</span><span class="p">(</span><span class="s1">'my-test-file.txt'</span><span class="p">)</span>
<span class="n">blob</span><span class="o">.</span><span class="n">upload_from_string</span><span class="p">(</span><span class="s1">'this is test content!'</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="section" id="resources">
<h3>Resources<a class="headerlink" href="#resources" title="Permalink to this headline">#</a></h3>
<ul class="simple">
<li><a class="reference external" href="https://github.com/GoogleCloudPlatform/google-cloud-python/">GitHub</a></li>
<li><a class="reference external" href="https://github.com/GoogleCloudPlatform/google-cloud-python/issues">Issues</a></li>
<li><a class="reference external" href="http://stackoverflow.com/questions/tagged/google-cloud-python">Stack Overflow</a></li>
<li><a class="reference external" href="https://pypi.python.org/pypi/google-cloud">PyPI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="#">google-cloud</a></h1>
<p class="blurb">Google Cloud Client Libraries for Python</p>
<p>
<iframe src="https://ghbtns.com/github-btn.html?user=GoogleCloudPlatform&repo=google-cloud-python&type=watch&count=true&size=large&v=2"
allowtransparency="true" frameborder="0" scrolling="0" width="200px" height="35px"></iframe>
</p>
<p>
<a href="https://travis-ci.org/GoogleCloudPlatform/google-cloud-python">
<img
alt="https://secure.travis-ci.org/GoogleCloudPlatform/google-cloud-python.svg?branch=master"
src="https://secure.travis-ci.org/GoogleCloudPlatform/google-cloud-python.svg?branch=master"
/>
</a>
</p>
<h3>Navigation</h3>
<ul>
<li class="toctree-l1"><a class="reference internal" href="core/index.html">Core</a></li>
<li class="toctree-l1"><a class="reference internal" href="bigquery/usage.html">BigQuery</a></li>
<li class="toctree-l1"><a class="reference internal" href="bigtable/usage.html">Bigtable</a></li>
<li class="toctree-l1"><a class="reference internal" href="datastore/usage.html">Datastore</a></li>
<li class="toctree-l1"><a class="reference internal" href="dns/usage.html">DNS</a></li>
<li class="toctree-l1"><a class="reference internal" href="language/usage.html">Natural Language</a></li>
<li class="toctree-l1"><a class="reference internal" href="pubsub/usage.html">Pub / Sub</a></li>
<li class="toctree-l1"><a class="reference internal" href="resource-manager/api.html">Resource Manager</a></li>
<li class="toctree-l1"><a class="reference internal" href="runtimeconfig/usage.html">Runtimeconfig</a></li>
<li class="toctree-l1"><a class="reference internal" href="spanner/usage.html">Spanner</a></li>
<li class="toctree-l1"><a class="reference internal" href="speech/usage.html">Speech</a></li>
<li class="toctree-l1"><a class="reference internal" href="error-reporting/usage.html">Stackdriver Error Reporting</a></li>
<li class="toctree-l1"><a class="reference internal" href="monitoring/usage.html">Stackdriver Monitoring</a></li>
<li class="toctree-l1"><a class="reference internal" href="logging/usage.html">Stackdriver Logging</a></li>
<li class="toctree-l1"><a class="reference internal" href="storage/client.html">Storage</a></li>
<li class="toctree-l1"><a class="reference internal" href="translate/usage.html">Translation</a></li>
<li class="toctree-l1"><a class="reference internal" href="vision/index.html">Vision</a></li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="#">Documentation overview</a><ul>
<li>Next: <a href="core/index.html" title="next chapter">Core</a></li>
</ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
©2014-2017, Google.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.6.3</a>
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.10</a>
|
<a href="_sources/index.rst.txt"
rel="nofollow">Page source</a>
</div>
<a href="https://github.com/GoogleCloudPlatform/google-cloud-python" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" class="github"/>
</a>
</body>
</html>