Python SDK
Python SDK helps you bring video recording and playback to your service
For all projects using Python, Ziggeo's Python SDK is the way to go.
To download it you can either:
- Use the direct link to download the Python SDK
- Download from or fork our Python SDK Github repository.
Python methods
To use Ziggeo Python SDK you would first need to install it:
To use the methods from SDK in your code you would need to include it first. To include Python SDK you would use the following call: pip install ziggeo
ziggeo = Ziggeo("YOUR APP TOKEN", "YOUR_APP_PRIVATE_KEY", "YOUR_APP_ENCRYPTION_KEY")Calling methods is as simple as:
ziggeo.resource().method(args)The following is the list of methods and their function calls
videos
- index
ziggeo.videos().index(arguments = None)
Returns JSON[ { "volatile":false, "token":"a7edab8c635ec37047d8ae75411528e3", "key":null, "state":5, "max_duration":null, "duration":1, "tags":null, "submission_date":1390257799, "resubmission_date":1390257799, "stream_submission_date":1390257799, "delete_old_streams":true, "type":"ApiVideo", "created":1390257798, "owned":false, "state_string":"READY", "streams":[ { "volatile":false, "token":"d751140b4e1cf0a243f32092f6110296", "key":null, "creation_type":5, "state":5, "streamable":2, "video_type":"mp4", "video_sub_type":"other", "image_size":0, "video_size":36078, "video_width":640, "video_height":360, "duration":1, "has_video":true, "has_image":true, "submission_date":1390257799, "type":"ApiVideoStream", "created":1390257799, "owned":true, "creation_type_string":"SERVER_UPLOAD", "streamable_string":"DEGRADED", "state_string":"READY" }], "original_stream": { "volatile":false, "token":"d751140b4e1cf0a243f32092f6110296", "key":null, "creation_type":5, "state":5, "streamable":2, "video_type":"mp4", "video_sub_type":"other", "image_size":0, "video_size":36078, "video_width":640, "video_height":360, "duration":1, "has_video":true, "has_image":true, "submission_date":1390257799, "type":"ApiVideoStream", "created":1390257799, "owned":true, "creation_type_string":"SERVER_UPLOAD", "streamable_string":"DEGRADED", "state_string":"READY" }, "default_stream": { "volatile":false, "token":"d751140b4e1cf0a243f32092f6110296", "key":null, "creation_type":5, "state":5, "streamable":2, "video_type":"mp4", "video_sub_type":"other", "image_size":0, "video_size":36078, "video_width":640, "video_height":360, "duration":1, "has_video":true, "has_image":true, "submission_date":1390257799, "type":"ApiVideoStream", "created":1390257799, "owned":true, "creation_type_string":"SERVER_UPLOAD", "streamable_string":"DEGRADED", "state_string":"READY" }}]
- limit Limit the number of returned videos. Can be set up to 100.
- skip Skip the first [n] entries.
- reverse Reverse the order in which videos are returned.
- states Filter videos by state
- tags Filter the search result to certain tags, encoded as a comma-separated string
- count
ziggeo.videos().count(arguments = None)
Returns JSON- states Filter videos by state
- tags Filter the search result to certain tags, encoded as a comma-separated string
- get
ziggeo.videos().get(token_or_key)
Returns JSON{ "volatile":false, "token":"a7edab8c635ec37047d8ae75411528e3", "key":null, "state":5, "max_duration":null, "duration":1, "tags":null, "submission_date":1390257799, "resubmission_date":1390257799, "stream_submission_date":1390257799, "delete_old_streams":true, "type":"ApiVideo", "created":1390257798, "owned":false, "state_string":"READY", "streams":[ { "volatile":false, "token":"d751140b4e1cf0a243f32092f6110296", "key":null, "creation_type":5, "state":5, "streamable":2, "video_type":"mp4", "video_sub_type":"other", "image_size":0, "video_size":36078, "video_width":640, "video_height":360, "duration":1, "has_video":true, "has_image":true, "submission_date":1390257799, "type":"ApiVideoStream", "created":1390257799, "owned":true, "creation_type_string":"SERVER_UPLOAD", "streamable_string":"DEGRADED", "state_string":"READY" }], "original_stream": { "volatile":false, "token":"d751140b4e1cf0a243f32092f6110296", "key":null, "creation_type":5, "state":5, "streamable":2, "video_type":"mp4", "video_sub_type":"other", "image_size":0, "video_size":36078, "video_width":640, "video_height":360, "duration":1, "has_video":true, "has_image":true, "submission_date":1390257799, "type":"ApiVideoStream", "created":1390257799, "owned":true, "creation_type_string":"SERVER_UPLOAD", "streamable_string":"DEGRADED", "state_string":"READY" }, "default_stream": { "volatile":false, "token":"d751140b4e1cf0a243f32092f6110296", "key":null, "creation_type":5, "state":5, "streamable":2, "video_type":"mp4", "video_sub_type":"other", "image_size":0, "video_size":36078, "video_width":640, "video_height":360, "duration":1, "has_video":true, "has_image":true, "submission_date":1390257799, "type":"ApiVideoStream", "created":1390257799, "owned":true, "creation_type_string":"SERVER_UPLOAD", "streamable_string":"DEGRADED", "state_string":"READY" }}
- get_bulk
ziggeo.videos().get_bulk(arguments = None)
Returns JSON- tokens_or_keys Comma-separated list with the desired videos tokens or keys (Limit: 100 tokens or keys).
- stats_bulk
ziggeo.videos().stats_bulk(arguments = None)
Returns JSON- tokens_or_keys Comma-separated list with the desired videos tokens or keys (Limit: 100 tokens or keys).
- summarize Boolean. Set it to TRUE to get the stats summarized. Set it to FALSE to get the stats for each video in a separate array. Default: TRUE.
- download_video
ziggeo.videos().download_video(token_or_key)
Returns DATA - download_image
ziggeo.videos().download_image(token_or_key)
Returns DATA - get_stats
ziggeo.videos().get_stats(token_or_key)
Returns JSON - push_to_service
ziggeo.videos().push_to_service(token_or_key, arguments = None)
Returns JSON- pushservicetoken Push Services's token (from the Push Services configured for the app)
- apply_effect
ziggeo.videos().apply_effect(token_or_key, arguments = None)
Returns JSON- effectprofiletoken Effect Profile token (from the Effect Profiles configured for the app)
- apply_meta
ziggeo.videos().apply_meta(token_or_key, arguments = None)
Returns JSON- metaprofiletoken Meta Profile token (from the Meta Profiles configured for the app)
- update
ziggeo.videos().update(token_or_key, arguments = None)
Returns JSON{ "volatile":false, "token":"a7edab8c635ec37047d8ae75411528e3", "key":"brandnewname", "state":5, "max_duration":"10", "duration":1, "tags":null, "submission_date":1390257799, "resubmission_date":1390257799, "stream_submission_date":1390257799, "delete_old_streams":true, "type":"ApiVideo", "created":1390257798, "owned":false, "state_string":"READY", "streams":[ { "volatile":false, "token":"d751140b4e1cf0a243f32092f6110296", "key":null, "creation_type":5, "state":5, "streamable":2, "video_type":"mp4", "video_sub_type":"other", "image_size":0, "video_size":36078, "video_width":640, "video_height":360, "duration":1, "has_video":true, "has_image":true, "submission_date":1390257799, "type":"ApiVideoStream", "created":1390257799, "owned":true, "creation_type_string":"SERVER_UPLOAD", "streamable_string":"DEGRADED", "state_string":"READY" }], "original_stream": { "volatile":false, "token":"d751140b4e1cf0a243f32092f6110296", "key":null, "creation_type":5, "state":5, "streamable":2, "video_type":"mp4", "video_sub_type":"other", "image_size":0, "video_size":36078, "video_width":640, "video_height":360, "duration":1, "has_video":true, "has_image":true, "submission_date":1390257799, "type":"ApiVideoStream", "created":1390257799, "owned":true, "creation_type_string":"SERVER_UPLOAD", "streamable_string":"DEGRADED", "state_string":"READY" }, "default_stream": { "volatile":false, "token":"d751140b4e1cf0a243f32092f6110296", "key":null, "creation_type":5, "state":5, "streamable":2, "video_type":"mp4", "video_sub_type":"other", "image_size":0, "video_size":36078, "video_width":640, "video_height":360, "duration":1, "has_video":true, "has_image":true, "submission_date":1390257799, "type":"ApiVideoStream", "created":1390257799, "owned":true, "creation_type_string":"SERVER_UPLOAD", "streamable_string":"DEGRADED", "state_string":"READY" }}
- min_duration Minimal duration of video
- max_duration Maximal duration of video
- tags Video Tags
- key Unique (optional) name of video
- volatile Automatically removed this video if it remains empty
- expiration_days After how many days will this video be deleted
- update_bulk
ziggeo.videos().update_bulk(arguments = None)
Returns JSON- tokens_or_keys Comma-separated list with the desired videos tokens or keys (Limit: 100 tokens or keys).
- min_duration Minimal duration of video
- max_duration Maximal duration of video
- tags Video Tags
- volatile Automatically removed this video if it remains empty
- expiration_days After how many days will this video be deleted
- delete
ziggeo.videos().delete(token_or_key)
- create
ziggeo.videos().create(arguments = None, file = None)
Returns JSON{ "volatile":true, "token":"a7edab8c635ec37047d8ae75411528e3", "key":null, "state":3, "max_duration":null, "duration":null, "tags":null, "submission_date":null, "resubmission_date":null, "stream_submission_date":null, "delete_old_streams":true, "type":"ApiVideo", "created":1390257798, "owned":false, "state_string":"EMPTY", "streams":[], "original_stream":null, "default_stream":null }
- file Video file to be uploaded
- min_duration Minimal duration of video
- max_duration Maximal duration of video
- tags Video Tags
- key Unique (optional) name of video
- volatile Automatically removed this video if it remains empty
- analytics
ziggeo.videos().analytics(token_or_key, arguments = None)
Returns JSON- from A UNIX timestamp in microseconds used as the start date of the query
- to A UNIX timestamp in microseconds used as the end date of the query
- date A UNIX timestamp in microseconds to retrieve data from a single date. If set, it overwrites the from and to params.
- query The query you want to run. It can be one of the following: device_views_by_os, device_views_by_date, total_plays_by_country, full_plays_by_country, total_plays_by_hour, full_plays_by_hour, total_plays_by_browser, full_plays_by_browser
streams
- index
ziggeo.streams().index(video_token_or_key, arguments = None)
Returns JSON[ { "volatile":false, "token":"d751140b4e1cf0a243f32092f6110296", "key":null, "creation_type":5, "state":5, "streamable":2, "video_type":"mp4", "video_sub_type":"other", "image_size":0, "video_size":36078, "video_width":640, "video_height":360, "duration":1, "has_video":true, "has_image":true, "submission_date":1390257799, "type":"ApiVideoStream", "created":1390257799, "owned":true, "creation_type_string":"SERVER_UPLOAD", "streamable_string":"DEGRADED", "state_string":"READY" }]
- states Filter streams by state
- get
ziggeo.streams().get(video_token_or_key, token_or_key)
Returns JSON{ "volatile":false, "token":"d751140b4e1cf0a243f32092f6110296", "key":null, "creation_type":5, "state":5, "streamable":2, "video_type":"mp4", "video_sub_type":"other", "image_size":0, "video_size":36078, "video_width":640, "video_height":360, "duration":1, "has_video":true, "has_image":true, "submission_date":1390257799, "type":"ApiVideoStream", "created":1390257799, "owned":true, "creation_type_string":"SERVER_UPLOAD", "streamable_string":"DEGRADED", "state_string":"READY" }
- download_video
ziggeo.streams().download_video(video_token_or_key, token_or_key)
Returns DATA - download_image
ziggeo.streams().download_image(video_token_or_key, token_or_key)
Returns DATA - push_to_service
ziggeo.streams().push_to_service(video_token_or_key, token_or_key, arguments = None)
Returns JSON- pushservicetoken Push Services's token (from the Push Services configured for the app)
- delete
ziggeo.streams().delete(video_token_or_key, token_or_key)
- create
ziggeo.streams().create(video_token_or_key, arguments = None, file = None)
Returns JSON{ "volatile":false, "token":"d751140b4e1cf0a243f32092f6110296", "key":null, "creation_type":5, "state":5, "streamable":2, "video_type":"mp4", "video_sub_type":"other", "image_size":0, "video_size":36078, "video_width":640, "video_height":360, "duration":1, "has_video":true, "has_image":true, "submission_date":1390257799, "type":"ApiVideoStream", "created":1390257799, "owned":true, "creation_type_string":"SERVER_UPLOAD", "streamable_string":"DEGRADED", "state_string":"READY" }
- file Video file to be uploaded
- attach_image
ziggeo.streams().attach_image(video_token_or_key, token_or_key, arguments = None, file = None)
Returns JSON- file Image file to be attached
- attach_video
ziggeo.streams().attach_video(video_token_or_key, token_or_key, arguments = None, file = None)
Returns JSON- file Video file to be attached
- bind
ziggeo.streams().bind(video_token_or_key, token_or_key, arguments = None)
Returns JSON
authtokens
- get
ziggeo.authtokens().get(token)
Returns JSON - update
ziggeo.authtokens().update(token_or_key, arguments = None)
Returns JSON- volatile Will this object automatically be deleted if it remains empty?
- hidden If hidden, the token cannot be used directly.
- expiration_date Expiration date for the auth token
- usage_experitation_time Expiration time per session
- session_limit Maximal number of sessions
- grants Permissions this tokens grants
- delete
ziggeo.authtokens().delete(token_or_key)
- create
ziggeo.authtokens().create(arguments = None)
Returns JSON- volatile Will this object automatically be deleted if it remains empty?
- hidden If hidden, the token cannot be used directly.
- expiration_date Expiration date for the auth token
- usage_experitation_time Expiration time per session
- session_limit Maximal number of sessions
- grants Permissions this tokens grants
application
- get
ziggeo.application().get()
Returns JSON - update
ziggeo.application().update(arguments = None)
Returns JSON- volatile Will this object automatically be deleted if it remains empty?
- name Name of the application
- auth_token_required_for_create Require auth token for creating videos
- auth_token_required_for_update Require auth token for updating videos
- auth_token_required_for_read Require auth token for reading videos
- auth_token_required_for_destroy Require auth token for deleting videos
- client_can_index_videos Client is allowed to perform the index operation
- client_cannot_access_unaccepted_videos Client cannot view unaccepted videos
- enable_video_subpages Enable hosted video pages
- get_stats
ziggeo.application().get_stats(arguments = None)
Returns JSON- period Optional. Can be 'year' or 'month'.
effectProfiles
- create
ziggeo.effectProfiles().create(arguments = None)
Returns JSON- key Effect profile key.
- title Effect profile title.
- default_effect Boolean. If TRUE, sets an effect profile as default. If FALSE, removes the default status for the given effect
- index
ziggeo.effectProfiles().index(arguments = None)
Returns JSON- limit Limit the number of returned effect profiles. Can be set up to 100.
- skip Skip the first [n] entries.
- reverse Reverse the order in which effect profiles are returned.
- get
ziggeo.effectProfiles().get(token_or_key)
Returns JSON - delete
ziggeo.effectProfiles().delete(token_or_key)
- update
ziggeo.effectProfiles().update(token_or_key, arguments = None)
Returns JSON- default_effect Boolean. If TRUE, sets an effect profile as default. If FALSE, removes the default status for the given effect
effectProfileProcess
- index
ziggeo.effectProfileProcess().index(effect_token_or_key, arguments = None)
Returns JSON- states Filter streams by state
- get
ziggeo.effectProfileProcess().get(effect_token_or_key, token_or_key)
Returns JSON - delete
ziggeo.effectProfileProcess().delete(effect_token_or_key, token_or_key)
- create_filter_process
ziggeo.effectProfileProcess().create_filter_process(effect_token_or_key, arguments = None)
Returns JSON- effect Effect to be applied in the process
- create_watermark_process
ziggeo.effectProfileProcess().create_watermark_process(effect_token_or_key, arguments = None, file = None)
Returns JSON- file Image file to be attached
- vertical_position Specify the vertical position of your watermark (a value between 0.0 and 1.0)
- horizontal_position Specify the horizontal position of your watermark (a value between 0.0 and 1.0)
- video_scale Specify the image scale of your watermark (a value between 0.0 and 1.0)
metaProfiles
- create
ziggeo.metaProfiles().create(arguments = None)
Returns JSON- key Meta Profile profile key.
- title Meta Profile profile title.
- index
ziggeo.metaProfiles().index(arguments = None)
Returns JSON- limit Limit the number of returned meta profiles. Can be set up to 100.
- skip Skip the first [n] entries.
- reverse Reverse the order in which meta profiles are returned.
- get
ziggeo.metaProfiles().get(token_or_key)
Returns JSON - delete
ziggeo.metaProfiles().delete(token_or_key)
metaProfileProcess
- index
ziggeo.metaProfileProcess().index(meta_token_or_key)
Returns JSON - get
ziggeo.metaProfileProcess().get(meta_token_or_key, token_or_key)
Returns JSON - delete
ziggeo.metaProfileProcess().delete(meta_token_or_key, token_or_key)
- create_video_analysis_process
ziggeo.metaProfileProcess().create_video_analysis_process(meta_token_or_key)
Returns JSON - create_audio_transcription_process
ziggeo.metaProfileProcess().create_audio_transcription_process(meta_token_or_key)
Returns JSON - create_nsfw_process
ziggeo.metaProfileProcess().create_nsfw_process(meta_token_or_key, arguments = None)
Returns JSON- nsfw_action One of the following three: approve, reject, nothing.
webhooks
- create
ziggeo.webhooks().create(arguments = None)
Returns string- target_url The url that will catch the events
- encoding Data encoding to be used by the webhook to send the events.
- events Comma-separated list of the events the webhook will catch. They must be valid webhook type events.
- delete
ziggeo.webhooks().delete(arguments = None)
Returns string- target_url The url that will catch the events
analytics
- get
ziggeo.analytics().get(arguments = None)
Returns JSON- from A UNIX timestamp in microseconds used as the start date of the query
- to A UNIX timestamp in microseconds used as the end date of the query
- date A UNIX timestamp in microseconds to retrieve data from a single date. If set, it overwrites the from and to params.
- query The query you want to run. It can be one of the following: device_views_by_os, device_views_by_date, total_plays_by_country, full_plays_by_country, total_plays_by_hour, full_plays_by_hour, total_plays_by_browser, full_plays_by_browser