-
Notifications
You must be signed in to change notification settings - Fork 41
/
index.html
724 lines (691 loc) · 53.5 KB
/
index.html
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
<!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>contentful.py - Contentful Python Delivery SDK — Contentful 1.12.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: '1.12.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="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="contentful" href="modules.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">
<a class="reference external image-reference" href="./.github/header.png"><img alt="_images/header.png" src="_images/header.png" /></a>
<p align="center">
<a href="https://www.contentful.com/slack/">
<img src="https://img.shields.io/badge/-Join%20Community%20Slack-2AB27B.svg?logo=slack&maxAge=31557600" alt="Join Contentful Community Slack" />
</a>
<a href="https://www.contentfulcommunity.com/">
<img src="https://img.shields.io/badge/-Join%20Community%20Forum-3AB2E6.svg?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MiA1OSI+CiAgPHBhdGggZmlsbD0iI0Y4RTQxOCIgZD0iTTE4IDQxYTE2IDE2IDAgMCAxIDAtMjMgNiA2IDAgMCAwLTktOSAyOSAyOSAwIDAgMCAwIDQxIDYgNiAwIDEgMCA5LTkiIG1hc2s9InVybCgjYikiLz4KICA8cGF0aCBmaWxsPSIjNTZBRUQyIiBkPSJNMTggMThhMTYgMTYgMCAwIDEgMjMgMCA2IDYgMCAxIDAgOS05QTI5IDI5IDAgMCAwIDkgOWE2IDYgMCAwIDAgOSA5Ii8+CiAgPHBhdGggZmlsbD0iI0UwNTM0RSIgZD0iTTQxIDQxYTE2IDE2IDAgMCAxLTIzIDAgNiA2IDAgMSAwLTkgOSAyOSAyOSAwIDAgMCA0MSAwIDYgNiAwIDAgMC05LTkiLz4KICA8cGF0aCBmaWxsPSIjMUQ3OEE0IiBkPSJNMTggMThhNiA2IDAgMSAxLTktOSA2IDYgMCAwIDEgOSA5Ii8+CiAgPHBhdGggZmlsbD0iI0JFNDMzQiIgZD0iTTE4IDUwYTYgNiAwIDEgMS05LTkgNiA2IDAgMCAxIDkgOSIvPgo8L3N2Zz4K&maxAge=31557600"
alt="Join Contentful Community Forum" />
</a>
</p><div class="section" id="contentful-py-contentful-python-delivery-sdk">
<h1>contentful.py - Contentful Python Delivery SDK<a class="headerlink" href="#contentful-py-contentful-python-delivery-sdk" title="Permalink to this headline">¶</a></h1>
<p align="center">
<img src="https://img.shields.io/badge/Status-Maintained-green.svg" alt="This repository is actively maintained" />
<a href="LICENSE.txt">
<img src="https://img.shields.io/badge/license-MIT-brightgreen.svg" alt="MIT License" />
</a>
<a href="https://travis-ci.org/contentful/contentful.py">
<img src="https://travis-ci.org/contentful/contentful.py.svg?branch=master" alt="Build Status" />
</a>
</p><p><strong>What is Contentful?</strong></p>
<p><a class="reference external" href="https://www.contentful.com">Contentful</a> provides a content infrastructure for digital teams to power content in websites, apps, and devices. Unlike a CMS, Contentful was built to integrate with the modern software stack. It offers a central hub for structured content, powerful management and delivery APIs, and a customizable web app that enable developers and content creators to ship digital products faster.</p>
<blockquote>
<div>This SDK is intended to replace the former unofficial Python CDA SDK. The old SDK can still be found at: <a class="reference external" href="https://github.com/contentful-labs/contentful.py">https://github.com/contentful-labs/contentful.py</a></div></blockquote>
<!-- TOC -->
<ul>
<li><a href="#contentfulpy---contentful-python-delivery-sdk">contentful.py - Contentful Python Delivery SDK</a></li>
<ul>
<li><a href="#core-features">Core Features</a></li>
<li><a href="#getting-started">Getting started</a></li>
<ul>
<li><a href="#installation">Installation</a></li>
<li><a href="#your-first-request">Your first request</a></li>
<li><a href="#using-this-sdk-with-the-preview-api">Using this SDK with the Preview API</a></li>
<li><a href="#authentication">Authentication</a></li>
</ul>
<li><a href="#documentation--references">Documentation & References</a></li>
<ul>
<li><a href="#configuration">Configuration</a></li>
<li><a href="#reference-documentation">Reference documentation</a></li>
<ul>
<li><a href="#basic-queries">Basic queries</a></li>
<li><a href="#filtering-options">Filtering options</a></li>
<li><a href="#accessing-fields-and-sys-properties">Accessing fields and sys properties</a></li>
<li><a href="#using-different-locales">Using different locales</a></li>
<li><a href="#links">Links</a></li>
<li><a href="#assets">Assets</a></li>
</ul>
<li><a href="#advanced-concepts">Advanced concepts</a></li>
<ul>
<li><a href="#logging">Logging</a></li>
<li><a href="#proxy-example">Proxy example</a></li>
<li><a href="#synchronization">Synchronization</a></li>
</ul>
<li><a href="#tutorials--other-resources">Tutorials & other resources</a></li>
</ul>
<li><a href="#reach-out-to-us">Reach out to us</a></li>
<ul>
<li><a href="#you-have-questions-about-how-to-use-this-library">You have questions about how to use this library?</a></li>
<li><a href="#you-found-a-bug-or-want-to-propose-a-feature">You found a bug or want to propose a feature?</a></li>
<li><a href="#you-need-to-share-confidential-information-or-have-other-questions">You need to share confidential information or have other questions?</a></li>
</ul>
<li><a href="#get-involved">Get involved</a></li>
<li><a href="#license">License</a></li>
<li><a href="#code-of-conduct">Code of Conduct</a></li>
</ul>
</ul>
<!-- /TOC -->
</details><div class="section" id="core-features">
<h2>Core Features<a class="headerlink" href="#core-features" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Content retrieval through <a class="reference external" href="https://www.contentful.com/developers/docs/references/content-delivery-api/)and[ContentPreviewAPI](https://www.contentful.com/developers/docs/references/content-preview-api/">Content Delivery API</a>.</li>
<li><a class="reference external" href="https://www.contentful.com/developers/docs/concepts/sync/">Synchronization</a>.</li>
<li><a class="reference external" href="https://www.contentful.com/developers/docs/concepts/locales/">Localization support</a>.</li>
<li><a class="reference external" href="https://www.contentful.com/developers/docs/concepts/links/">Link resolution</a>.</li>
<li>Built in rate limiting recovery procedures.</li>
<li>Supports <a class="reference external" href="https://www.contentful.com/developers/docs/concepts/multiple-environments/">Environments</a> (<strong>since v1.7.0 - 16. April 2018</strong>).</li>
</ul>
</div>
<div class="section" id="getting-started">
<h2>Getting Started<a class="headerlink" href="#getting-started" title="Permalink to this headline">¶</a></h2>
<p>In order to get started with the Contentful Python SDK you’ll need not only to install it, but also to get credentials which will allow you to have access to your content in Contentful.</p>
<ul>
<li><a href="#installation">Installation</a></li>
<li><a href="#your-first-request">Your first request</a></li>
<li><a href="#using-this-sdk-with-the-preview-api">Using this SDK with the Preview API</a></li>
<li><a href="#authentication">Authentication</a></li>
</ul><div class="section" id="installation">
<h3>Installation<a class="headerlink" href="#installation" title="Permalink to this headline">¶</a></h3>
<p>Install Contentful from the Python Package Index:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">pip</span> <span class="n">install</span> <span class="n">contentful</span>
</pre></div>
</div>
</div>
<div class="section" id="your-first-request">
<h3>Your first request<a class="headerlink" href="#your-first-request" title="Permalink to this headline">¶</a></h3>
<p>The following code snippet is the most basic one you can use to get some content from Contentful with this SDK:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">contentful</span>
<span class="n">client</span> <span class="o">=</span> <span class="n">contentful</span><span class="o">.</span><span class="n">Client</span><span class="p">(</span>
<span class="s1">'cfexampleapi'</span><span class="p">,</span> <span class="c1"># This is the space ID. A space is like a project folder in Contentful terms</span>
<span class="s1">'b4c0n73n7fu1'</span> <span class="c1"># This is the access token for this space. Normally you get both ID and the token in the Contentful web app</span>
<span class="p">)</span>
<span class="c1"># This API call will request an entry with the specified ID from the space defined at the top, using a space-specific access token.</span>
<span class="n">entry</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">entry</span><span class="p">(</span><span class="s1">'nyancat'</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="section" id="using-this-sdk-with-the-preview-api">
<h3>Using this SDK with the Preview API<a class="headerlink" href="#using-this-sdk-with-the-preview-api" title="Permalink to this headline">¶</a></h3>
<p>This SDK can also be used with the Preview API. In order to do so, you need to use the Preview API Access token, available on the same page where you get the Delivery API token, and specify the host of the preview API, such as:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">client</span> <span class="o">=</span> <span class="n">contentful</span><span class="o">.</span><span class="n">Client</span><span class="p">(</span><span class="s1">'cfexampleapi'</span><span class="p">,</span> <span class="s1">'b4c0n73n7fu1'</span><span class="p">,</span> <span class="n">api_url</span><span class="o">=</span><span class="s1">'preview.contentful.com'</span><span class="p">)</span>
</pre></div>
</div>
<p>You can query for entries, assets, etc. very similar as described in the <a class="reference external" href="https://www.contentful.com/developers/docs/references/content-delivery-api/">Delivery API Documentation</a>.
Please note, that all methods of the Python client library are <code class="docutils literal"><span class="pre">snake_cased</span></code>, instead of JavaScript’s <code class="docutils literal"><span class="pre">camelCase</span></code>.</p>
</div>
<div class="section" id="authentication">
<h3>Authentication<a class="headerlink" href="#authentication" title="Permalink to this headline">¶</a></h3>
<p>To get your own content from Contentful, an app should authenticate with an OAuth bearer token.</p>
<p>You can create API keys using the <a class="reference external" href="https://app.contentful.com">Contentful web interface</a>. Go to the app, open the space that you want to access (top left corner lists all the spaces), and navigate to the APIs area. Open the API Keys section and create your first token. Done.</p>
<p>Don’t forget to also get your Space ID.</p>
<p>For more information, check the [Contentful REST API reference on Authentication](<a class="reference external" href="https://www.contentful.com/developers/docs/references/authentication/">https://www.contentful.com/developers/docs/references/authentication/</a>).</p>
</div>
</div>
<div class="section" id="documentation-references">
<h2>Documentation & References<a class="headerlink" href="#documentation-references" title="Permalink to this headline">¶</a></h2>
<ul>
<li><a href="#configuration">Configuration</a></li>
<li><a href="#reference-documentation">Reference documentation</a></li>
<li><a href="#tutorials--other-resources">Tutorials & other resources</a></li>
<li><a href="#advanced-concepts">Advanced Concepts</a></li>
</ul><p>To help you get the most out of this SDK, we’ve prepared all available client configuration options, reference documentation, tutorials and other examples that will help you learn and understand how to use this library.</p>
<div class="section" id="configuration">
<h3>Configuration<a class="headerlink" href="#configuration" title="Permalink to this headline">¶</a></h3>
<p>The client constructor supports several options you may set to achieve the expected behavior:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">client</span> <span class="o">=</span> <span class="n">contentful</span><span class="o">.</span><span class="n">Client</span><span class="p">(</span>
<span class="n">SPACE_ID</span><span class="p">,</span>
<span class="n">ACCESS_TOKEN</span><span class="p">,</span>
<span class="c1"># ... your options here ...</span>
<span class="p">)</span>
</pre></div>
</div>
<table>
<thead>
<tr>
<th>Name</th>
<th>Default</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>space_id</code></td>
<td></td>
<td><strong>Required</strong>. Your space ID.</td>
</tr>
<tr>
<td><code>access_token</code></td>
<td></td>
<td><strong>Required</strong>. Your access token.</td>
</tr>
<tr>
<td><code>environment</code></td>
<td>'master'</td>
<td>Your environment ID.</td>
</tr>
<tr>
<td><code>api_url</code></td>
<td><code>'cdn.contentful.com'</code></td>
<td>Set the host used to build the request URIs.</td>
</tr>
<tr>
<td><code>default_locale</code></td>
<td><code>'en-US'</code></td>
<td>Defines default locale for the client.</td>
</tr>
<tr>
<td><code>secure</code></td>
<td><code>True</code></td>
<td>Defines whether to use HTTPS or HTTP. By default we use HTTPS.</td>
</tr>
<tr>
<td><code>authorization_as_header</code></td>
<td><code>True</code></td>
<td>Sets the authentication mechanisms, if <code>False</code> will send authentication via query string.</td>
</tr>
<tr>
<td><code>raise_errors</code></td>
<td><code>True</code></td>
<td>Determines whether errors are raised or returned.</td>
</tr>
<tr>
<td><code>content_type_cache</code></td>
<td><code>True</code></td>
<td>
Determines if content type caching is enabled automatically or not,
allowing for accessing of fields even when they are not present on the response.
</td>
</tr>
<tr>
<td><code>raw_mode</code></td>
<td><code>False</code></td>
<td>If enabled, API responses are not parsed and the raw response object is returned instead.</td>
</tr>
<tr>
<td><code>gzip_encoded</code></td>
<td><code>True</code></td>
<td>Enables gzip response content encoding.</td>
</tr>
<tr>
<td><code>max_rate_limit_retries</code></td>
<td><code>1</code></td>
<td>
To increase or decrease the retry attempts after a 429 Rate Limit error. Default value is 1. Using 0 will disable retry behaviour.
Each retry will be attempted after the value (in seconds) of the <code>X-Contentful-RateLimit-Reset</code> header,
which contains the amount of seconds until the next non rate limited request is available, has passed.
This is blocking per execution thread.
</td>
</tr>
<tr>
<td><code>max_rate_limit_wait</code></td>
<td><code>60</code></td>
<td>
Maximum time to wait for next available request (in seconds). Default value is 60 seconds.
Keep in mind that if you hit the hourly rate limit maximum, you can have up to 60 minutes of blocked requests.
It is set to a default of 60 seconds in order to avoid blocking processes for too long, as rate limit retry behaviour
is blocking per execution thread.
</td>
</tr>
<tr>
<td><code>timeout_s</code></td>
<td><code>1</code></td>
<td>
Maximum time (in seconds) that is allowed for a request before raising a timeout error.
</td>
</tr>
<tr>
<td><code>max_include_resolution_depth</code></td>
<td><code>20</code></td>
<td>
Maximum amount of levels to resolve includes for SDK entities
(this is independent of API-level includes - it represents the maximum depth the include resolution
tree is allowed to resolved before falling back to <code>Link</code> objects).
This include resolution strategy is in place in order to avoid having infinite circular recursion on resources with circular dependencies.
<strong>Note</strong>: If you're using an application cache it's advisable to considerably lower this value
(around 5 has proven to be a good compromise - but keep it higher or equal than your maximum API-level include parameter if you need the entire tree resolution).
Note that when <code>reuse_entries</code> is enabled, the max include resolution depth only affects
deep chains of unique objects (ie, not simple circular references).
</td>
</tr>
<tr>
<td><code>reuse_entries</code></td>
<td><code>False</code></td>
<td>
When enabled, reuse hydrated Entry and Asset objects within the same request when possible.
Can result in a large speed increase and better handles cyclical object graphs.
This can be a good alternative to <code>max_include_resolution_depth</code> if your content model contains (or can contain) circular references.
<strong>Caching may break if this option is enabled, as it may generate stack errors.</strong>
When caching, deactivate this option and opt for a conservative <code>max_include_resolution_depth</code> value.
</td>
</tr>
<tr>
<td><code>proxy_host</code></td>
<td><code>None</code></td>
<td>To be able to perform a request behind a proxy, this needs to be set. It can be a domain or IP address of the proxy server.</td>
</tr>
<tr>
<td><code>proxy_port</code></td>
<td><code>None</code></td>
<td>Specify the port number that is used by the proxy server for client connections.</td>
</tr>
<tr>
<td><code>proxy_username</code></td>
<td><code>None</code></td>
<td>Username for proxy authentication.</td>
</tr>
<tr>
<td><code>proxy_password</code></td>
<td><code>None</code></td>
<td>Password for proxy authentication.</td>
</tr>
</tbody>
</table></div>
<div class="section" id="reference-documentation">
<h3>Reference documentation<a class="headerlink" href="#reference-documentation" title="Permalink to this headline">¶</a></h3>
<div class="section" id="basic-queries">
<h4>Basic queries<a class="headerlink" href="#basic-queries" title="Permalink to this headline">¶</a></h4>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">content_types</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">content_types</span><span class="p">()</span>
<span class="n">cat_content_type</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">content_type</span><span class="p">(</span><span class="s1">'cat'</span><span class="p">)</span>
<span class="n">nyancat</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">entry</span><span class="p">(</span><span class="s1">'nyancat'</span><span class="p">)</span>
<span class="n">entries</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">entries</span><span class="p">()</span>
<span class="n">assets</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">assets</span><span class="p">()</span>
<span class="n">nyancat_asset</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">asset</span><span class="p">(</span><span class="s1">'nyancat'</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="section" id="filtering-options">
<h4>Filtering options<a class="headerlink" href="#filtering-options" title="Permalink to this headline">¶</a></h4>
<p>You can pass the usual filter options to the query:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">client</span><span class="o">.</span><span class="n">entries</span><span class="p">({</span><span class="s1">'content_type'</span><span class="p">:</span> <span class="s1">'cat'</span><span class="p">})</span> <span class="c1"># query for a content-type by its ID (not name)</span>
<span class="n">client</span><span class="o">.</span><span class="n">entries</span><span class="p">({</span><span class="s1">'sys.id[ne]'</span><span class="p">:</span> <span class="s1">'nyancat'</span><span class="p">})</span> <span class="c1"># query for all entries except 'nyancat'</span>
<span class="n">client</span><span class="o">.</span><span class="n">entries</span><span class="p">({</span><span class="s1">'include'</span><span class="p">:</span> <span class="mi">1</span><span class="p">})</span> <span class="c1"># include one level of linked resources</span>
<span class="n">client</span><span class="o">.</span><span class="n">entries</span><span class="p">({</span><span class="s1">'content_type'</span><span class="p">:</span> <span class="s1">'cat'</span><span class="p">,</span> <span class="s1">'include'</span><span class="p">:</span> <span class="mi">1</span><span class="p">})</span> <span class="c1"># you can also combine multiple parameters</span>
</pre></div>
</div>
<p>To read more about filtering options you can check our <a class="reference external" href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">search parameters documentation</a>.</p>
<p>The results are returned as <cite>contentful.resource.Resource <contentful.resource.Resource></cite> objects. Multiple results will be returned as <cite>list</cite>.</p>
</div>
<div class="section" id="accessing-fields-and-sys-properties">
<h4>Accessing fields and sys properties<a class="headerlink" href="#accessing-fields-and-sys-properties" title="Permalink to this headline">¶</a></h4>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">content_type</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">content_type</span><span class="p">(</span><span class="s1">'cat'</span><span class="p">)</span>
<span class="n">content_type</span><span class="o">.</span><span class="n">description</span> <span class="c1"># "Meow."</span>
</pre></div>
</div>
<p>System Properties behave the same and can be accessed via the <code class="docutils literal"><span class="pre">#sys</span></code> method.</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">content_type</span><span class="o">.</span><span class="n">id</span> <span class="c1"># => 'cat'</span>
<span class="n">entry</span><span class="o">.</span><span class="n">type</span> <span class="c1"># => 'Entry'</span>
<span class="n">asset</span><span class="o">.</span><span class="n">sys</span> <span class="c1"># { 'id': '...', 'type': '...' }</span>
</pre></div>
</div>
<p>Entry fields also have direct accessors and will be coerced to the type defined in it’s content type.</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">entry</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">entry</span><span class="p">(</span><span class="s1">'nyancat'</span><span class="p">)</span>
<span class="n">entry</span><span class="o">.</span><span class="n">lives</span> <span class="c1"># 1337</span>
<span class="n">entry</span><span class="o">.</span><span class="n">fields</span><span class="p">()</span> <span class="c1"># { 'name': '...', 'lives': '...', ... }</span>
</pre></div>
</div>
</div>
<div class="section" id="using-different-locales">
<h4>Using different locales<a class="headerlink" href="#using-different-locales" title="Permalink to this headline">¶</a></h4>
<p>Entries can have multiple locales, by default, the client only fetches the entry with only its default locale.
If you want to fetch a different locale you can do the following:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">entries</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">entries</span><span class="p">({</span><span class="s1">'locale'</span><span class="p">:</span> <span class="s1">'de-DE'</span><span class="p">})</span>
</pre></div>
</div>
<p>Then all the fields will be fetched for the requested locale.</p>
<p>Contentful Delivery API also allows to fetch all locales, you can do so by doing:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">entries</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">entries</span><span class="p">({</span><span class="s1">'content_type'</span><span class="p">:</span> <span class="s1">'cat'</span><span class="p">,</span> <span class="s1">'locale'</span><span class="p">:</span> <span class="s1">'*'</span><span class="p">})</span>
<span class="c1"># assuming the entry has a field called name</span>
<span class="n">my_spanish_name</span> <span class="o">=</span> <span class="n">entries</span><span class="o">.</span><span class="n">first</span><span class="o">.</span><span class="n">fields</span><span class="p">(</span><span class="s1">'es-AR'</span><span class="p">)[</span><span class="s1">'name'</span><span class="p">]</span>
</pre></div>
</div>
<p>When requesting multiple locales, the object accessor shortcuts only work for the default locale.</p>
</div>
<div class="section" id="links">
<h4>Links<a class="headerlink" href="#links" title="Permalink to this headline">¶</a></h4>
<p>You can easily request a resource that is represented by a link by calling <code class="docutils literal"><span class="pre">#resolve</span></code>:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">happycat</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">entry</span><span class="p">(</span><span class="s1">'happycat'</span><span class="p">)</span>
<span class="n">happycat</span><span class="o">.</span><span class="n">space</span>
<span class="c1"># <Link[Space] id='cfexampleapi'></span>
<span class="n">happycat</span><span class="o">.</span><span class="n">space</span><span class="o">.</span><span class="n">resolve</span><span class="p">(</span><span class="n">client</span><span class="p">)</span>
<span class="c1"># <Space[Contentful Example API] id='cfexampleapi'></span>
</pre></div>
</div>
<p>This works for any kind of Resource.</p>
</div>
<div class="section" id="assets">
<h4>Assets<a class="headerlink" href="#assets" title="Permalink to this headline">¶</a></h4>
<p>There is a helpful method to add image resize options for an asset image:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">client</span><span class="o">.</span><span class="n">asset</span><span class="p">(</span><span class="s1">'happycat'</span><span class="p">)</span><span class="o">.</span><span class="n">url</span><span class="p">()</span>
<span class="c1"># => "//images.contentful.com/cfexampleapi/3MZPnjZTIskAIIkuuosCss/</span>
<span class="c1"># 382a48dfa2cb16c47aa2c72f7b23bf09/happycatw.jpg"</span>
<span class="n">client</span><span class="o">.</span><span class="n">asset</span><span class="p">(</span><span class="s1">'happycat'</span><span class="p">)</span><span class="o">.</span><span class="n">url</span><span class="p">(</span><span class="n">w</span><span class="o">=</span><span class="mi">300</span><span class="p">,</span> <span class="n">h</span><span class="o">=</span><span class="mi">200</span><span class="p">,</span> <span class="n">fm</span><span class="o">=</span><span class="s1">'jpg'</span><span class="p">,</span> <span class="n">q</span><span class="o">=</span><span class="mi">100</span><span class="p">)</span>
<span class="c1"># => "//images.contentful.com/cfexampleapi/3MZPnjZTIskAIIkuuosCss/</span>
<span class="c1"># 382a48dfa2cb16c47aa2c72f7b23bf09/happycatw.jpg?w=300&h=200&fm=jpg&q=100"</span>
</pre></div>
</div>
</div>
<div class="section" id="entries">
<h4>Entries<a class="headerlink" href="#entries" title="Permalink to this headline">¶</a></h4>
<p>Entries can have fields in it’s default locale accessible with accessor methods:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">nyancat</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">entry</span><span class="p">(</span><span class="s1">'nyancat'</span><span class="p">)</span>
<span class="n">nyancat</span><span class="o">.</span><span class="n">name</span>
<span class="c1"># 'Nyan Cat'</span>
</pre></div>
</div>
</div>
<div class="section" id="property-accessors">
<h4>Property Accessors<a class="headerlink" href="#property-accessors" title="Permalink to this headline">¶</a></h4>
<p>This SDK provides a simple API to interact with resources that come from the API,
by abstracting the underlying JSON structure of the objects, and exposing all the relevant fields as
object properties.</p>
<p>For all resources, <code class="docutils literal"><span class="pre">sys</span></code> properties will be available as top level properties, for example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">space</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">space</span><span class="p">()</span>
<span class="n">space</span><span class="o">.</span><span class="n">id</span>
<span class="c1"># will return the value of space.sys['id']</span>
</pre></div>
</div>
<p>In the case of <code class="docutils literal"><span class="pre">Entries</span></code> and <code class="docutils literal"><span class="pre">Assets</span></code>, as well as having <code class="docutils literal"><span class="pre">sys</span></code> available as properties,
also all the fields on present on <code class="docutils literal"><span class="pre">fields</span></code> will be available as properties, for example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">entry</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">entry</span><span class="p">(</span><span class="s1">'nyancat'</span><span class="p">)</span>
<span class="n">entry</span><span class="o">.</span><span class="n">name</span>
<span class="c1"># 'Nyan Cat'</span>
<span class="c1"># this is equivalent to entry.fields()['name']</span>
<span class="n">asset</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">assets</span><span class="p">()[</span><span class="mi">0</span><span class="p">]</span>
<span class="n">asset</span><span class="o">.</span><span class="n">file</span><span class="p">[</span><span class="s1">'details'</span><span class="p">][</span><span class="s1">'size'</span><span class="p">]</span>
<span class="c1"># will return the size of the image</span>
<span class="c1"># this is equivalent to asset.fields()['file']['details']['size']</span>
</pre></div>
</div>
<p>Other resources, which contain top level properties other than <code class="docutils literal"><span class="pre">sys</span></code> or <code class="docutils literal"><span class="pre">fields</span></code>,
have those available as object properties, for example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">locale</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">locales</span><span class="p">()[</span><span class="mi">0</span><span class="p">]</span>
<span class="n">locale</span><span class="o">.</span><span class="n">default</span>
<span class="c1"># True</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="advanced-concepts">
<h3>Advanced Concepts<a class="headerlink" href="#advanced-concepts" title="Permalink to this headline">¶</a></h3>
<div class="section" id="logging">
<h4>Logging<a class="headerlink" href="#logging" title="Permalink to this headline">¶</a></h4>
<p>To use the logger, use the standard library <code class="docutils literal"><span class="pre">logging</span></code> module:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">logging</span>
<span class="n">logging</span><span class="o">.</span><span class="n">basicConfig</span><span class="p">(</span><span class="n">level</span><span class="o">=</span><span class="n">logging</span><span class="o">.</span><span class="n">DEBUG</span><span class="p">)</span>
<span class="n">client</span><span class="o">.</span><span class="n">entries</span><span class="p">()</span>
<span class="c1"># INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): cdn.contentful.com</span>
<span class="c1"># DEBUG:requests.packages.urllib3.connectionpool:"GET /spaces/cfexampleapi/entries HTTP/1.1" 200 1994</span>
</pre></div>
</div>
</div>
<div class="section" id="proxy-example">
<h4>Proxy example<a class="headerlink" href="#proxy-example" title="Permalink to this headline">¶</a></h4>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">client</span> <span class="o">=</span> <span class="n">contentful</span><span class="o">.</span><span class="n">Client</span><span class="p">(</span>
<span class="s1">'cfexampleapi'</span><span class="p">,</span>
<span class="s1">'b4c0n7n37fu1'</span><span class="p">,</span>
<span class="n">proxy_host</span><span class="o">=</span><span class="s1">'127.0.0.1'</span><span class="p">,</span>
<span class="n">proxy_port</span><span class="o">=</span><span class="mi">8000</span><span class="p">,</span>
<span class="n">proxy_username</span><span class="o">=</span><span class="s1">'username'</span><span class="p">,</span>
<span class="n">proxy_password</span><span class="o">=</span><span class="s1">'secrect_password'</span>
<span class="p">)</span>
</pre></div>
</div>
</div>
<div class="section" id="id1">
<h4>Synchronization<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h4>
<p>The client also includes a wrapper for the synchronization endpoint.
You can call it either with <code class="docutils literal"><span class="pre">initial=True</span></code> or with a previous <code class="docutils literal"><span class="pre">sync_token</span></code>,
additional options are described in the <a class="reference external" href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/synchronization">API Documentation</a>:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">sync</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">sync</span><span class="p">({</span><span class="s1">'initial'</span><span class="p">:</span> <span class="kc">True</span><span class="p">})</span> <span class="c1"># Returns all content currently in space</span>
<span class="c1"># <SyncPage next_sync_token='w5ZGw6JFwqZmVcKsE8Kow4grw45QdybCnV_Cg8OASMKpwo1UY8K8bsKFwqJrw7DDhcKnM2RDOVbDt1E-wo7CnDjChMKKGsK1wrzCrBzCqMOpZAwOOcOvCcOAwqHDv0XCiMKaOcOxZA8BJUzDr8K-wo1lNx7DnHE'></span>
<span class="n">sync</span><span class="o">.</span><span class="n">items</span>
<span class="c1"># [<Entry[1t9IbcfdCk6m04uISSsaIK] id='5ETMRzkl9KM4omyMwKAOki'>,</span>
<span class="c1"># <Entry[1t9IbcfdCk6m04uISSsaIK] id='7qVBlCjpWE86Oseo40gAEY'>,</span>
<span class="c1"># <Entry[1t9IbcfdCk6m04uISSsaIK] id='ge1xHyH3QOWucKWCCAgIG'>,</span>
<span class="c1"># <Entry[1t9IbcfdCk6m04uISSsaIK] id='4MU1s3potiUEM2G4okYOqw'>,</span>
<span class="c1"># <Asset id='1x0xpXu4pSGS4OukSyWGUK' url='//images.contentful.com/cfexampleapi/1x0xpXu4pSGS4OukSyWGUK/cc1239c6385428ef26f4180190532818/doge.jpg'>,</span>
<span class="c1"># <Entry[dog] id='jake'>,</span>
<span class="c1"># <Entry[cat] id='happycat'>,</span>
<span class="c1"># <Entry[dog] id='6KntaYXaHSyIw8M6eo26OK'>,</span>
<span class="c1"># <Entry[human] id='finn'>,</span>
<span class="c1"># <Entry[cat] id='nyancat'>,</span>
<span class="c1"># <Asset id='jake' url='//images.contentful.com/cfexampleapi/4hlteQAXS8iS0YCMU6QMWg/2a4d826144f014109364ccf5c891d2dd/jake.png'>,</span>
<span class="c1"># <Asset id='happycat' url='//images.contentful.com/cfexampleapi/3MZPnjZTIskAIIkuuosCss/382a48dfa2cb16c47aa2c72f7b23bf09/happycatw.jpg'>,</span>
<span class="c1"># <Asset id='nyancat' url='//images.contentful.com/cfexampleapi/4gp6taAwW4CmSgumq2ekUm/9da0cd1936871b8d72343e895a00d611/Nyan_cat_250px_frame.png'>,</span>
<span class="c1"># <Entry[cat] id='garfield'>]</span>
<span class="n">sync</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">sync</span><span class="p">({</span><span class="s1">'initial'</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s1">'type'</span><span class="p">:</span> <span class="s1">'Deletion'</span><span class="p">})</span> <span class="c1"># Only returns deleted entries and assets</span>
<span class="c1"># <SyncPage next_sync_token='w5ZGw6JFwqZmVcKsE8Kow4grw45QdybCnV_Cg8OASMKpwo1UY8K8bsKFwqJrw7DDhcKnM2RDOVbDt1E-wo7CnDjChMKKGsK1w5zCrA3CnU7CgEvDtsK6w7B2wrRZwrwPIgDCjVo8PMOoUcK2wqTCl8O1wpY8wpjCkGM'></span>
<span class="n">sync</span><span class="o">.</span><span class="n">items</span>
<span class="c1"># [<DeletedEntry id='4rPdazIwWkuuKEAQgemSmO'>,</span>
<span class="c1"># <DeletedAsset id='5c6VY0gWg0gwaIeYkUUiqG'>,</span>
<span class="c1"># <DeletedAsset id='finn'>,</span>
<span class="c1"># <DeletedAsset id='3MZPnjZTIskAIIkuuosCss'>,</span>
<span class="c1"># <DeletedAsset id='4gp6taAwW4CmSgumq2ekUm'>,</span>
<span class="c1"># <DeletedAsset id='1uf1qqyZuEuiwmigoUYkeu'>,</span>
<span class="c1"># <DeletedAsset id='4hlteQAXS8iS0YCMU6QMWg'>,</span>
<span class="c1"># <DeletedEntry id='CVebBDcQsSsu6yKKIayy'>]</span>
<span class="n">sync</span> <span class="o">=</span> <span class="n">sync</span><span class="o">.</span><span class="n">next</span><span class="p">(</span><span class="n">client</span><span class="p">)</span> <span class="c1"># equivalent to client.sync(sync_token=sync.next_sync_token)</span>
</pre></div>
</div>
</div>
</div>
</div>
<div class="section" id="tutorials-other-resources">
<h2>Tutorials & other resources<a class="headerlink" href="#tutorials-other-resources" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>This library is a wrapper around our Contentful Delivery REST API. Some more specific details such as search parameters and pagination are better explained on the <a class="reference external" href="https://www.contentful.com/developers/docs/references/content-delivery-api/">REST API reference</a>, and you can also get a better understanding of how the requests look under the hood.</li>
<li>Check the <a class="reference external" href="https://www.contentful.com/developers/docs/python/">Contentful for Python</a> page for Tutorials, Demo Apps, and more information on other ways of using Python with Contentful</li>
</ul>
</div>
<div class="section" id="reach-out-to-us">
<h2>Reach out to us<a class="headerlink" href="#reach-out-to-us" title="Permalink to this headline">¶</a></h2>
<div class="section" id="you-have-questions-about-how-to-use-this-library">
<h3>You have questions about how to use this library?<a class="headerlink" href="#you-have-questions-about-how-to-use-this-library" title="Permalink to this headline">¶</a></h3>
<ul>
<li>
Reach out to our community forum:
<a href="https://support.contentful.com/">
<img alt="Contentful Community Forum" src="https://img.shields.io/badge/-Join%20Community%20Forum-3AB2E6.svg?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MiA1OSI+CiAgPHBhdGggZmlsbD0iI0Y4RTQxOCIgZD0iTTE4IDQxYTE2IDE2IDAgMCAxIDAtMjMgNiA2IDAgMCAwLTktOSAyOSAyOSAwIDAgMCAwIDQxIDYgNiAwIDEgMCA5LTkiIG1hc2s9InVybCgjYikiLz4KICA8cGF0aCBmaWxsPSIjNTZBRUQyIiBkPSJNMTggMThhMTYgMTYgMCAwIDEgMjMgMCA2IDYgMCAxIDAgOS05QTI5IDI5IDAgMCAwIDkgOWE2IDYgMCAwIDAgOSA5Ii8+CiAgPHBhdGggZmlsbD0iI0UwNTM0RSIgZD0iTTQxIDQxYTE2IDE2IDAgMCAxLTIzIDAgNiA2IDAgMSAwLTkgOSAyOSAyOSAwIDAgMCA0MSAwIDYgNiAwIDAgMC05LTkiLz4KICA8cGF0aCBmaWxsPSIjMUQ3OEE0IiBkPSJNMTggMThhNiA2IDAgMSAxLTktOSA2IDYgMCAwIDEgOSA5Ii8+CiAgPHBhdGggZmlsbD0iI0JFNDMzQiIgZD0iTTE4IDUwYTYgNiAwIDEgMS05LTkgNiA2IDAgMCAxIDkgOSIvPgo8L3N2Zz4K&maxAge=31557600" />
</a>
</li>
<li>
Jump into our community slack channel:
<a href="https://www.contentful.com/slack/">
<img alt="Contentful Community Slack" src="https://img.shields.io/badge/-Join%20Community%20Slack-2AB27B.svg?logo=slack&maxAge=31557600" />
</a>
</li>
</ul></div>
<div class="section" id="you-found-a-bug-or-want-to-propose-a-feature">
<h3>You found a bug or want to propose a feature?<a class="headerlink" href="#you-found-a-bug-or-want-to-propose-a-feature" title="Permalink to this headline">¶</a></h3>
<ul>
<li>
File an issue here on GitHub:
<a href="https://github.com/contentful/contentful.rb/issues/new">
<img alt="File an Issue" src="https://img.shields.io/badge/-Create%20Issue-6cc644.svg?logo=github&maxAge=31557600" />
</a>.
Make sure to remove any credential from your code before sharing it.
</li>
</ul></div>
<div class="section" id="you-need-to-share-confidential-information-or-have-other-questions">
<h3>You need to share confidential information or have other questions?<a class="headerlink" href="#you-need-to-share-confidential-information-or-have-other-questions" title="Permalink to this headline">¶</a></h3>
<ul>
<li>
File a support ticket at our Contentful Customer Support:
<a href="https://www.contentful.com/support/">
<img alt="File support ticket" src="https://img.shields.io/badge/-Submit%20Support%20Ticket-3AB2E6.svg?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MiA1OSI+CiAgPHBhdGggZmlsbD0iI0Y4RTQxOCIgZD0iTTE4IDQxYTE2IDE2IDAgMCAxIDAtMjMgNiA2IDAgMCAwLTktOSAyOSAyOSAwIDAgMCAwIDQxIDYgNiAwIDEgMCA5LTkiIG1hc2s9InVybCgjYikiLz4KICA8cGF0aCBmaWxsPSIjNTZBRUQyIiBkPSJNMTggMThhMTYgMTYgMCAwIDEgMjMgMCA2IDYgMCAxIDAgOS05QTI5IDI5IDAgMCAwIDkgOWE2IDYgMCAwIDAgOSA5Ii8+CiAgPHBhdGggZmlsbD0iI0UwNTM0RSIgZD0iTTQxIDQxYTE2IDE2IDAgMCAxLTIzIDAgNiA2IDAgMSAwLTkgOSAyOSAyOSAwIDAgMCA0MSAwIDYgNiAwIDAgMC05LTkiLz4KICA8cGF0aCBmaWxsPSIjMUQ3OEE0IiBkPSJNMTggMThhNiA2IDAgMSAxLTktOSA2IDYgMCAwIDEgOSA5Ii8+CiAgPHBhdGggZmlsbD0iI0JFNDMzQiIgZD0iTTE4IDUwYTYgNiAwIDEgMS05LTkgNiA2IDAgMCAxIDkgOSIvPgo8L3N2Zz4K&maxAge=31557600" />
</a>
</li>
</ul></div>
</div>
<div class="section" id="get-involved">
<h2>Get involved<a class="headerlink" href="#get-involved" title="Permalink to this headline">¶</a></h2>
<a href="http://makeapullrequest.com">
<img alt="PRs Welcome" src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?maxAge=31557600" />
</a><p>We appreciate any help on our repositories. For more details about how to contribute see our <a class="reference external" href="./CONTRIBUTING.md">CONTRIBUTING.md</a> document.</p>
</div>
<div class="section" id="sdk-modules-reference">
<h2>SDK Modules Reference<a class="headerlink" href="#sdk-modules-reference" title="Permalink to this headline">¶</a></h2>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="modules.html">contentful</a><ul>
<li class="toctree-l2"><a class="reference internal" href="contentful.html">contentful package</a><ul>
<li class="toctree-l3"><a class="reference internal" href="contentful.html#submodules">Submodules</a></li>
<li class="toctree-l3"><a class="reference internal" href="contentful.html#module-contentful.array">contentful.array module</a><ul>
<li class="toctree-l4"><a class="reference internal" href="contentful.html#contentful-array">contentful.array</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="contentful.html#module-contentful.asset">contentful.asset module</a></li>
<li class="toctree-l3"><a class="reference internal" href="contentful.html#module-contentful.client">contentful.client module</a></li>
<li class="toctree-l3"><a class="reference internal" href="contentful.html#module-contentful.content_type">contentful.content_type module</a></li>
<li class="toctree-l3"><a class="reference internal" href="contentful.html#module-contentful.content_type_cache">contentful.content_type_cache module</a><ul>
<li class="toctree-l4"><a class="reference internal" href="contentful.html#contentful-content-type-cache">contentful.content_type_cache</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="contentful.html#module-contentful.content_type_field">contentful.content_type_field module</a></li>
<li class="toctree-l3"><a class="reference internal" href="contentful.html#module-contentful.content_type_field_types">contentful.content_type_field_types module</a></li>
<li class="toctree-l3"><a class="reference internal" href="contentful.html#module-contentful.deleted_asset">contentful.deleted_asset module</a></li>
<li class="toctree-l3"><a class="reference internal" href="contentful.html#module-contentful.deleted_entry">contentful.deleted_entry module</a></li>
<li class="toctree-l3"><a class="reference internal" href="contentful.html#module-contentful.entry">contentful.entry module</a></li>
<li class="toctree-l3"><a class="reference internal" href="contentful.html#module-contentful.errors">contentful.errors module</a><ul>
<li class="toctree-l4"><a class="reference internal" href="contentful.html#contentful-errors">contentful.errors</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="contentful.html#module-contentful.locale">contentful.locale module</a></li>
<li class="toctree-l3"><a class="reference internal" href="contentful.html#module-contentful.resource">contentful.resource module</a></li>
<li class="toctree-l3"><a class="reference internal" href="contentful.html#module-contentful.resource_builder">contentful.resource_builder module</a></li>
<li class="toctree-l3"><a class="reference internal" href="contentful.html#module-contentful.space">contentful.space module</a></li>
<li class="toctree-l3"><a class="reference internal" href="contentful.html#module-contentful.sync_page">contentful.sync_page module</a></li>
<li class="toctree-l3"><a class="reference internal" href="contentful.html#module-contentful.utils">contentful.utils module</a></li>
<li class="toctree-l3"><a class="reference internal" href="contentful.html#module-contentful">Module contents</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="section" id="license">
<h2>License<a class="headerlink" href="#license" title="Permalink to this headline">¶</a></h2>
<p>Copyright (c) 2016 Contentful GmbH. See <a class="reference external" href="./LICENSE">LICENSE</a> for further details.</p>
</div>
<div class="section" id="code-of-conduct">
<h2>Code of Conduct<a class="headerlink" href="#code-of-conduct" title="Permalink to this headline">¶</a></h2>
<p>We want to provide a safe, inclusive, welcoming, and harassment-free space and experience for all participants, regardless of gender identity and expression, sexual orientation, disability, physical appearance, socioeconomic status, body size, ethnicity, nationality, level of experience, age, religion (or lack thereof), or other identity markers.</p>
<p><a class="reference external" href="https://github.com/contentful-developer-relations/community-code-of-conduct">Read our full Code of Conduct</a></p>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="#">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">contentful.py - Contentful Python Delivery SDK</a><ul>
<li><a class="reference internal" href="#core-features">Core Features</a></li>
<li><a class="reference internal" href="#getting-started">Getting Started</a><ul>
<li><a class="reference internal" href="#installation">Installation</a></li>
<li><a class="reference internal" href="#your-first-request">Your first request</a></li>
<li><a class="reference internal" href="#using-this-sdk-with-the-preview-api">Using this SDK with the Preview API</a></li>
<li><a class="reference internal" href="#authentication">Authentication</a></li>
</ul>
</li>
<li><a class="reference internal" href="#documentation-references">Documentation & References</a><ul>
<li><a class="reference internal" href="#configuration">Configuration</a></li>
<li><a class="reference internal" href="#reference-documentation">Reference documentation</a><ul>
<li><a class="reference internal" href="#basic-queries">Basic queries</a></li>
<li><a class="reference internal" href="#filtering-options">Filtering options</a></li>
<li><a class="reference internal" href="#accessing-fields-and-sys-properties">Accessing fields and sys properties</a></li>
<li><a class="reference internal" href="#using-different-locales">Using different locales</a></li>
<li><a class="reference internal" href="#links">Links</a></li>
<li><a class="reference internal" href="#assets">Assets</a></li>
<li><a class="reference internal" href="#entries">Entries</a></li>
<li><a class="reference internal" href="#property-accessors">Property Accessors</a></li>
</ul>
</li>
<li><a class="reference internal" href="#advanced-concepts">Advanced Concepts</a><ul>
<li><a class="reference internal" href="#logging">Logging</a></li>
<li><a class="reference internal" href="#proxy-example">Proxy example</a></li>
<li><a class="reference internal" href="#id1">Synchronization</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#tutorials-other-resources">Tutorials & other resources</a></li>
<li><a class="reference internal" href="#reach-out-to-us">Reach out to us</a><ul>
<li><a class="reference internal" href="#you-have-questions-about-how-to-use-this-library">You have questions about how to use this library?</a></li>
<li><a class="reference internal" href="#you-found-a-bug-or-want-to-propose-a-feature">You found a bug or want to propose a feature?</a></li>
<li><a class="reference internal" href="#you-need-to-share-confidential-information-or-have-other-questions">You need to share confidential information or have other questions?</a></li>
</ul>
</li>
<li><a class="reference internal" href="#get-involved">Get involved</a></li>
<li><a class="reference internal" href="#sdk-modules-reference">SDK Modules Reference</a></li>
<li><a class="reference internal" href="#license">License</a></li>
<li><a class="reference internal" href="#code-of-conduct">Code of Conduct</a></li>
</ul>
</li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="#">Documentation overview</a><ul>
<li>Next: <a href="modules.html" title="next chapter">contentful</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">
©2016, Contentful GmbH.
</div>
<a href="https://github.com/contentful/contentful.py" 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>