laernsprout-python

A simple Python client for working with the LearnSprout API
Download

laernsprout-python Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Other/Proprietary Li...
  • Price:
  • FREE
  • Publisher Name:
  • Jonathan Fung

laernsprout-python Tags


laernsprout-python Description

laernsprout-python is a simple Python library for access to student information via the LearnSprout REST API. You can view documentation for the REST API at LearnSprout's interactive console.Using the clientThe `LearnSproutClient` only requires an api-key to use. Requesting one for your own use is simmple. There is also a public sample API which only has access to sample data.pythonfrom learnsprout.client import LearnSproutClientclient = LearnSproutClient("fcb8534c-e4ee-4e02-8b22-9328db1dac18")OrganizationsOrganizations are the root level element. Organizations can be accessed off the root level.pythonorgs = client.organizations.list()This will return an IterableResult which can be iterated over for the resources.pythonorgs = client.organizations.list()for org in orgs print orgYou can also go through each resource one at a time.pythonorgs = client.organizations.list()for org in orgs print orgResources have the same properties as listed in the REST API, with the exception of the *id* which has been renamed *ls_id* to not collide with Python ids.SchoolsSchools are subresources of organizations. Subresources are available off of resource instances.pythonorg = orgsschools = org.schools.list()PaginationNote that schools, like some other resources, are paginated. However, when iterating over a IterableResult, if you exhaust all the elements in the page, the client will fetch additional results so you should not need to worry about paging.PartialsLearnSprout also supports grabbing resources that have been updated after a certain timestamp. ResourceInstances have a *time_updated* property. Specifying that as an argument to list() will only return ResourceInstances with time_updated greater than the value provided.pythonschools_resource = org.schoolstime_since = schools_resource.list().next().time_updatedschools_resource.list(since=time_since)Product's homepage


laernsprout-python Related Software