bBridge Python SDK
bBridge SDK is a Python (2 and 3) library to access the bBridge API. This library enables you to make requests such as user profiling, image object detection, etc. in your Python application.
Example
from bbridge_client import BBridgeClient
from entity.enum.language import EN
from entity.enum.user_attribute import GENDER, AGE_GROUP
from entity.user import User
from entity.user_profile import UserProfile
# set correct user credentials
username = "username"
password = "password"
# if you have token use: BBridgeClient(token)
client = BBridgeClient.Builder(username, password).build()
# make user profiling request
user = User(["cat is so cute!", "Scarlet is very good person"],
["https://pbs.twimg.com/media/C279-WDXEAIg4lD.jpg"])
request_id = client.individual_user_profiling(user, EN, [GENDER, AGE_GROUP]).body
# get the request's result using 'response' method
# specify response content type by 2nd argument (e.g. UserProfiling for profile method)
response = client.response(request_id, UserProfile)
assert request_id == response.body.request_id
Dependencies
pip install -r requirements.txt
# for test
pip install -r test-requirements.txt
Documentation
More information can be found on the bBridge developer site.