Skip to main content

A simple wrapper for the Brandfolder API

Project description

The Official Python Brandfolder SDK

Brandfolder

What is Brandfolder?

Brandfolder is a visually-elegant and user-friendly Digital Asset Management software that allows marketers and creatives across industries to maximize their brand management potential. Brandfolder is more than just storage for your digital assets; with our solution's cloud-first architecture, users can organize, manipulate, distribute, and analyze their most important digital collateral from a single source of truth. With advanced AI-powered smart search, asset editing and manipulation, annotated workflow with approvals and notifications, and actionable brand insights, Brandfolder's feature suite amplifies cross-team collaboration and productivity, and empowers external users to access the content they need with unprecedented ease.

Installation

Install latest official build:

pip install brandfolder

Install from source:

git clone git@github.com:brandfolder/sdk-python.git
cd sdk-python
python setup.py install

Usage

Interaction with the Brandfolder API via the Python SDK is client based. The first thing you need to do is create a client:

client = Client(api_key=API_KEY)

A valid Brandfolder API key is required for all actions. Find yours at https://brandfolder.com/profile#integrations.

Methods for interacting with resource containers from Brandfolder:

container.fetch(): Returns a list from the first page of available objects of the provided type. (e.g. client.brandfolders.fetch())

container.fetch_by_id(<resource_id>): Returns the object associated with the provided type and id. (e.g. client.brandfolders.fetch_by_id(<bf_id>))

Methods for interacting with resource objects from Brandfolder:


:exclamation: Deprecation Warning
Listing assets and attachments by organization (org.assets.fetch(...) and org.attachments.fetch(...)) was deprecated in v2.0.0. The Brandfolder API will drop support for these operations soon, which will be a breaking change for all versions of this SDK.

Clients wishing to fetch these resources for an entire organization should instead list all Brandfolders for that organization, and then iteratively fetch assets or attachments from each section within a Brandfolder.

See the API documention for listing assets and listing attachments for more information.

obj.get(<attribute>): Returns the provided attribute value of the associated object. (e.g. asset.get('name'))

obj.refresh(): Updates local object attributes with what currently exists in Brandfolder.

obj.set(<updates>): Prepares to apply provided updates to the associated object. (e.g. asset.set(name='New Name'))

obj.update(): Pushes updates to the associated object to Brandfolder.

obj.delete(): Deletes the associated object in Brandfolder.

brandfolder_obj.create_section(): Creates section in the associated Brandfolder.

brandfolder_obj.create_collection(): Creates collection in the associated Brandfolder.

brandfolder_obj.create_asset(attachments_data, section_key, **attributes): Creates asset in the associated Brandfolder. This is also available for a Collection.

brandfolder_obj.search(query): Returns assets in the associated Brandfolder that match the query parameters provided.

Fields on resource objects:

obj.id: The id of the associated object.

obj.attributes: The attributes of the provided object.

obj.relationships: Information about the resources related to the provided object, if explicitly included in the API call.

obj.included: The included resources that are related to the provided object, if explicitly included in the API call.

obj.updates: A dict of staged updates to the associated object that are ready to apply.

Examples:

See the complete API documentation at https://developer.brandfolder.com/docs for more examples.

Get all available organizations:

orgs = client.organizations.fetch()

Get a specific Brandfolder:

bf = client.brandfolders.fetch_by_id(<brandfolder_id>)

Updating an asset:

asset = bf.assets.fetch_by_id(<asset_id>)  # Grab an asset
asset.set(name='New Name')
asset.update()  # Pushes new attributes to Brandfolder

Search for assets within a Brandfolder:

# Will return results with a name containing "Sample" of filetype ".png"

bf = client.brandfolders.fetch_by_id(<brandfolder_id>)
search_parameters = ['name:sample', 'extension:png']
results = bf.assets.search(search_parameters)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

brandfolder-2.0.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

brandfolder-2.0.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file brandfolder-2.0.0.tar.gz.

File metadata

  • Download URL: brandfolder-2.0.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.10.0 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.20 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.15

File hashes

Hashes for brandfolder-2.0.0.tar.gz
Algorithm Hash digest
SHA256 a38f24b194fabab460d3bf0abf411f9c99ef64b89b55076bed36b9395c97cd60
MD5 77902f5a5ad9fbe069bf41678d5f60b1
BLAKE2b-256 5bb3064964bedbf22b29e61be28d858a77c61f827e51a353c0705017a2b5129c

See more details on using hashes here.

File details

Details for the file brandfolder-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: brandfolder-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.10.0 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.20 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.15

File hashes

Hashes for brandfolder-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6406c377b85fcd8f220aa3f433377092f84449fc124a584d9b314d89bc83109d
MD5 5e1c0fa57ae331f9f8f193da17944de1
BLAKE2b-256 45791e533a51e6bbe4c7db86c6ab7a209ed86468eb7388e9e3929b2ad8e44912

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page