Skip to main content

Access the QBreader API through Python.

Project description

QBreader Python API wrapper module

Accessing the QBreader API with a python wrapper module.

Documentation

Search the QBreader database

  query()

This function searches the QBreader database for questions that match the parameters specified.

Parameter Type Values Description
questionType string The type of question to search for. Defaults to "all". If one of the three is not set, returns a 400 Bad Request.
searchType string The type of search to perform. Defaults to "all". If one of the three is not set, returns a 400 Bad Request.
queryString string The string to search for. Defaults to "".
regex bool Whether or not to use regular expressions for the queryString. Defaults to "False".
randomize bool Whether or not to randomize the order of the results. Defaults to "False".
setName string The difficulties to search for. Defaults to []. Leave as an empty list to search all. Must be a list of ints from 1 to 10.
difficulties list The string to search for. Defaults to "".
categories list The categories to search for. Defaults to []. Leave as an empty list to search all.
subcategories list The subcategories to search for. Defaults to []. Leave as an empty list to search all.
maxQueryReturnLength int The maximum number of questions to return. Defaults to None. Leave blank to return 50. Anything over 200 will not work.

Get a random question from the QBreader database

  random_question()

This function gets a random question from the QBreader database.

Parameter Type Description
questionType string The type of question to search for (tossup or bonus). If one of the two is not set, returns a 400 Bad Request.
difficulties list The string to search for. Defaults to "".
categories list The categories to search for. Defaults to []. Leave as an empty list to search all.
subcategories list The subcategories to search for. Defaults to []. Leave as an empty list to search all.
number int The number of questions to return. Defaults to None. Leave blank to return 1.

Generate a random name

  random_question()

This function Generates an adjective-noun pair (used in multiplayer lobbies)

Get questions from a packet from the QBreader database

  packet()

This function gets questions from a packet from the QBreader database.

Parameter Type Description
setName string The name of the set to search. Can be obtained from set_list().
packetNumber int The number of the packet to search for.

Get a packet's tossups from the QBreader database

  packet_tossups()

This function gets a packet's tossups from the QBreader database. Twice as fast as using packet().

Parameter Type Description
setName string The name of the set to search. Can be obtained from set_list().
packetNumber int The number of the packet to search for.

Get a packet's bonuses from the QBreader database

  packet_bonuses()

This function gets a packet's bonuses from the QBreader database. Twice as fast as using packet().

Parameter Type Description
setName string The name of the set to search. Can be obtained from set_list().
packetNumber int The number of the packet to search for.

Get the number of packets in a set from the QBreader database

  packet_bonuses()

This function gets the number of packets in a set from the QBreader database

Parameter Type Description
setName string The name of the set to search. Can be obtained from set_list().

Get a list of sets from the QBreader database

  set_list()

This function gets a list of sets from the QBreader database.

Get a list of rooms from the QBreader database

  room_list()

This function gets a list of rooms from the QBreader database.

Report a question from the QBreader database

  report_question()

This function reports a question from the QBreader database.

Parameter Type Description
_id string The ID of the question to report.
reason string The reason for reporting the question. Defaults to None.
description string A description of the reason for reporting the question. Defaults to None.

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

qbreader-0.0.3.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

qbreader-0.0.3-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file qbreader-0.0.3.tar.gz.

File metadata

  • Download URL: qbreader-0.0.3.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for qbreader-0.0.3.tar.gz
Algorithm Hash digest
SHA256 6bbda7667ebb9344574e3442474794ce24a2622e4e4bd49ae1558eb3d960d103
MD5 8d18e635627766e13f6044b0cf512ac4
BLAKE2b-256 6497bf2cac3f270b956cf966f42bc09aea7c50700569eae56d03666ec39d9c5f

See more details on using hashes here.

File details

Details for the file qbreader-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: qbreader-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for qbreader-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d1f4e65569a81534de5be919b10958e9e69e1a81c2ef46e24c573772bb38dd45
MD5 6c33a9661b280b6f8c8bc77ffde838c2
BLAKE2b-256 df378673b3dff928020d0644b8cc6eda48b28b8f4929335c2f18822bdc0acba4

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