## Install
```
pip install Python-Trivia-API
```
## Example usage
```Python
from pytrivia import Category, Diffculty, Type, Trivia
my_api = Trivia(True)
response = my_api.request(2, Category.Books, Diffculty.Hard, Type.True_False)
print(response)
```
## Full method signature
```Python
def request(self, num_questions: int, category: Category = None,
diffculty: Diffculty = None, type_: Type = None):
"""
Send an api request to https://opentdb.com/
Limitations:
Only 1 Category can be requested per API Call.
To get questions from any category, don't specify a category.
A Maximum of 50 Questions can be retrieved per call.
:param num_questions: the number of questions,
must be between 1 and 50 (inclusive)
:param category: the category of the question. None for any category
:param diffculty: the diffculty of the question. None for any diffculty
:param type_: the type of the question. None for any type
:return: the api call response
:rtype: dict
:raises: ValueError when the num_questions parameter is less than 1
or greater than 50
"""
```
Metadata
Release files for Python-Trivia-API 4.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| Python-Trivia-API-4.0.2.tar.gz | 3.7 kB | Without provenance | Details for Python-Trivia-API-4.0.2.tar.gz |
Release files / Python-Trivia-API-4.0.2.tar.gz
| Download URL | Python-Trivia-API-4.0.2.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
261de89d12115003761c9796f6050b821f0cbdfc706257e4ba657a5a707998b9
|
|
BLAKE2b-256 checksum How to use checksums |
23986cd852892d8b01b49379370e2a3bb90ad1f967a705781c0a7d4e1b4a6617
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for Python-Trivia-API 4.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.