Name | bynder-sdk JSON |
Version |
2.0.0
JSON |
| download |
home_page | https://bynder.com |
Summary | Bynder SDK can be used to speed up the integration of Bynder in Python |
upload_time | 2024-03-28 13:29:32 |
maintainer | None |
docs_url | None |
author | Bynder |
requires_python | None |
license | MIT |
keywords |
bynder
dam
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
Bynder Python SDK
=================


[](https://coveralls.io/github/Bynder/bynder-python-sdk?branch=master)


The main goal of this SDK is to speed up the integration of Bynder
customers who use Python. Making it easier to connect to the Bynder API
(<https://bynder.docs.apiary.io>) and execute requests on it.
_**Note:** As of version 1.0.0 this SDK now uses OAuth 2.0. For the last
version using OAuth 1.0a please refer to
[version 0.0.6](https://github.com/Bynder/bynder-python-sdk/tree/0.0.6)_.
Requirements and dependencies
-----------------------------
The Python SDK requires the following in order to fully work:
- `Python >= 3.5`, older versions of Python won't work.
Pip should handle all the dependencies automatically.
Installation
------------
This SDK depends on a few libraries in order to work, installing it with
pip should take care of everything automatically.
Before you install the SDK we recommend you to setup a virtual
environment:
```bash
virtualenv -p python3 venv # create virtual environment
source venv/bin/activate # activate virtual environment
```
After you have successfully setup a virtual environment you can install
the SDK with [pip](https://pip.pypa.io/en/stable/installing/). Run the
following command while your virtual environment is active.
```bash
pip install bynder-sdk
```
Getting started
---------------
This is a simple example on how to retrieve data from the Bynder asset
bank. For a more detailed example of implementation refer to the [sample
code](https://github.com/Bynder/bynder-python-sdk/blob/master/example/app.py).
First import the BynderClient:
```python
from bynder_sdk import BynderClient
```
When using OAuth2, create an instance of the client and use the flow
to receive a token:
```python
bynder_client = BynderClient(
domain='portal.getbynder.com',
redirect_uri='https://...',
client_id='',
client_secret='',
token_saver=token_saver
)
print(bynder_client.get_authorization_url())
code = input('Code: ')
bynder_client.fetch_token(code)
```
When using a permanent token, the client instance can be created like this:
```python
bynder_client = BynderClient(
domain='portal.getbynder.com',
permanent_token=''
)
```
Finally call one of the API's endpoints through one of the clients:
```python
asset_bank_client = bynder_client.asset_bank_client
media_list = asset_bank_client.media_list({
'limit': 2,
'type': 'image'
})
```
A full list of the currently available clients and methods in the SDK
can be found below
Methods Available
-----------------
These are the methods currently availble on the **Bynder Python SDK**,
refer to the [Bynder API Docs](http://docs.bynder.apiary.io/) for more
specific details on the calls.
### BynderClient:
Get an instance of the Asset Bank Client or the Collection Client if
already with access tokens set up. Also allows to generate and
authenticate request tokens, which are necessary for the rest of the
Asset Bank and Collection calls.
```python
asset_bank_client
collection_client
pim_client
workflow_client
get_authorization_url()
fetch_token()
derivatives()
```
### asset\_bank\_client:
All the Asset Bank related calls, provides information and access to
Media management.
```python
brands()
tags()
meta_properties()
media_list(query)
media_info(media_id, query)
media_download_url()
set_media_properties(media_id, query)
delete_media(media_id)
create_usage(itegration_id, asset_id, query)
usage(query)
delete_usage(integration_id, asset_id, query)
upload_file(file_path, brand_id, media_id, query)
```
With the `upload_file` method you can do two things. You can upload a
new asset, or you can upload a new version of an exising asset. You can
control this by sending a media\_id or not.
### collection\_client:
All the collection related calls.
```python
collections(query)
collection_info(collection_id)
create_collection(name, query)
delete_collection(collection_id)
collection_media_ids(collection_id)
add_media_to_collection(collection_id, media_ids)
remove_media_from_collection(collection_id, meedia_ids)
share_collection(collection_id, collection_option, recipients, query)
```
### pim\_client:
All the PIM related calls.
```python
metaproperties()
metaproperty_info(metaproperty_id)
metaproperty_options(metaproperty_id)
edit_metaproperty_option(metaproperty_option_id, children)
```
### workflow\_client:
All the workflow related calls.
```python
users()
campaigns(query)
campaign_info(campaign_id)
create_campaign(name, key, description, responsibleID, query)
delete_campaign(campaign_id)
edit_campaign(campaign_id, name, key, description, responsibleID, query)
metaproperties()
metaproperty_info(metaproperty_id)
groups()
group_info(group_id)
job_preset_info(job_preset_info)
jobs(campaign_id)
create_job(name, campaignID, accountableID, presetID, query)
job_info(job_id)
edit_job(job_id, name, campaignID, accauntableID, presetID, query)
delete_job(job_id)}
```
Tests
-----
You can run the tests by using the command below. This will install the
packages required and execute the tests for all the clients.
```bash
make test
```
Docker Setup Guide
-----------------
The Docker setup allows you to run your Python scripts inside a Docker container, with dependencies installed and files synchronized. This guide aims to facilitate the development and testing of the SDK.
### Requirements and dependencies
Ensure the following are installed on your machine:
- [Docker](https://www.docker.com/get-started/)
- [docker-compose](https://docs.docker.com/compose/)
### Initial Setup
Create a `secret.json` file by following the example provided in the project. Fill in the necessary settings based on your requirements. If you have a permanent token, only the domain and permanent_token fields need to be specified:
```
{
"domain": "example.bynder.com", # Without the http:// or https://
"permanent_token": "7d09..........."
}
```
With `docker` and `docker-compose` installed, and your `secret.json` file ready, run the following command to initiate the container:
```bash
make run-docker
```
This command initializes a container with the bynder-python-sdk installed and ready for use.
### Executing SDK Samples
You can utilize the `Makefile` commands on your console to run SDK sample scripts. The syntax is as follows:
```bash
make executeSdkSample sample-file-name=file.py
```
All sample files are located in the `./samples` directory.
> :warning: Caution: The sample scripts are provided as examples. It is crucial to review, add and/or modify the commands before execution. The container updates automatically with changes, ensuring a seamless development experience. Always exercise caution when executing scripts.
## Stopping the Docker Container
When you're done with your development or testing, you can stop the Docker container using the following command:
```bash
make stop-docker
```
Raw data
{
"_id": null,
"home_page": "https://bynder.com",
"name": "bynder-sdk",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "bynder, dam",
"author": "Bynder",
"author_email": "techteam@bynder.com",
"download_url": "https://files.pythonhosted.org/packages/5e/39/872b9b15484dae653997461f3ef723936c9571dd9453cdf41c3095d3808f/bynder-sdk-2.0.0.tar.gz",
"platform": null,
"description": "Bynder Python SDK\n=================\n\n\n\n[](https://coveralls.io/github/Bynder/bynder-python-sdk?branch=master)\n\n\n\nThe main goal of this SDK is to speed up the integration of Bynder\ncustomers who use Python. Making it easier to connect to the Bynder API\n(<https://bynder.docs.apiary.io>) and execute requests on it.\n\n_**Note:** As of version 1.0.0 this SDK now uses OAuth 2.0. For the last\nversion using OAuth 1.0a please refer to\n[version 0.0.6](https://github.com/Bynder/bynder-python-sdk/tree/0.0.6)_.\n\nRequirements and dependencies\n-----------------------------\n\nThe Python SDK requires the following in order to fully work:\n\n- `Python >= 3.5`, older versions of Python won't work.\n\nPip should handle all the dependencies automatically.\n\nInstallation\n------------\n\nThis SDK depends on a few libraries in order to work, installing it with\npip should take care of everything automatically.\n\nBefore you install the SDK we recommend you to setup a virtual\nenvironment:\n\n```bash\nvirtualenv -p python3 venv # create virtual environment\nsource venv/bin/activate # activate virtual environment\n```\n\nAfter you have successfully setup a virtual environment you can install\nthe SDK with [pip](https://pip.pypa.io/en/stable/installing/). Run the\nfollowing command while your virtual environment is active.\n\n```bash\npip install bynder-sdk\n```\n\nGetting started\n---------------\n\nThis is a simple example on how to retrieve data from the Bynder asset\nbank. For a more detailed example of implementation refer to the [sample\ncode](https://github.com/Bynder/bynder-python-sdk/blob/master/example/app.py).\n\nFirst import the BynderClient:\n\n```python\nfrom bynder_sdk import BynderClient\n```\n\nWhen using OAuth2, create an instance of the client and use the flow\nto receive a token:\n\n```python\nbynder_client = BynderClient(\n domain='portal.getbynder.com',\n redirect_uri='https://...',\n client_id='',\n client_secret='',\n token_saver=token_saver\n)\n\nprint(bynder_client.get_authorization_url())\ncode = input('Code: ')\nbynder_client.fetch_token(code)\n```\n\nWhen using a permanent token, the client instance can be created like this:\n\n```python\nbynder_client = BynderClient(\n domain='portal.getbynder.com',\n permanent_token=''\n)\n```\n\nFinally call one of the API's endpoints through one of the clients:\n\n```python\nasset_bank_client = bynder_client.asset_bank_client\nmedia_list = asset_bank_client.media_list({\n 'limit': 2,\n 'type': 'image'\n})\n```\n\nA full list of the currently available clients and methods in the SDK\ncan be found below\n\nMethods Available\n-----------------\n\nThese are the methods currently availble on the **Bynder Python SDK**,\nrefer to the [Bynder API Docs](http://docs.bynder.apiary.io/) for more\nspecific details on the calls.\n\n### BynderClient:\n\nGet an instance of the Asset Bank Client or the Collection Client if\nalready with access tokens set up. Also allows to generate and\nauthenticate request tokens, which are necessary for the rest of the\nAsset Bank and Collection calls.\n\n```python\nasset_bank_client\ncollection_client\npim_client\nworkflow_client\nget_authorization_url()\nfetch_token()\nderivatives()\n```\n\n### asset\\_bank\\_client:\n\nAll the Asset Bank related calls, provides information and access to\nMedia management.\n\n```python\nbrands()\ntags()\nmeta_properties()\nmedia_list(query)\nmedia_info(media_id, query)\nmedia_download_url()\nset_media_properties(media_id, query)\ndelete_media(media_id)\ncreate_usage(itegration_id, asset_id, query)\nusage(query)\ndelete_usage(integration_id, asset_id, query)\nupload_file(file_path, brand_id, media_id, query)\n```\n\nWith the `upload_file` method you can do two things. You can upload a\nnew asset, or you can upload a new version of an exising asset. You can\ncontrol this by sending a media\\_id or not.\n\n### collection\\_client:\n\nAll the collection related calls.\n\n```python\ncollections(query)\ncollection_info(collection_id)\ncreate_collection(name, query)\ndelete_collection(collection_id)\ncollection_media_ids(collection_id)\nadd_media_to_collection(collection_id, media_ids)\nremove_media_from_collection(collection_id, meedia_ids)\nshare_collection(collection_id, collection_option, recipients, query)\n```\n\n### pim\\_client:\n\nAll the PIM related calls.\n\n```python\nmetaproperties()\nmetaproperty_info(metaproperty_id)\nmetaproperty_options(metaproperty_id)\nedit_metaproperty_option(metaproperty_option_id, children)\n```\n\n### workflow\\_client:\n\nAll the workflow related calls.\n\n```python\nusers()\ncampaigns(query)\ncampaign_info(campaign_id)\ncreate_campaign(name, key, description, responsibleID, query)\ndelete_campaign(campaign_id)\nedit_campaign(campaign_id, name, key, description, responsibleID, query)\nmetaproperties()\nmetaproperty_info(metaproperty_id)\ngroups()\ngroup_info(group_id)\njob_preset_info(job_preset_info)\njobs(campaign_id)\ncreate_job(name, campaignID, accountableID, presetID, query)\njob_info(job_id)\nedit_job(job_id, name, campaignID, accauntableID, presetID, query)\ndelete_job(job_id)}\n```\n\nTests\n-----\n\nYou can run the tests by using the command below. This will install the\npackages required and execute the tests for all the clients.\n\n```bash\nmake test\n```\n\nDocker Setup Guide\n-----------------\n\nThe Docker setup allows you to run your Python scripts inside a Docker container, with dependencies installed and files synchronized. This guide aims to facilitate the development and testing of the SDK.\n\n### Requirements and dependencies\n\nEnsure the following are installed on your machine:\n\n- [Docker](https://www.docker.com/get-started/)\n- [docker-compose](https://docs.docker.com/compose/)\n\n### Initial Setup\n\nCreate a `secret.json` file by following the example provided in the project. Fill in the necessary settings based on your requirements. If you have a permanent token, only the domain and permanent_token fields need to be specified:\n ```\n {\n \"domain\": \"example.bynder.com\", # Without the http:// or https://\n \"permanent_token\": \"7d09...........\"\n}\n ```\n\nWith `docker` and `docker-compose` installed, and your `secret.json` file ready, run the following command to initiate the container:\n```bash\nmake run-docker\n```\nThis command initializes a container with the bynder-python-sdk installed and ready for use.\n\n### Executing SDK Samples\n\nYou can utilize the `Makefile` commands on your console to run SDK sample scripts. The syntax is as follows:\n```bash\nmake executeSdkSample sample-file-name=file.py\n```\nAll sample files are located in the `./samples` directory.\n\n> :warning: Caution: The sample scripts are provided as examples. It is crucial to review, add and/or modify the commands before execution. The container updates automatically with changes, ensuring a seamless development experience. Always exercise caution when executing scripts.\n\n## Stopping the Docker Container\n\nWhen you're done with your development or testing, you can stop the Docker container using the following command:\n\n```bash\nmake stop-docker\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Bynder SDK can be used to speed up the integration of Bynder in Python",
"version": "2.0.0",
"project_urls": {
"Homepage": "https://bynder.com"
},
"split_keywords": [
"bynder",
" dam"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2a81fc78fa60018afa2e0bab310ab85bfdb1c81c5dc35e855236c14eaf4cc872",
"md5": "490d2cb677f11ba21fba2a57596c07dc",
"sha256": "81d837350f3c386732b68d950253024a4d2338dd649add2c401b1cc22301e6f9"
},
"downloads": -1,
"filename": "bynder_sdk-2.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "490d2cb677f11ba21fba2a57596c07dc",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 18484,
"upload_time": "2024-03-28T13:29:30",
"upload_time_iso_8601": "2024-03-28T13:29:30.861639Z",
"url": "https://files.pythonhosted.org/packages/2a/81/fc78fa60018afa2e0bab310ab85bfdb1c81c5dc35e855236c14eaf4cc872/bynder_sdk-2.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5e39872b9b15484dae653997461f3ef723936c9571dd9453cdf41c3095d3808f",
"md5": "8270bafec5b3905aeee98cfd356275c8",
"sha256": "9927cda0467ad4febfc84f284fc5b235107692bd5cfa2b0b0a934f0a33ab6908"
},
"downloads": -1,
"filename": "bynder-sdk-2.0.0.tar.gz",
"has_sig": false,
"md5_digest": "8270bafec5b3905aeee98cfd356275c8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 16583,
"upload_time": "2024-03-28T13:29:32",
"upload_time_iso_8601": "2024-03-28T13:29:32.291492Z",
"url": "https://files.pythonhosted.org/packages/5e/39/872b9b15484dae653997461f3ef723936c9571dd9453cdf41c3095d3808f/bynder-sdk-2.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-28 13:29:32",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "bynder-sdk"
}