Python wrapper for the Open Trivia Database
Project description
python-open-trivia-database-wrapper
A Python wrapper for the Open Trivia Database API.
To intall the package, run the following command:
pip install python-open-trivia-database-wrapper
Usage
from opentdb.opentdb import openTriviaDB, Parameters
trivia = openTriviaDB()
response = trivia.get_questions(category=Parameters.Category.GENERAL_KNOWLEDGE, number_of_questions=1)
Example response:
{
"response_code": 0,
"results": [
{
"category": "General Knowledge",
"type": "multiple",
"difficulty": "easy",
"question": "What is the most common surname Wales?",
"correct_answer": "Jones",
"incorrect_answers": [
"Williams",
"Davies",
"Evans"
]
}
]
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file open_trivia_database_wrapper-0.3.0-py3-none-any.whl.
File metadata
- Download URL: open_trivia_database_wrapper-0.3.0-py3-none-any.whl
- Upload date:
- Size: 16.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6c4c09163fb0fe6763736349dfa423a790f0ea7033a4bbf1f989c7401a6ba3b
|
|
| MD5 |
8b16c5370c02452961ef7634648c10de
|
|
| BLAKE2b-256 |
a761dbe612a74910a6e52b3dfd7fa2b8f9b065ddb3637ecc3000f5cace2774ac
|