Skip to main content

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

Parameter Reference

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


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.14.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyquizAPI-0.0.14-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file pyquizAPI-0.0.14.tar.gz.

File metadata

  • Download URL: pyquizAPI-0.0.14.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for pyquizAPI-0.0.14.tar.gz
Algorithm Hash digest
SHA256 d552a56d8d8cc1dd57257e4c75361d2f6ac2aa928f5f47f327cd4c6597bececb
MD5 cbdbe21a64a76a048c3685ef09bd9702
BLAKE2b-256 745441bce846dde78ca1e881a30cda4e3ebf61215ed3bcfd5370858914bf0dad

See more details on using hashes here.

File details

Details for the file pyquizAPI-0.0.14-py3-none-any.whl.

File metadata

  • Download URL: pyquizAPI-0.0.14-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for pyquizAPI-0.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 5d6530dd6df57dfd8f1d2b44f46989b34b39e5cbd210910d70ed2e697458e08d
MD5 0b77633b1ce7d6a682a590bd82e0715b
BLAKE2b-256 4556999fcfcb848372b7357d2f99424b11a25ff625c0d246de8be8029226bb51

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page