API Client Wrapper for QuizAPI.io
Project description
pyquizAPI
QuizAPI.io wrapper for Python 3.8+
Installation
You can install from the PyPI repository: Package on PyPI
pip install pyquizAPI
How to Use
To get an API key go to here and create an account
from pyquizAPI import QuizClient
# creates client object
client = QuizClient(api_key)
# get questions
questions = client.get_questions()
# returns list of question objects
# sample output
{'id': 197,
'question': 'What is the prefix of WordPress tables by default?',
'description': None,
'answers': {
'answer_a': 'wp_ default',
'answer_b': 'wp_',
'answer_c': 'wp_ in',
'answer_d': '_wp_',
'answer_e': None,
'answer_f': None
},
'multiple_correct_answers': 'false',
'correct_answers': {
'answer_a_correct': 'false',
'answer_b_correct': 'true',
'answer_c_correct': 'false',
'answer_d_correct': 'false',
'answer_e_correct': 'false',
'answer_f_correct': 'false'
},
'correct_answer': None,
'explanation': None,
'tip': None, 'tags': [{
'name': 'WordPress'
}],
'category': 'CMS',
'difficulty': 'Easy'}
Arguments
Argument | Type | Description |
---|---|---|
category | string | Get the questions for a specific category only |
difficulty | string | Get the questions for a specific difficulty only |
tags | [string] | Specify a list of tags that you want the questions to belong to |
limit | int | Limit the number of questions returned |
Creating and using custom configuration
client = QuizClient(api_key)
client.make_config(
category='',
difficulty='',
tags=[''],
limit=''
)
questions = client.get_questions(use_config=True)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyquizAPI-0.0.2.tar.gz
(2.8 kB
view hashes)
Built Distribution
Close
Hashes for pyquizAPI-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1f0b9b2247211ffe4e227a5ad23613a09d1e920bbfd56d9fcd0c7f4d7774cdc |
|
MD5 | 8c91e625347ffd638b553d9ec77c53e9 |
|
BLAKE2b-256 | d53ae745825ce0c6f750b05842831852d7636c5d39ff0cd680e75865ad8f702e |