LearnSprout 0.2.5

`learnsprout-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]http://developers.learnsprout.com/interactive

## Installation

pip install learnsprout

#### Dependencies

[requests - HTTP for Humans]http://docs.python-requests.org)

## Using the client

The `LearnSproutClient` only requires an `apikey` to use. [Requesting one]http://developers.learnsprout.com) for your own use is simple. There is also a public sample API which only has access to sample data.

then in Python, the `apikey` will be inferred automagically from the var above

client = LearnSproutClient()

### Organizations

Organizations are the root level element. Organizations can be accessed off the root level.

orgs = client.orgs.iter_all()

This will return an IterableResult which can be iterated over for the resources.

orgs = client.orgs.iter_all() for org in orgs: print org

Resources 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.

You can grab individual resources out of the IterableResult by calling next().

org = orgs.next()

If you know the LearnSprout id of the specific resource you're looking for, you can skip iterating and grab the instance straight from the collection.

org = client.orgs.get("506b8b1f780aa79602388b42")

### Schools

Schools are subresources of organizations. Subresources are available off of resource instances.

org = orgs.next() schools = org.schools.iter_all()

### Pagination

Note 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 iter_all() will only return ResourceInstances with time_updated greater than the value provided.

Copyright (c) 2012 LearnSprout, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.