Newer
Older
# POD client
python3 implementation of a pod client
pod is a video cms for educational https://github.com/EsupPortail/Esup-Pod
all rest resources will be create on PodClient object and usable like that (HOST and API_KEY are vars that contains the base pod url and an authentication token):
```
pod_client = PodClient(HOST, API_KEY)
# fetch all videos
pod_client.videos.get()
# fetch video id 1
pod_client.videos.get(resource_id=1)
```
Example to send a video (VIDEO_PATH is the path of the video to upload):
```
pod_client = PodClient(HOST, API_KEY)
response = pod_client.videos.post(data={'title': 'unittest video', 'type': '%s/rest/types/1/' % HOST, 'owner': '%s/rest/users/1/' % HOST}, files={'video': open(VIDEO_PATH, 'rb')})
```