sick / shotty-python-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

shotty python api

Installation

Installation using pip::

pip install shotty

Usage

Usage instructions here

from shotty import api
shotty = api('localhost', '54342a78-e2e8f65f-8040ae5f-5a01fe75-66909b98')
shotty.get('users') # get all users
shotty.get('users', id='785845fjdfg930459') # get one user
shotty.get('projects') # get all projects
p = shotty.get('projects', id='CASINO') # get one project
print p['paths']['root']
shotty.get('shots', id='54342a78-e2e8f65f-8040ae5f') # get one shot
shots = shotty.get('shots', projectId='CASINO') # get all shots for test project
print len(shots)
print 'shots with client status', len([shot for shot in shots if shot['status'] == 'client'])
shotty.get('versions', id='54342a78-e2e8f65f-8040ae5f') # get one version
versions = shotty.get('versions', projectId='CASINO') # get all versions for test project
print 'dailies versions', len([version for version in versions if version['type'] == 'dailies'])
shotty.get('versions', shotId='748324hfsd904') # get all versions for one shot
shotty.create('shots', {'projectId': 'demo', 'sequence': 'api', 'code': '002', 'creatorId': None}) # create shot
shotty.edit('shots', {'id': 'b314aa2f-e645-4174-b9f2-25dbc6761607', 'description': 'Test'}) # edit shot
shotty.delete('b314aa2f-e645-4174-b9f2-25dbc6761607') # delete shot

About

License:Other


Languages

Language:Python 100.0%