Metadata-Version: 2.4
Name: open-trivia-database-wrapper
Version: 0.3.1
Summary: Python wrapper for the Open Trivia Database
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydantic>=2.10.6
Requires-Dist: requests>=2.32.3
Requires-Dist: setuptools>=78.1.0
Dynamic: license-file

# python-open-trivia-database-wrapper

A Python wrapper for the[ Open Trivia Database API](https://opentdb.com/).

To intall the package, run the following command:

```bash
pip install python-open-trivia-database-wrapper
```

## Usage

```python
from opentdb.opentdb import openTriviaDB, Parameters

trivia = openTriviaDB()
response = trivia.get_questions(category=Parameters.Category.GENERAL_KNOWLEDGE, number_of_questions=1)
```

Example response:

```json
    {
        "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"
                ]
            }
        ]
    }
 ```

