contentful_management package

Submodules

contentful_management.api_key module

class contentful_management.api_key.ApiKey(item, **kwargs)[source]

Bases: contentful_management.resource.Resource

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/api-keys

classmethod create_attributes(attributes, previous_object=None)[source]

Attributes for resource creation.

preview_api_key()[source]
to_json()[source]

Returns the JSON representation of the API key.

classmethod update_attributes_map()[source]

Defines keys and default values for non-generic attributes.

contentful_management.api_keys_proxy module

class contentful_management.api_keys_proxy.ApiKeysProxy(client, space_id, environment_id=None)[source]

Bases: contentful_management.client_proxy.ClientProxy

create(attributes=None, **kwargs)[source]

Creates an API key with given attributes.

contentful_management.array module

contentful_management.array

This module implements the Array class.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/introduction/collection-resources-and-pagination

copyright:
  1. 2018 by Contentful GmbH.
license:

MIT, see LICENSE for more details.

class contentful_management.array.Array(json, items)[source]

Bases: object

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/introduction/collection-resources-and-pagination

contentful_management.asset module

class contentful_management.asset.Asset(item, **kwargs)[source]

Bases: contentful_management.resource.FieldsResource, contentful_management.resource.PublishResource, contentful_management.resource.ArchiveResource, contentful_management.resource.EnvironmentAwareResource

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/assets

process()[source]

Calls the process endpoint for all locales of the asset.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/assets/asset-processing

url(**kwargs)[source]

Returns a formatted URL for the asset’s File with serialized parameters.

Usage:
>>> my_asset.url()
"//images.contentful.com/spaces/foobar/..."
>>> my_asset.url(w=120, h=160)
"//images.contentful.com/spaces/foobar/...?w=120&h=160"

contentful_management.assets_proxy module

class contentful_management.assets_proxy.AssetsProxy(client, space_id, environment_id=None)[source]

Bases: contentful_management.client_proxy.ClientProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/assets

all(query=None, **kwargs)[source]

Gets all assets of a space.

find(asset_id, query=None, **kwargs)[source]

Gets a single asset by ID.

contentful_management.client module

class contentful_management.client.Client(access_token, api_url='api.contentful.com', uploads_api_url='upload.contentful.com', api_version=1, default_locale='en-US', https=True, raw_mode=False, gzip_encoded=True, raise_errors=True, proxy_host=None, proxy_port=None, proxy_username=None, proxy_password=None, max_rate_limit_retries=1, max_rate_limit_wait=60, application_name=None, application_version=None, integration_name=None, integration_version=None, additional_headers=None)[source]

Bases: object

Constructs the API client.

Parameters:
  • access_token – API access token.
  • api_url – (optional) URL of the Contentful API, defaults to Management API.
  • uploads_api_url – (optional) URL of the Contentful upload API, defaults to Upload API.
  • api_version – (optional) Target version of the Contentful API.
  • default_locale – (optional) Default locale for your spaces, defaults to ‘en-US’.
  • https – (optional) Boolean determining wether to use https or http, defaults to True.
  • raw_mode – (optional) Boolean determining wether to process the response or return it raw after each API call, defaults to True.
  • gzip_encoded – (optional) Boolean determining wether to accept gzip encoded results, defaults to True.
  • raise_errors – (optional) Boolean determining wether to raise an exception on requests that aren’t successful, defaults to True.
  • proxy_host – (optional) URL for Proxy, defaults to None.
  • proxy_port – (optional) Port for Proxy, defaults to None.
  • proxy_username – (optional) Username for Proxy, defaults to None.
  • proxy_password – (optional) Password for Proxy, defaults to None.
  • max_rate_limit_retries – (optional) Maximum amount of retries after RateLimitError, defaults to 1.
  • max_rate_limit_wait – (optional) Timeout (in seconds) for waiting for retry after RateLimitError, defaults to 60.
  • application_name – (optional) User application name, defaults to None.
  • application_version – (optional) User application version, defaults to None.
  • integration_name – (optional) Integration name, defaults to None.
  • integration_version – (optional) Integration version, defaults to None.
Returns:

Client object.

Return type:

contentful.Client

Usage:

>>> import contentful_management
>>> client = contentful_management.Client('YOUR_MANAGEMENT_TOKEN')
<contentful_management.Client access_token="YOUR_MANAGEMENT_TOKEN" default_locale="en-US">
api_keys(space_id)[source]

Provides access to API key management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/api-keys

Returns:ApiKeysProxy object.
Return type:contentful.api_keys_proxy.ApiKeysProxy

Usage:

>>> api_keys_proxy = client.api_keys('cfexampleapi')
<ApiKeysProxy space_id="cfexampleapi">
assets(space_id, environment_id)[source]

Provides access to asset management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/assets

Returns:AssetsProxy object.
Return type:contentful.assets_proxy.AssetsProxy

Usage:

>>> assets_proxy = client.assets('cfexampleapi', 'master')
<AssetsProxy space_id="cfexampleapi" environment_id="master">
content_type_snapshots(space_id, environment_id, content_type_id)[source]

Provides access to content type snapshot management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/snapshots

Returns:SnapshotsProxy object.
Return type:contentful.snapshots_proxy.SnapshotsProxy

Usage:

>>> content_type_snapshots_proxy = client.content_type_snapshots('cfexampleapi', 'master', 'cat')
<SnapshotsProxy[content_types] space_id="cfexampleapi" environment_id="master" parent_resource_id="cat">
content_types(space_id, environment_id)[source]

Provides access to content type management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/content-types

Returns:ContentTypesProxy object.
Return type:contentful.content_types_proxy.ContentTypesProxy

Usage:

>>> content_types_proxy = client.content_types('cfexampleapi', 'master')
<ContentTypesProxy space_id="cfexampleapi" environment_id="master">
editor_interfaces(space_id, environment_id, content_type_id)[source]

Provides access to editor interfaces management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/editor-interface

Returns:EditorInterfacesProxy object.
Return type:contentful.editor_interfaces_proxy.EditorInterfacesProxy

Usage:

>>> editor_interfaces_proxy = client.editor_interfaces('cfexampleapi', 'master', 'cat')
<EditorInterfacesProxy space_id="cfexampleapi" environment_id="master" content_type_id="cat">
entries(space_id, environment_id)[source]

Provides access to entry management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/entries

Returns:EntriesProxy object.
Return type:contentful.entries_proxy.EntriesProxy

Usage:

>>> entries_proxy = client.entries('cfexampleapi', 'master')
<EntriesProxy space_id="cfexampleapi" environment_id="master">
entry_snapshots(space_id, environment_id, entry_id)[source]

Provides access to entry snapshot management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/snapshots

Returns:SnapshotsProxy object.
Return type:contentful.snapshots_proxy.SnapshotsProxy

Usage:

>>> entry_snapshots_proxy = client.entry_snapshots('cfexampleapi', 'master', 'nyancat')
<SnapshotsProxy[entries] space_id="cfexampleapi" environment_id="master" parent_resource_id="nyancat">
environments(space_id)[source]

Provides access to environment management methods.

API reference: TBD

Returns:TBD object.
Return type:contentful.environments_proxy.EnvironmentsProxy

Usage:

>>> environments_proxy = client.environments('cfexampleapi')
<EnvironmentsProxy space_id="cfexampleapi">
locales(space_id, environment_id)[source]

Provides access to locale management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/locales

Returns:LocalesProxy object.
Return type:contentful.locales_proxy.LocalesProxy

Usage:

>>> locales_proxy = client.locales('cfexampleapi', 'master')
<LocalesProxy space_id="cfexampleapi" environment_id="master">
memberships(space_id)[source]

Provides access to space membership management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/space-memberships

Returns:SpaceMembershipsProxy object.
Return type:contentful.space_memberships_proxy.SpaceMembershipsProxy

Usage:

>>> space_memberships_proxy = client.memberships('cfexampleapi')
<SpaceMembershipsProxy space_id="cfexampleapi">
organization_periodic_usages(organization_id)[source]

Provides access to an organizations usage periods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/usage

Returns:OrganizationPeriodicUsagesProxy object.
Return type:contentful.organization_periodic_usages.OrganizationPeriodicUsagesProxy

Usage:

>>> organization_periodic_usages = client.organization_periodic_usages('organization_id')
<OrganizationPeriodicUsagesProxy organization_id='organization_id'>
organizations()[source]

Provides access to organization management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/organizations

Returns:OrganizationsProxy object.
Return type:contentful.organizations_proxy.OrganizationsProxy

Usage:

>>> organizations_proxy = client.organizations()
<OrganizationsProxy>
personal_access_tokens()[source]

Provides access to personal access token management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/personal-access-tokens

Returns:PersonalAccessTokensProxy object.
Return type:contentful.personal_access_tokens_proxy.PersonalAccessTokensProxy

Usage:

>>> personal_access_tokens_proxy = client.personal_access_tokens()
<PersonalAccessTokensProxy>
preview_api_keys(space_id)[source]

Provides access to Preview API key management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/api-keys/preview-api-key/get-a-single-preview-api-key

Returns:PreviewApiKeysProxy object.
Return type:contentful.preview_api_keys_proxy.PreviewApiKeysProxy

Usage:

>>> preview_api_keys_proxy = client.preview_api_keys('cfexampleapi')
<PreviewApiKeysProxy space_id="cfexampleapi">
roles(space_id)[source]

Provides access to role management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/roles

Returns:RolesProxy object.
Return type:contentful.roles_proxy.RolesProxy

Usage:

>>> roles_proxy = client.roles('cfexampleapi')
<RolesProxy space_id="cfexampleapi">
snapshots(space_id, environment_id, resource_id, resource_kind='entries')[source]

Provides access to snapshot management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/snapshots

Returns:SnapshotsProxy object.
Return type:contentful.snapshots_proxy.SnapshotsProxy

Usage:

>>> entry_snapshots_proxy = client.snapshots('cfexampleapi', 'master', 'nyancat')
<SnapshotsProxy[entries] space_id="cfexampleapi" environment_id="master" parent_resource_id="nyancat">
>>> content_type_snapshots_proxy = client.snapshots('cfexampleapi', 'master', 'cat', 'content_types')
<SnapshotsProxy[content_types] space_id="cfexampleapi" environment_id="master" parent_resource_id="cat">
space_periodic_usages(organization_id)[source]

Provides access to an organizations usage periods grouped by space.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/usage

Returns:SpacePeriodicUsagesProxy object.
Return type:contentful.space_periodic_usages_proxy.SpacePeriodicUsagesProxy

Usage:

>>> space_periodic_usages = client.space_periodic_usages('organization_id')
<SpacePeriodicUsagesProxy organization_id='organization_id'>
spaces()[source]

Provides access to space management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/spaces

Returns:SpacesProxy object.
Return type:contentful.spaces_proxy.SpacesProxy

Usage:

>>> spaces_proxy = client.spaces()
<SpacesProxy>
ui_extensions(space_id, environment_id)[source]

Provides access to UI extensions management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/ui-extensions

Returns:UIExtensionsProxy object.
Return type:contentful.ui_extensions_proxy.UIExtensionsProxy

Usage:

>>> ui_extensions_proxy = client.ui_extensions('cfexampleapi', 'master')
<UIExtensionsProxy space_id="cfexampleapi" environment_id="master">
uploads(space_id)[source]

Provides access to upload management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/uploads

Returns:UploadsProxy object.
Return type:contentful.uploads_proxy.UploadsProxy

Usage:

>>> uploads_proxy = client.uploads('cfexampleapi')
<UploadsProxy space_id="cfexampleapi">
users()[source]

Provides access to user management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/users

Returns:UsersProxy object.
Return type:contentful.users_proxy.UsersProxy

Usage:

>>> users_proxy = client.users()
<UsersProxy>
webhook_calls(space_id, webhook_id)[source]

Provides access to webhook call information.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/webhook-calls

Returns:WebhooksProxy object.
Return type:contentful.webhooks_call_proxy.WebhooksProxy

Usage:

>>> webhooks_call_proxy = client.webhook_calls('cfexampleapi', 'my_webhook')
<WebhooksCallProxy space_id="cfexampleapi" webhook_id="my_webhook">
webhook_health(space_id, webhook_id)[source]

Provides access to webhook health information.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/webhook-calls/webhook-health

Returns:WebhooksHealthProxy object.
Return type:contentful.webhooks_health_proxy.WebhooksHealthProxy

Usage:

>>> webhooks_health_proxy = client.webhook_calls('cfexampleapi', 'my_webhook')
<WebhooksHealthProxy space_id="cfexampleapi" webhook_id="my_webhook">
webhooks(space_id)[source]

Provides access to webhook management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/webhooks

Returns:WebhooksProxy object.
Return type:contentful.webhooks_proxy.WebhooksProxy

Usage:

>>> webhooks_proxy = client.webhooks('cfexampleapi')
<WebhooksProxy space_id="cfexampleapi">

contentful_management.client_proxy module

contentful_management.client_proxy

This module implements the ClientProxy class.

copyright:
  1. 2018 by Contentful GmbH.
license:

MIT, see LICENSE for more details.

class contentful_management.client_proxy.ClientProxy(client, space_id, environment_id=None)[source]

Bases: object

Base class for proxies.

all(query=None)[source]

Gets resource collection for _resource_class.

create(resource_id=None, attributes=None)[source]

Creates a resource with the given ID (optional) and attributes.

delete(resource_id, **kwargs)[source]

Deletes a resource by ID.

find(resource_id, query=None, **kwargs)[source]

Gets a single resource.

contentful_management.content_type module

class contentful_management.content_type.ContentType(item, **kwargs)[source]

Bases: contentful_management.resource.Resource, contentful_management.resource.PublishResource, contentful_management.resource.EnvironmentAwareResource

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/content-types

classmethod base_url(space_id, resource_id=None, public=False, environment_id=None, **kwargs)[source]

Returns the URI for the content type.

classmethod create_attributes(attributes, previous_object=None)[source]

Attributes for content type creation.

editor_interfaces()[source]

Provides access to editor interface management methods for the given content type.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/editor-interface

Returns:ContentTypeEditorInterfacesProxy object.
Return type:contentful.content_type_editor_interfaces_proxy.ContentTypeEditorInterfacesProxy

Usage:

>>> content_type_editor_interfaces_proxy = content_type.editor_interfaces()
<ContentTypeEditorInterfacesProxy space_id="cfexampleapi" environment_id="master" content_type_id="cat">
entries()[source]

Provides access to entry management methods for the given content type.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/entries

Returns:ContentTypeEntriesProxy object.
Return type:contentful.content_type_entries_proxy.ContentTypeEntriesProxy

Usage:

>>> content_type_entries_proxy = content_type.entries()
<ContentTypeEntriesProxy space_id="cfexampleapi" environment_id="master" content_type_id="cat">
snapshots()[source]

Provides access to snapshot management methods for the given content type.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/snapshots/content-type-snapshots-collection

Returns:ContentTypeSnapshotsProxy object.
Return type:contentful.content_type_snapshots_proxy.ContentTypeSnapshotsProxy

Usage:

>>> content_type_snapshots_proxy = content_type.entries()
<ContentTypeSnapshotsProxy space_id="cfexampleapi" environment_id="master" content_type_id="cat">
to_json()[source]

Returns the JSON representation of the content type.

classmethod update_attributes_map()[source]

Attributes for object mapping.

contentful_management.content_type_editor_interfaces_proxy module

class contentful_management.content_type_editor_interfaces_proxy.ContentTypeEditorInterfacesProxy(client, space_id, environment_id, content_type_id)[source]

Bases: contentful_management.content_type_resource_proxy.ContentTypeResourceProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/editor-interface

all()[source]

Gets the default editor interface.

create(**kwargs)[source]

Not supported.

default()[source]

Gets the default editor interface.

delete(*args, **kwargs)[source]

Not supported.

find(*args, **kwargs)[source]

Gets the default editor interface.

contentful_management.content_type_entries_proxy module

class contentful_management.content_type_entries_proxy.ContentTypeEntriesProxy(client, space_id, environment_id, content_type_id)[source]

Bases: contentful_management.content_type_resource_proxy.ContentTypeResourceProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/entries

contentful_management.content_type_field module

class contentful_management.content_type_field.ContentTypeField(field_data)[source]

Bases: object

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/content-types/content-type

coerce(value)[source]

Coerces the value to the proper type.

to_json()[source]

Returns the JSON Representation of the content type field.

contentful_management.content_type_field_types module

class contentful_management.content_type_field_types.ArrayField(items=None)[source]

Bases: contentful_management.content_type_field_types.BasicField

Array coercion class.

Coerces items in collection with it’s proper coercion class.

coerce(value)[source]

Coerces array items with proper coercion.

class contentful_management.content_type_field_types.BasicField(items=None)[source]

Bases: object

Base coercion class.

coerce(value)[source]

Just returns the value.

class contentful_management.content_type_field_types.BooleanField(items=None)[source]

Bases: contentful_management.content_type_field_types.BasicField

Boolean coercion class.

coerce(value)[source]

Coerces value to boolean.

class contentful_management.content_type_field_types.DateField(items=None)[source]

Bases: contentful_management.content_type_field_types.BasicField

Date coercion class.

coerce(value)[source]

Coerces ISO8601 date to datetime.datetime object.

class contentful_management.content_type_field_types.IntegerField(items=None)[source]

Bases: contentful_management.content_type_field_types.BasicField

Integer coercion class.

coerce(value)[source]

Coerces value to int.

class contentful_management.content_type_field_types.LinkField(items=None)[source]

Bases: contentful_management.content_type_field_types.BasicField

Nothing should be done here as include resolution is handled within entries due to depth handling (explained within Entry). Only present as a placeholder for proper resolution within ContentType.

class contentful_management.content_type_field_types.LocationField(items=None)[source]

Bases: contentful_management.content_type_field_types.BasicField

Location coercion class.

coerce(value)[source]

Coerces value to location hash.

class contentful_management.content_type_field_types.NumberField(items=None)[source]

Bases: contentful_management.content_type_field_types.BasicField

Number coercion class.

coerce(value)[source]

Coerces value to float.

class contentful_management.content_type_field_types.ObjectField(items=None)[source]

Bases: contentful_management.content_type_field_types.BasicField

Object coercion class.

coerce(value)[source]

Coerces value to JSON.

class contentful_management.content_type_field_types.RichTextField(items=None)[source]

Bases: contentful_management.content_type_field_types.BasicField

Rich Text coercion class.

coerce(value)[source]

Returns the rich text object as is. Include resolution and other particular processing is done for CDA only.

class contentful_management.content_type_field_types.SymbolField(items=None)[source]

Bases: contentful_management.content_type_field_types.BasicField

Symbol coercion class.

coerce(value)[source]

Coerces value to str.

class contentful_management.content_type_field_types.TextField(items=None)[source]

Bases: contentful_management.content_type_field_types.SymbolField

Text coercion class.

contentful_management.content_type_field_validation module

class contentful_management.content_type_field_validation.ContentTypeFieldValidation(validation_data)[source]

Bases: object

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/content-types/content-type

to_json()[source]

Returns the JSON Representation of the content type field validation.

contentful_management.content_type_resource_proxy module

contentful_management.content_type_resource_proxy

This module implements the ContentTypeResourceProxy class.

copyright:
  1. 2018 by Contentful GmbH.
license:

MIT, see LICENSE for more details.

class contentful_management.content_type_resource_proxy.ContentTypeResourceProxy(client, space_id, environment_id, content_type_id)[source]

Bases: object

Base class for content type related resource proxies.

all(query=None)[source]

Gets all resources related to the current content type.

create(resource_id=None, attributes=None)[source]

Creates a resource with a given ID (optional) and attributes for the current content type.

delete(resource_id)[source]

Deletes a resource by ID.

find(resource_id, query=None)[source]

Finds a single resource by ID related to the current content type.

contentful_management.content_type_snapshots_proxy module

class contentful_management.content_type_snapshots_proxy.ContentTypeSnapshotsProxy(client, space_id, environment_id, content_type_id)[source]

Bases: contentful_management.content_type_resource_proxy.ContentTypeResourceProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/snapshots/content-type-snapshots-collection

create(*args, **kwargs)[source]

Not supported.

delete(*args, **kwargs)[source]

Not supported.

contentful_management.content_types_proxy module

class contentful_management.content_types_proxy.ContentTypesProxy(client, space_id, environment_id=None)[source]

Bases: contentful_management.client_proxy.ClientProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/content-types/content-type

all_published()[source]

Gets all the published content types for a space.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/content-types/activated-content-type-collection

contentful_management.editor_interface module

class contentful_management.editor_interface.EditorInterface(item, **kwargs)[source]

Bases: contentful_management.resource.Resource, contentful_management.resource.EnvironmentAwareResource

API reference: https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/editor-interfaces

classmethod base_url(space_id, content_type_id, environment_id=None, **kwargs)[source]

Returns the URI for the editor interface.

to_json()[source]

Returns the JSON representation of the editor interface.

classmethod update_attributes_map()[source]

Attributes for object mapping.

contentful_management.editor_interfaces_proxy module

class contentful_management.editor_interfaces_proxy.EditorInterfacesProxy(client, space_id, environment_id=None, content_type_id=None)[source]

Bases: contentful_management.client_proxy.ClientProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/editor-interface

all()[source]

Gets the default editor interface.

create(*args, **kwargs)[source]

Not supported.

default()[source]

Gets the default editor interface.

delete(*args, **kwargs)[source]

Not supported.

find()[source]

Gets the default editor interface.

contentful_management.entries_proxy module

class contentful_management.entries_proxy.EntriesProxy(client, space_id, environment_id=None, content_type_id=None)[source]

Bases: contentful_management.client_proxy.ClientProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/entries

all(query=None)[source]

Gets all entries of a space.

create(resource_id=None, attributes=None, **kwargs)[source]

Creates an entry with a given ID (optional) and attributes.

find(entry_id, query=None)[source]

Gets a single entry by ID.

contentful_management.entry module

class contentful_management.entry.Entry(*args, **kwargs)[source]

Bases: contentful_management.resource.FieldsResource, contentful_management.resource.PublishResource, contentful_management.resource.ArchiveResource, contentful_management.resource.EnvironmentAwareResource

API reference: https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/entries

classmethod create_headers(attributes)[source]

Headers for entry creation.

snapshots()[source]

Provides access to snapshot management methods for the given entry.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/snapshots

Returns:EntrySnapshotsProxy object.
Return type:contentful.entry_snapshots_proxy.EntrySnapshotsProxy

Usage:

>>> entry_snapshots_proxy = entry.snapshots()
<EntrySnapshotsProxy space_id="cfexampleapi" environment_id="master" entry_id="nyancat">
update(attributes=None)[source]

Updates the entry with attributes.

contentful_management.entry_resource_proxy module

contentful_management.entry_resource_proxy

This module implements the EntryResourceProxy class.

copyright:
  1. 2018 by Contentful GmbH.
license:

MIT, see LICENSE for more details.

class contentful_management.entry_resource_proxy.EntryResourceProxy(client, space_id, environment_id, entry_id)[source]

Bases: object

Base Class for Entry related Resource Proxies

all(query=None)[source]

Gets all resources related to the current entry.

create(resource_id=None, attributes=None)[source]

Creates a resource with a given ID (optional) and attributes for the current entry.

delete(resource_id)[source]

Deletes a resource by ID.

find(resource_id, query=None)[source]

Finds a single resource by ID related to the current entry.

contentful_management.entry_snapshots_proxy module

class contentful_management.entry_snapshots_proxy.EntrySnapshotsProxy(client, space_id, environment_id, entry_id)[source]

Bases: contentful_management.entry_resource_proxy.EntryResourceProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/snapshots

create(*args, **kwargs)[source]

Not supported.

delete(*args, **kwargs)[source]

Not supported.

contentful_management.environment module

class contentful_management.environment.Environment(item, **kwargs)[source]

Bases: contentful_management.resource.Resource

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/locales

assets()[source]

Provides access to asset management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/assets

Returns:EnvironmentAssetsProxy object.
Return type:contentful.environment_assets_proxy.EnvironmentAssetsProxy

Usage:

>>> environment_assets_proxy = environment.assets()
<EnvironmentAssetsProxy space_id="cfexampleapi" environment_id="master">
classmethod base_url(space_id, resource_id=None, **kwargs)[source]

Returns the URI for the environment.

content_types()[source]

Provides access to content type management methods for content types of an environment.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/content-types

Returns:EnvironmentContentTypesProxy object.
Return type:contentful.space_content_types_proxy.EnvironmentContentTypesProxy

Usage:

>>> space_content_types_proxy = environment.content_types()
<EnvironmentContentTypesProxy space_id="cfexampleapi" environment_id="master">
classmethod create_attributes(attributes, previous_object=None)[source]

Attributes for environment creation.

classmethod create_headers(attributes)[source]

Headers for environment creation.

entries()[source]

Provides access to entry management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/entries

Returns:EnvironmentEntriesProxy object.
Return type:contentful.environment_entries_proxy.EnvironmentEntriesProxy

Usage:

>>> environment_entries_proxy = environment.entries()
<EnvironmentEntriesProxy space_id="cfexampleapi" environment_id="master">
locales()[source]

Provides access to locale management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/locales

Returns:EnvironmentLocalesProxy object.
Return type:contentful.environment_locales_proxy.EnvironmentLocalesProxy

Usage:

>>> environment_locales_proxy = environment.locales()
<EnvironmentLocalesProxy space_id="cfexampleapi" environment_id="master">
to_json()[source]

Returns the JSON representation of the environment.

ui_extensions()[source]

Provides access to UI extensions management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/ui-extensions

Returns:EnvironmentUIExtensionsProxy object.
Return type:contentful.ui_extensions_proxy.EnvironmentUIExtensionsProxy

Usage:

>>> ui_extensions_proxy = environment.ui_extensions()
<EnvironmentUIExtensionsProxy space_id="cfexampleapi" environment_id="master">

contentful_management.environment_assets_proxy module

class contentful_management.environment_assets_proxy.EnvironmentAssetsProxy(client, space_id, environment_id)[source]

Bases: contentful_management.environment_resource_proxy.EnvironmentResourceProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/entries

contentful_management.environment_content_types_proxy module

class contentful_management.environment_content_types_proxy.EnvironmentContentTypesProxy(client, space_id, environment_id)[source]

Bases: contentful_management.environment_resource_proxy.EnvironmentResourceProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/content-types

contentful_management.environment_entries_proxy module

class contentful_management.environment_entries_proxy.EnvironmentEntriesProxy(client, space_id, environment_id)[source]

Bases: contentful_management.environment_resource_proxy.EnvironmentResourceProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/entries

contentful_management.environment_locales_proxy module

class contentful_management.environment_locales_proxy.EnvironmentLocalesProxy(client, space_id, environment_id)[source]

Bases: contentful_management.environment_resource_proxy.EnvironmentResourceProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/entries

create(attributes=None, **kwargs)[source]

Creates a locale with given attributes.

contentful_management.environment_resource_proxy module

contentful_management.environment_resource_proxy

This module implements the EnvironmentResourceProxy class.

copyright:
  1. 2018 by Contentful GmbH.
license:

MIT, see LICENSE for more details.

class contentful_management.environment_resource_proxy.EnvironmentResourceProxy(client, space_id, environment_id)[source]

Bases: object

Base class for environment related resource proxies.

all(query=None)[source]

Gets all resources related to the current space.

create(resource_id=None, attributes=None)[source]

Creates a resource with a given ID (optional) and attributes for the current space.

delete(resource_id)[source]

Deletes a resource by ID.

find(resource_id, query=None)[source]

Finds a single resource by ID related to the current space.

contentful_management.environment_ui_extensions_proxy module

class contentful_management.environment_ui_extensions_proxy.EnvironmentUIExtensionsProxy(client, space_id, environment_id)[source]

Bases: contentful_management.environment_resource_proxy.EnvironmentResourceProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/entries

contentful_management.environments_proxy module

class contentful_management.environments_proxy.EnvironmentsProxy(client, space_id)[source]

Bases: contentful_management.client_proxy.ClientProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/

contentful_management.errors module

contentful_management.errors

This module implements the Error classes.

API reference: https://www.contentful.com/developers/docs/references/content-delivery-api/#/introduction/errors

copyright:
  1. 2018 by Contentful GmbH.
license:

MIT, see LICENSE for more details.

exception contentful_management.errors.AccessDeniedError(response)[source]

Bases: contentful_management.errors.HTTPError

403

exception contentful_management.errors.BadGatewayError(response)[source]

Bases: contentful_management.errors.HTTPError

502

exception contentful_management.errors.BadRequestError(response)[source]

Bases: contentful_management.errors.HTTPError

400

exception contentful_management.errors.HTTPError(response)[source]

Bases: Exception

Base HTTP error class.

exception contentful_management.errors.NotFoundError(response)[source]

Bases: contentful_management.errors.HTTPError

404

exception contentful_management.errors.RateLimitExceededError(response)[source]

Bases: contentful_management.errors.HTTPError

429

RATE_LIMIT_RESET_HEADER_KEY = 'x-contentful-ratelimit-reset'
reset_time()[source]

Returns the reset time in seconds until next available request.

exception contentful_management.errors.ServerError(response)[source]

Bases: contentful_management.errors.HTTPError

500

exception contentful_management.errors.ServiceUnavailableError(response)[source]

Bases: contentful_management.errors.HTTPError

503

exception contentful_management.errors.UnauthorizedError(response)[source]

Bases: contentful_management.errors.HTTPError

401

exception contentful_management.errors.UnprocessableEntityError(response)[source]

Bases: contentful_management.errors.HTTPError

422

exception contentful_management.errors.VersionMismatchError(response)[source]

Bases: contentful_management.errors.HTTPError

409

contentful_management.errors.get_error(response)[source]

Gets Error by HTTP status code.

contentful_management.locale module

class contentful_management.locale.Locale(item, **kwargs)[source]

Bases: contentful_management.resource.Resource, contentful_management.resource.EnvironmentAwareResource

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/locales

to_json()[source]

Returns the JSON representation of the locale.

classmethod update_attributes_map()[source]

Attributes for object mapping.

contentful_management.locales_proxy module

class contentful_management.locales_proxy.LocalesProxy(client, space_id, environment_id=None)[source]

Bases: contentful_management.client_proxy.ClientProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/locales

create(attributes=None, **kwargs)[source]

Creates a locale with given attributes.

contentful_management.organization module

class contentful_management.organization.Organization(item, **kwargs)[source]

Bases: contentful_management.resource.Resource

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/organizations

classmethod base_url(*args, **kwargs)[source]

Returns the URI for the organization.

periodic_usages()[source]

Provides access to organization periodic usages management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/usage

Returns:OrganizationPeriodicUsagesProxy object.
Return type:contentful.organization_periodic_usages_proxy.OrganizationPeriodicUsagesProxy

Usage:

>>> organization_periodic_usages_proxy = organization.usage_periods()
<OrganizationPeriodicUsagesProxy organization_id="cfexampleapi">
space_periodic_usages()[source]

Provides access to organization periodic usages grouped by space management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/usage

Returns:SpacePeriodicUsagesProxy object.
Return type:contentful.space_periodic_usages_proxy.SpacePeriodicUsagesProxy

Usage:

>>> space_periodic_usages_proxy = organization.space_usage_periods()
<SpacePeriodicUsagesProxyorganization_id="cfexampleapi">
users()[source]

Provides access to organization users management methods.

API reference: https://www.contentful.com/developers/docs/references/user-management-api/#/reference/users

Returns:OrganizationUsersProxy object.
Return type:contentful.organization_users_proxy.OrganizationUsersProxy

Usage:

>>> organization_users_proxy = organization.users()
<OrganizationUsersProxy organization_id="cfexampleapi">

contentful_management.organization_periodic_usage module

class contentful_management.organization_periodic_usage.OrganizationPeriodicUsage(item, **kwargs)[source]

Bases: contentful_management.resource.Resource

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/usage

classmethod base_url(organization_id)[source]

contentful_management.organization_periodic_usages_proxy module

class contentful_management.organization_periodic_usages_proxy.OrganizationPeriodicUsagesProxy(client, organization_id)[source]

Bases: contentful_management.client_proxy.ClientProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/usage

all(query=None, *args, **kwargs)[source]

Gets all organization periodic usage.

create(file_or_path, **kwargs)[source]

Not supported.

delete(upload_id)[source]

Not supported.

find(*args, **kwargs)[source]

Not supported.

contentful_management.organization_users_proxy module

class contentful_management.organization_users_proxy.OrganizationUsersProxy(client, organization_id)[source]

Bases: contentful_management.client_proxy.ClientProxy

API reference: https://www.contentful.com/developers/docs/references/user-management-api/#/reference/users

contentful_management.organizations_proxy module

class contentful_management.organizations_proxy.OrganizationsProxy(client)[source]

Bases: contentful_management.client_proxy.ClientProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/organizations

all(query=None, **kwargs)[source]

Gets all organizations.

create(attributes=None, **kwargs)[source]

Not supported.

delete(organization_id)[source]

Not supported.

find(organization_id, query=None, **kwargs)[source]

Not supported.

contentful_management.personal_access_token module

class contentful_management.personal_access_token.PersonalAccessToken(item, **kwargs)[source]

Bases: contentful_management.resource.Resource

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/personal-access-tokens

classmethod base_url(resource_id=None, **kwargs)[source]

Returns the URI for the personal access token.

is_revoked

contentful_management.personal_access_tokens_proxy module

class contentful_management.personal_access_tokens_proxy.PersonalAccessTokensProxy(client)[source]

Bases: contentful_management.client_proxy.ClientProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/personal-access-tokens

create(attributes)[source]
delete(token_id, *args, **kwargs)[source]

Revokes a personal access token.

revoke(token_id, *args, **kwargs)[source]

Revokes a personal access token.

contentful_management.preview_api_key module

class contentful_management.preview_api_key.PreviewApiKey(item, **kwargs)[source]

Bases: contentful_management.resource.Resource

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/api-keys/preview-api-key/get-a-single-preview-api-key

contentful_management.preview_api_keys_proxy module

class contentful_management.preview_api_keys_proxy.PreviewApiKeysProxy(client, space_id, environment_id=None)[source]

Bases: contentful_management.client_proxy.ClientProxy

create(*args, **kwargs)[source]

Not supported.

delete(*args, **kwargs)[source]

Not supported.

contentful_management.resource module

class contentful_management.resource.ArchiveResource[source]

Bases: object

Allows for resource archive/unarchive.

archive()[source]

Archives the resource.

is_archived

Checks if Resource is archived.

unarchive()[source]

Unarchives the resource.

class contentful_management.resource.EnvironmentAwareResource[source]

Bases: object

Allows environment aware resources to resolve the environment ID.

class contentful_management.resource.FieldsResource(item, **kwargs)[source]

Bases: contentful_management.resource.Resource

Fields resource class.

Implements locale handling for resource fields.

classmethod create_attributes(attributes, previous_object=None)[source]

Attributes for resource creation.

fields(locale=None)[source]

Get fields for a specific locale.

Parameters:locale – (optional) Locale to fetch, defaults to default_locale.
fields_with_locales()[source]

Get fields with locales per field.

locale

Returns the resource locale.

to_json()[source]

Returns the JSON Representation of the resource.

Bases: contentful_management.resource.Resource

Link Class

API reference: https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/links

resolve(space_id=None, environment_id=None)[source]

Resolves link to a specific resource.

to_json()[source]

Returns the JSON representation of the link.

class contentful_management.resource.PublishResource[source]

Bases: object

Allows for resource publish/unpublish.

is_published

Checks if resource is published.

is_updated

Checks if a resource has been updated since last publish. Returns False if resource has not been published before.

publish()[source]

Publishes the resource.

unpublish()[source]

Unpublishes the resource.

class contentful_management.resource.Resource(item, default_locale='en-US', client=None)[source]

Bases: object

Base resource class.

Implements common resource attributes.

API reference: https://www.contentful.com/developers/docs/references/content-delivery-api/#/introduction/common-resource-attributes

classmethod base_url(space_id='', resource_id=None, environment_id=None, **kwargs)[source]

Returns the URI for the resource.

classmethod create_attributes(attributes, previous_object=None)[source]

Attributes for resource creation.

classmethod create_headers(attributes)[source]

Headers for resource creation.

delete()[source]

Deletes the resource.

reload(result=None)[source]

Reloads the resource.

save()[source]

Saves the current state of the resource.

to_json()[source]

Returns the JSON representation of the resource.

Returns a link for the resource.

update(attributes=None)[source]

Updates the resource with attributes.

classmethod update_attributes_map()[source]

Defines keys and default values for non-generic attributes.

contentful_management.resource_builder module

class contentful_management.resource_builder.ResourceBuilder(client, default_locale, json)[source]

Bases: object

Creates objects of the proper resource type.

build()[source]

Creates the objects from the JSON response.

contentful_management.role module

class contentful_management.role.Role(item, **kwargs)[source]

Bases: contentful_management.resource.Resource

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/roles

to_json()[source]

Returns the JSON representation of the role.

classmethod update_attributes_map()[source]

Defines keys and default values for non-generic attributes.

contentful_management.roles_proxy module

class contentful_management.roles_proxy.RolesProxy(client, space_id, environment_id=None)[source]

Bases: contentful_management.client_proxy.ClientProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/roles

create(attributes=None, **kwargs)[source]

Creates a role with given attributes.

contentful_management.snapshot module

class contentful_management.snapshot.Snapshot(item, **kwargs)[source]

Bases: contentful_management.resource.Resource, contentful_management.resource.EnvironmentAwareResource

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/snapshots

classmethod base_url(space_id, parent_resource_id, resource_url='entries', resource_id=None, environment_id=None)[source]

Returns the URI for the snapshot.

save()[source]

Not supported.

to_json()[source]

Returns the JSON representation of the snapshot.

update(_attributes=None)[source]

Not supported.

contentful_management.snapshots_proxy module

class contentful_management.snapshots_proxy.SnapshotsProxy(client, space_id, environment_id, parent_resource_id, resource_kind='entries')[source]

Bases: contentful_management.client_proxy.ClientProxy

create(*args, **kwargs)[source]

Not supported.

delete(*args, **kwargs)[source]

Not supported.

contentful_management.space module

class contentful_management.space.Space(item, **kwargs)[source]

Bases: contentful_management.resource.Resource

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/spaces

api_keys()[source]

Provides access to api key management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/api-keys

Returns:SpaceApiKeysProxy object.
Return type:contentful.space_api_keys_proxy.SpaceApiKeysProxy

Usage:

>>> space_api_keys_proxy = space.api_keys()
<SpaceApiKeysProxy space_id="cfexampleapi">
classmethod base_url(space_id=None, **kwargs)[source]

Returns the URI for the space.

classmethod create_attributes(attributes, previous_object=None)[source]

Attributes for space creation.

classmethod create_headers(attributes)[source]

Headers for space creation.

delete()[source]

Deletes the space

environments()[source]

Provides access to environment management methods.

API reference: TBD

Returns:SpaceEnvironmentsProxy <contentful_management.space_environments_proxy object.
Return type:contentful.environments_space_proxy.SpaceEnvironmentsProxy

Usage:

>>> space_environments_proxy = space.environments()
<SpaceEnvironmentsProxy space_id="cfexampleapi">
memberships()[source]

Provides access to space memberships management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/space-memberships

Returns:SpaceSpaceMembershipsProxy object.
Return type:contentful.space_space_memberships_proxy.SpaceSpaceMembershipsProxy

Usage:

>>> space_space_memberships_proxy = space.memberships()
<SpaceSpaceMembershipsProxy space_id="cfexampleapi">
preview_api_keys()[source]

Provides access to preview api key management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/api-keys/preview-api-key/get-a-single-preview-api-key

Returns:SpacePreviewApiKeysProxy object.
Return type:contentful.space_preview_api_keys_proxy.SpacePreviewApiKeysProxy

Usage:

>>> space_preview_api_keys_proxy = space.preview_api_keys()
<SpacePreviewApiKeysProxy space_id="cfexampleapi">
reload()[source]

Reloads the space.

roles()[source]

Provides access to role management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/roles

Returns:SpaceRolesProxy object.
Return type:contentful.space_roles_proxy.SpaceRolesProxy

Usage:

>>> space_roles_proxy = space.roles()
<SpaceRolesProxy space_id="cfexampleapi">
to_json()[source]

Returns the JSON representation of the space.

update(attributes=None)[source]

Updates the space with attributes.

classmethod update_attributes_map()[source]

Defines keys and default values for non-generic attributes.

uploads()[source]

Provides access to upload management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/uploads

Returns:SpaceApiKeysProxy object.
Return type:contentful.space_api_keys_proxy.SpaceApiKeysProxy

Usage:

>>> space_uploads_proxy = space.uploads()
<UploadsProxy space_id="cfexampleapi">
users()[source]

Provides access to space users management methods.

API reference: https://www.contentful.com/developers/docs/references/user-management-api/#/reference/users

Returns:SpaceUsersProxy object.
Return type:contentful.space_users_proxy.SpaceUsersProxy

Usage:

>>> space_users_proxy = space.users()
<SpaceUsersProxy space_id="cfexampleapi">
webhooks()[source]

Provides access to webhook management methods.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/webhooks

Returns:SpaceWebhooksProxy object.
Return type:contentful.space_webhooks_proxy.SpaceWebhooksProxy

Usage:

>>> space_webhooks_proxy = space.webhooks()
<SpaceWebhooksProxy space_id="cfexampleapi">

contentful_management.space_api_keys_proxy module

class contentful_management.space_api_keys_proxy.SpaceApiKeysProxy(client, space_id)[source]

Bases: contentful_management.space_resource_proxy.SpaceResourceProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/api-keys

create(attributes=None, **kwargs)[source]

Creates an api key with given attributes.

contentful_management.space_environments_proxy module

class contentful_management.space_environments_proxy.SpaceEnvironmentsProxy(client, space_id)[source]

Bases: contentful_management.space_resource_proxy.SpaceResourceProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/

contentful_management.space_membership module

class contentful_management.space_membership.SpaceMembership(item, **kwargs)[source]

Bases: contentful_management.resource.Resource

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/space-memberships

to_json()[source]

Returns the JSON representation of the space membership.

contentful_management.space_memberships_proxy module

class contentful_management.space_memberships_proxy.SpaceMembershipsProxy(client, space_id, environment_id=None)[source]

Bases: contentful_management.client_proxy.ClientProxy

create(attributes=None, **kwargs)[source]

Creates a space membership with given attributes.

contentful_management.space_periodic_usage module

class contentful_management.space_periodic_usage.SpacePeriodicUsage(item, **kwargs)[source]

Bases: contentful_management.resource.Resource

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/usage

classmethod base_url(organization_id)[source]

contentful_management.space_periodic_usages_proxy module

class contentful_management.space_periodic_usages_proxy.SpacePeriodicUsagesProxy(client, organization_id)[source]

Bases: contentful_management.client_proxy.ClientProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/usage

all(query=None, *args, **kwargs)[source]

Gets all organization periodic usage grouped by space.

create(file_or_path, **kwargs)[source]

Not supported.

delete(upload_id)[source]

Not supported.

find(*args, **kwargs)[source]

Not supported.

contentful_management.space_preview_api_keys_proxy module

class contentful_management.space_preview_api_keys_proxy.SpacePreviewApiKeysProxy(client, space_id)[source]

Bases: contentful_management.space_resource_proxy.SpaceResourceProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/api-keys/preview-api-key/get-a-single-preview-api-key

create(*args, **kwargs)[source]

Not supported.

delete(*args, **kwargs)[source]

Not supported.

contentful_management.space_resource_proxy module

contentful_management.space_api_keys_proxy

This module implements the SpaceResourceProxy class.

copyright:
  1. 2018 by Contentful GmbH.
license:

MIT, see LICENSE for more details.

class contentful_management.space_resource_proxy.SpaceResourceProxy(client, space_id)[source]

Bases: object

Base class for space related resource proxies.

all(query=None)[source]

Gets all resources related to the current space.

create(resource_id=None, attributes=None)[source]

Creates a resource with a given ID (optional) and attributes for the current space.

delete(resource_id)[source]

Deletes a resource by ID.

find(resource_id, query=None)[source]

Finds a single resource by ID related to the current space.

contentful_management.space_roles_proxy module

class contentful_management.space_roles_proxy.SpaceRolesProxy(client, space_id)[source]

Bases: contentful_management.space_resource_proxy.SpaceResourceProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/roles

create(attributes=None, **kwargs)[source]

Creates a role with given attributes.

contentful_management.space_space_memberships_proxy module

class contentful_management.space_space_memberships_proxy.SpaceSpaceMembershipsProxy(client, space_id)[source]

Bases: contentful_management.space_resource_proxy.SpaceResourceProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/space-memberships

create(attributes=None, **kwargs)[source]

Creates a space membership with given attributes.

contentful_management.space_users_proxy module

class contentful_management.space_users_proxy.SpaceUsersProxy(client, space_id)[source]

Bases: contentful_management.space_resource_proxy.SpaceResourceProxy

API reference: https://www.contentful.com/developers/docs/references/user-management-api/#/reference/users

contentful_management.space_webhooks_proxy module

class contentful_management.space_webhooks_proxy.SpaceWebhooksProxy(client, space_id)[source]

Bases: contentful_management.space_resource_proxy.SpaceResourceProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/webhooks

create(attributes=None, **kwargs)[source]

Creates a webhook with given attributes.

contentful_management.spaces_proxy module

class contentful_management.spaces_proxy.SpacesProxy(client)[source]

Bases: contentful_management.client_proxy.ClientProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/spaces

all(query=None, **kwargs)[source]

Gets all spaces.

create(attributes=None, **kwargs)[source]

Creates a space with given attributes.

delete(space_id)[source]

Deletes a space by ID.

find(space_id, query=None, **kwargs)[source]

Gets a space by ID.

contentful_management.ui_extension module

class contentful_management.ui_extension.UIExtension(item, **kwargs)[source]

Bases: contentful_management.resource.Resource, contentful_management.resource.EnvironmentAwareResource

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/ui-extensions

field_types
name
parameters
sidebar
source
to_json()[source]

Returns the JSON Representation of the UI extension.

classmethod update_attributes_map()[source]

Defines keys and default values for non-generic attributes.

contentful_management.ui_extensions_proxy module

class contentful_management.ui_extensions_proxy.UIExtensionsProxy(client, space_id, environment_id=None)[source]

Bases: contentful_management.client_proxy.ClientProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/ui-extensions

contentful_management.upload module

class contentful_management.upload.Upload(item, **kwargs)[source]

Bases: contentful_management.resource.Resource

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/uploads

classmethod create_headers(_attributes)[source]

Headers for upload creation.

contentful_management.uploads_proxy module

class contentful_management.uploads_proxy.UploadsProxy(client, space_id, environment_id=None)[source]

Bases: contentful_management.client_proxy.ClientProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/uploads

all(*args, **kwargs)[source]

Not supported.

create(file_or_path, **kwargs)[source]

Creates an upload for the given file or path.

delete(upload_id)[source]

Deletes an upload by ID.

find(upload_id, **kwargs)[source]

Finds an upload by ID.

contentful_management.user module

class contentful_management.user.User(item, **kwargs)[source]

Bases: contentful_management.resource.Resource

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/users

classmethod base_url(space_id=None, resource_id=None, organization_id=None, **kwargs)[source]

Returns the URI for the user.

contentful_management.users_proxy module

class contentful_management.users_proxy.UsersProxy(client, space_id=None)[source]

Bases: contentful_management.client_proxy.ClientProxy

all(*args, **kwargs)[source]

Not supported.

create(*args, **kwargs)[source]

Not supported.

delete(*args, **kwargs)[source]

Not supported.

me()[source]

Returns the current user information.

contentful_management.utils module

exception contentful_management.utils.ConfigurationException[source]

Bases: Exception

Configuration error class.

contentful_management.utils.base_path_for(resource_name)[source]

Returns the path for a specified resource name.

contentful_management.utils.camel_case(snake_str)[source]

Returns a camel-cased version of a string.

Parameters:a_string – any str object.
Usage:
>>> camel_case('foo_bar')
"fooBar"

Checks if value is link or not.

Parameters:value – any object.
Returns:Boolean
Return type:bool
Usage:
>>> is_link('foo')
False
>>> is_link({'sys': {'type': 'Link', 'id': 'foobar'}})
True

Checks if value is an array of links.

Parameters:value – any object.
Returns:Boolean
Return type:bool
Usage:
>>> is_link_array('foo')
False
>>> is_link_array([1, 2, 3])
False
>>> is_link([{'sys': {'type': 'Link', 'id': 'foobar'}}])
True
contentful_management.utils.json_error_class()[source]

Returns the class for JSON decode errors depends on the Python version.

contentful_management.utils.normalize_select(query)[source]

If the query contains the :select operator, we enforce :sys properties. The SDK requires sys.type to function properly, but as other of our SDKs require more parts of the :sys properties, we decided that every SDK should include the complete :sys block to provide consistency accross our SDKs.

class contentful_management.utils.retry_request(client)[source]

Bases: object

Decorator to retry function calls in case they raise rate limit exceptions.

RATE_LIMIT_RESET_HEADER_KEY = 'x-contentful-ratelimit-reset'
contentful_management.utils.sanitize_date(date)[source]

In order to have a more accurate comparison due to minimal delays upon publishing entries. We strip milliseconds from the dates we compare. :param date: datetime.datetime :return: datetime.datetime without milliseconds.

contentful_management.utils.snake_case(a_string)[source]

Returns a snake-cased version of a string.

Parameters:a_string – any str object.
Usage:
>>> snake_case('FooBar')
"foo_bar"
contentful_management.utils.str_type()[source]

Returns the correct string type for the current Python version.

contentful_management.utils.string_class()[source]

Returns the parent class for strings depends on the Python version.

contentful_management.utils.unicode_class()[source]

Returns the class that allows for unicode encoded strings depends on the Python version.

contentful_management.webhook module

class contentful_management.webhook.Webhook(item, **kwargs)[source]

Bases: contentful_management.resource.Resource

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/webhooks

calls()[source]

Provides access to call overview for the given webhook.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/webhook-calls

Returns:WebhookWebhooksCallProxy object.
Return type:contentful.webhook_webhooks_call_proxy.WebhookWebhooksCallProxy

Usage:

>>> webhook_webhooks_call_proxy = webhook.calls()
<WebhookWebhooksCallProxy space_id="cfexampleapi" webhook_id="my_webhook">
classmethod create_attributes(attributes, previous_object=None)[source]

Attributes for webhook creation.

health()[source]

Provides access to health overview for the given webhook.

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/webhook-calls/webhook-health

Returns:WebhookWebhooksHealthProxy object.
Return type:contentful.webhook_webhooks_health_proxy.WebhookWebhooksHealthProxy

Usage:

>>> webhook_webhooks_health_proxy = webhook.health()
<WebhookWebhooksHealthProxy space_id="cfexampleapi" webhook_id="my_webhook">
to_json()[source]

Returns the JSON representation of the webhook.

classmethod update_attributes_map()[source]

Defines keys and default values for non-generic attributes.

contentful_management.webhook_call module

class contentful_management.webhook_call.WebhookCall(item, **kwargs)[source]

Bases: contentful_management.resource.Resource

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/webhook-calls/webhook-call-overview

classmethod base_url(space_id, webhook_id, resource_id=None)[source]

Returns the URI for the webhook call.

contentful_management.webhook_health module

class contentful_management.webhook_health.WebhookHealth(item, **kwargs)[source]

Bases: contentful_management.resource.Resource

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/webhook-calls/webhook-health

classmethod base_url(space_id, webhook_id, **kwargs)[source]

Returns the URI for the webhook health.

webhook_id

contentful_management.webhook_resource_proxy module

contentful_management.webhook_resource_proxy

This module implements the WebhookResourceProxy class.

copyright:
  1. 2018 by Contentful GmbH.
license:

MIT, see LICENSE for more details.

class contentful_management.webhook_resource_proxy.WebhookResourceProxy(client, space_id, webhook_id)[source]

Bases: object

Base Class for Webhook related Resource Proxies

all(query=None)[source]

Gets all resources related to the current webhook.

create(resource_id=None, attributes=None)[source]

Not supported.

delete(resource_id)[source]

Not supported.

find(resource_id, query=None)[source]

Finds a single resource by ID related to the current webhook.

contentful_management.webhook_webhooks_call_proxy module

class contentful_management.webhook_webhooks_call_proxy.WebhookWebhooksCallProxy(client, space_id, webhook_id)[source]

Bases: contentful_management.webhook_resource_proxy.WebhookResourceProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/webhook-calls

contentful_management.webhook_webhooks_health_proxy module

class contentful_management.webhook_webhooks_health_proxy.WebhookWebhooksHealthProxy(client, space_id, webhook_id)[source]

Bases: contentful_management.webhook_resource_proxy.WebhookResourceProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/webhook-calls/webhook-health

find(*args, **kwargs)[source]

Gets webhook health.

contentful_management.webhooks_call_proxy module

class contentful_management.webhooks_call_proxy.WebhooksCallProxy(client, space_id, webhook_id)[source]

Bases: contentful_management.client_proxy.ClientProxy

create(*args, **kwargs)[source]

Not supported.

delete(*args, **kwargs)[source]

Not supported.

contentful_management.webhooks_health_proxy module

class contentful_management.webhooks_health_proxy.WebhooksHealthProxy(client, space_id, webhook_id)[source]

Bases: contentful_management.client_proxy.ClientProxy

create(*args, **kwargs)[source]

Not supported.

delete(*args, **kwargs)[source]

Not supported.

find(*args, **kwargs)[source]

Gets the webhook health.

contentful_management.webhooks_proxy module

class contentful_management.webhooks_proxy.WebhooksProxy(client, space_id, environment_id=None)[source]

Bases: contentful_management.client_proxy.ClientProxy

API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/webhooks

create(attributes=None, **kwargs)[source]

Creates a webhook with given attributes.

Module contents