TutorialΒΆ
This package wraps Quizlet API.
In order to use this module you should register your application on you profile’s settings page and initialize :class:QuizletClient instance with your client_id.
import quizlet client = quizlet.QuizletClient(client_id='my_client_id', login='me')
Or you can use Oauth 2.0 access token. This way will gives additional opportunities depending on token’s scope:
import quizlet client = quizlet.QuizletClient(token='bla bla bla', login='me')
Note
Argument login is required to make user-related requests (for instance to retrieve user’s Set
s).
Once the client is initialized, you can use its api
attribute to make http requests.
It’s some sort of a low level of making requests.
client.api.search.sets.get(params={'q': 'Python'})
Here is a simpler analog:
client.sets.search(query='Python')
Here are some examples of this module is capable of:
# Get client's sets
for set in client.sets:
print(set.id)
# Create a new set (if you have permissions to do it)
s = client.sets.create(title='My first set from python',
terms=['Hello'], lang_terms='en',
definitions=['Bonjour'], lang_definitions='fr')
# Delete the set
s.delete()
# Search for classes:
for cls in client.classes.search(query='Python', max_items=30):
# Do something
pass
# Join a class
cls.join()
Note
If some argument is invalid or you are not authorized to perform particular action a
QuizletError
will be raised.
Don’t worry, they usually contain a good explanation of what’s going wrong.