Skip to content

Latest commit

 

History

History
52 lines (29 loc) · 1.67 KB

File metadata and controls

52 lines (29 loc) · 1.67 KB

Overview

Python-coveapi is the Python client for the PBS COVE API service.

Getting Started

Installation

Install coveapi to your Python path (hopefully in a virtualenv!).

python setup.py install

Usage

To do anything, you will first need a connection to the COVE API service:

import coveapi
cove = coveapi.connect('PHONY-COVEAPI-APP-ID', 'PHONY-COVEAPI-APP-SECRET')

To retrieve a single resource, pass the resource ID, or resource URI to *.get()

cove.videos.get(3143)
cove.videos.get('/cove/v1/videos/3143/')
cove.videos.get('http://api.pbs.org/cove/v1/videos/3143/')

To retrieve a list resources, pass the filters to *.filter()

cove.programs.filter(filter_nola_root='NOVA')
cove.programs.filter(filter_title='American Experience')

To retrieve deleted resources, use the graveyard's deleted_since method:

cove.graveyard.deleted_since(deleted_since='2014-04-10T05:00:00')

You may query with .get() or .filter() for:

  • Groups: cove.groups.get(resource_uri)
  • Categories: cove.categories.get(resource_uri)
  • Programs: cove.programs.get(resource_uri)
  • Videos: cove.videos.get(resource_uri)

Everything returns a Python dict as emitted from JSON data.

See COVE API documentation for the complete list of filters and return data.