Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
111 lines (64 sloc) 2.43 KB

Socialize Python SDK

This SDK is used for our partners, but if you do not have a partner key, you can use this as a template with your client key to get a jump start on making any custom API calls.

How to use

First time running you will need to activate the virtual environment to download required package.

./ build

or modify the with verified partner key/secret.

./ unit_test

Or running tests using nosetests:

_install/bin/nosetests [ -s for print output| -v more verbose ]

Or running specific test

_install/bin/nosetests -s -v tests.api_user_test:ApiUserTest.test_ban_user_by_id

This SDK is a work in progress. Below are the implemented endpoints.

Partner API:

    - GET list of applications
    - POST new application

    - GET specific application
    - PUT update application information
    - Delete
    - Upload P12 for push notification
    - Upload application icon

    - Get list of api_users [ filter by application ]
    - Get list of banned users

    - ban
    - unban


The client can be installed as a module and imported.

** You might need to add in submodule root repo.

Instruction from here

to init:
git submodule add socialize_python_sdk
git submodule init
git submodule update

#** I didn't add into root folder because it will break every test
#** I will try to fix it later

touch socialize_python_sdk/

to update:
goto submodule directory, 
git submodule init
git submodule update
git pull


from socialize.client import Partner

    Partner interface can return
        - a list of applications
        - Single Application Object

partner = Partner(key,secret,url)  
apps = partner.applications(userId)

for app in apps:
    print app
    print app.to_dict()

# apps.find() return meta dict, list of application by userId
meta, result = apps.find()

# apps.findOne(id) return application object

application = apps.findOne(42)