qbreader


Nameqbreader JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/qbreader/python-module
SummaryQuizbowl library and Python wrapper for the qbreader API
upload_time2025-01-15 06:07:44
maintainerSky "skysomorphic" Hong
docs_urlNone
authorSky "skysomorphic" Hong
requires_python>=3.11
licenseMIT
keywords quizbowl quiz bowl qbreader
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # qbreader/python-module

[![pypi](https://img.shields.io/pypi/v/qbreader?logo=pypi&logoColor=f0f0f0)](https://pypi.org/project/qbreader/)
[![downloads](https://img.shields.io/pypi/dm/qbreader?logo=pypi&logoColor=f0f0f0)](https://pypi.org/project/qbreader/)
[![python](https://img.shields.io/pypi/pyversions/qbreader?logo=python&logoColor=f0f0f0)](https://pypi.org/project/qbreader/)
[![build](https://img.shields.io/github/actions/workflow/status/qbreader/python-module/test.yml?logo=github&logoColor=f0f0f0)](https://github.com/qbreader/python-module/actions/workflows/test.yml)
[![docs](https://readthedocs.org/projects/python-qbreader/badge/?version=latest)](https://python-qbreader.readthedocs.io/en/latest/?badge=latest)

---

## Introduction

`qbreader` is a Python wrapper to the qbreader API as well as a general quizbowl library. It provides
both asynchronous and synchronous interfaces to the API along with functionality for representing questions.

Documentation for this package is available at <https://python-qbreader.readthedocs.io/>.

## Installation

### PyPI

```sh
$ pip install qbreader
# or whatever environment/dependency management system you use
```

### Git

Alternatively, you may install the most recent, but potentially unstable, development version directly from this repository.

```sh
$ pip install git+https://github.com/qbreader/python-module.git
```

## A quick glance

```py
>>> from qbreader import Sync as qbr # synchronous interface
>>> sync_client = qbr()
>>> tossup = sync_client.random_tossup()[0]
>>> tossup.question
'<b>Tim Peters wrote 19 “guiding principles” of this programming language, which include the maxim “Complex is better than complicated.” The “pandas” library was written for this language. Unicode string values had to be defined with a “u” in version 2 of this language. Libraries in this language include Tkinter, Tensorflow, (*)</b> NumPy (“numb pie”) and SciPy (“sigh pie”). The framework Django was written in this language. This language uses “duck typing.” Variables in this language are often named “spam” and “eggs.” Guido van Rossum invented, for 10 points, what programming language named for a British comedy troupe?'
>>> tossup.question_sanitized
'Tim Peters wrote 19 “guiding principles” of this programming language, which include the maxim “Complex is better than complicated.” The “pandas” library was written for this language. Unicode string values had to be defined with a “u” in version 2 of this language. Libraries in this language include Tkinter, Tensorflow, (*) NumPy (“numb pie”) and SciPy (“sigh pie”). The framework Django was written in this language. This language uses “duck typing.” Variables in this language are often named “spam” and “eggs.” Guido van Rossum invented, for 10 points, what programming language named for a British comedy troupe?'
>>> tossup.answer
'<b><u>Python</u></b>'
>>> tossup.answer_sanitized
'Python'
>>> tossup.category
<Category.SCIENCE: 'Science'>
>>> tossup.subcategory
<Subcategory.OTHER_SCIENCE: 'Other Science'>
>>> tossup.difficulty
<Difficulty.HS_HARD: '4'>
>>> tossup.set.name
'2022 Prison Bowl'
>>> (tossup.packet.number, tossup.number)
(4, 20)
>>> bonus = sync_client.random_bonus()[0]
>>> bonus.leadin
'The Curry–Howard isomorphism states that computer programs are directly equivalent to these mathematical constructs, which can be automated using the languages Lean or Rocq (“rock”). For 10 points each:'
>>> bonus.leadin_sanitized
'The Curry-Howard isomorphism states that computer programs are directly equivalent to these mathematical constructs, which can be automated using the languages Lean or Rocq ("rock"). For 10 points each:'
>>> bonus.parts
('Name these mathematical constructs that are used to formally demonstrate the truth of a mathematical statement.', 'According to the Curry–Howard isomorphism, these programming concepts correspond to individual propositions of a proof. One method of “inferring” these things in programming languages like Python is named for the duck test.', 'Haskell Curry also lends his name to “currying,” a common tool in functional programming languages that transforms a function into a sequence of functions each with a smaller value for this property. A description is acceptable.')
>>> bonus.parts_sanitized
('Name these mathematical constructs that are used to formally demonstrate the truth of a mathematical statement.', 'According to the Curry-Howard isomorphism, these programming concepts correspond to individual propositions of a proof. One method of "inferring" these things in programming languages like Python is named for the duck test.', 'Haskell Curry also lends his name to "currying," a common tool in functional programming languages that transforms a function into a sequence of functions each with a smaller value for this property. A description is acceptable.')
>>> bonus.answers
('mathematical <b><u>proof</u>s</b> [or formal <b><u>proof</u></b>s or <b><u>proof</u></b>s of correctness; accept <b><u>proof</u></b> assistant or theorem <b><u>prover</u></b> or Rocq <b><u>prover</u></b>]', 'data <b><u>type</u></b>s [accept <b><u>type</u></b> inference or duck <b><u>typing</u></b>]', '<b><u>arity</u></b> [accept descriptions of the <b><u>number of argument</u></b>s or the <b><u>number of parameter</u></b>s or the <b><u>number of</u> <u>input</u></b>s of a function]')
>>> bonus.answers_sanitized
('mathematical proofs [or formal proofs or proofs of correctness; accept proof assistant or theorem prover or Rocq prover]', 'data types [accept type inference or duck typing]', 'arity [accept descriptions of the number of arguments or the number of parameters or the number of inputs of a function]')
>>> bonus.difficultyModifiers
('e', 'm', 'h')
>>> bonus.values
(10, 10, 10)
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/qbreader/python-module",
    "name": "qbreader",
    "maintainer": "Sky \"skysomorphic\" Hong",
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": "skysomorphic@pm.me",
    "keywords": "quizbowl, quiz bowl, qbreader",
    "author": "Sky \"skysomorphic\" Hong",
    "author_email": "skysomorphic@pm.me",
    "download_url": "https://files.pythonhosted.org/packages/5b/e7/4ec0f168861907370e3a5d142f5e8b60bb73ed8c58e415d6958bd424f938/qbreader-1.0.1.tar.gz",
    "platform": null,
    "description": "# qbreader/python-module\n\n[![pypi](https://img.shields.io/pypi/v/qbreader?logo=pypi&logoColor=f0f0f0)](https://pypi.org/project/qbreader/)\n[![downloads](https://img.shields.io/pypi/dm/qbreader?logo=pypi&logoColor=f0f0f0)](https://pypi.org/project/qbreader/)\n[![python](https://img.shields.io/pypi/pyversions/qbreader?logo=python&logoColor=f0f0f0)](https://pypi.org/project/qbreader/)\n[![build](https://img.shields.io/github/actions/workflow/status/qbreader/python-module/test.yml?logo=github&logoColor=f0f0f0)](https://github.com/qbreader/python-module/actions/workflows/test.yml)\n[![docs](https://readthedocs.org/projects/python-qbreader/badge/?version=latest)](https://python-qbreader.readthedocs.io/en/latest/?badge=latest)\n\n---\n\n## Introduction\n\n`qbreader` is a Python wrapper to the qbreader API as well as a general quizbowl library. It provides\nboth asynchronous and synchronous interfaces to the API along with functionality for representing questions.\n\nDocumentation for this package is available at <https://python-qbreader.readthedocs.io/>.\n\n## Installation\n\n### PyPI\n\n```sh\n$ pip install qbreader\n# or whatever environment/dependency management system you use\n```\n\n### Git\n\nAlternatively, you may install the most recent, but potentially unstable, development version directly from this repository.\n\n```sh\n$ pip install git+https://github.com/qbreader/python-module.git\n```\n\n## A quick glance\n\n```py\n>>> from qbreader import Sync as qbr # synchronous interface\n>>> sync_client = qbr()\n>>> tossup = sync_client.random_tossup()[0]\n>>> tossup.question\n'<b>Tim Peters wrote 19 \u201cguiding principles\u201d of this programming language, which include the maxim \u201cComplex is better than complicated.\u201d The \u201cpandas\u201d library was written for this language. Unicode string values had to be defined with a \u201cu\u201d in version 2 of this language. Libraries in this language include Tkinter, Tensorflow, (*)</b> NumPy (\u201cnumb pie\u201d) and SciPy (\u201csigh pie\u201d). The framework Django was written in this language. This language uses \u201cduck typing.\u201d Variables in this language are often named \u201cspam\u201d and \u201ceggs.\u201d Guido van Rossum invented, for 10 points, what programming language named for a British comedy troupe?'\n>>> tossup.question_sanitized\n'Tim Peters wrote 19 \u201cguiding principles\u201d of this programming language, which include the maxim \u201cComplex is better than complicated.\u201d The \u201cpandas\u201d library was written for this language. Unicode string values had to be defined with a \u201cu\u201d in version 2 of this language. Libraries in this language include Tkinter, Tensorflow, (*) NumPy (\u201cnumb pie\u201d) and SciPy (\u201csigh pie\u201d). The framework Django was written in this language. This language uses \u201cduck typing.\u201d Variables in this language are often named \u201cspam\u201d and \u201ceggs.\u201d Guido van Rossum invented, for 10 points, what programming language named for a British comedy troupe?'\n>>> tossup.answer\n'<b><u>Python</u></b>'\n>>> tossup.answer_sanitized\n'Python'\n>>> tossup.category\n<Category.SCIENCE: 'Science'>\n>>> tossup.subcategory\n<Subcategory.OTHER_SCIENCE: 'Other Science'>\n>>> tossup.difficulty\n<Difficulty.HS_HARD: '4'>\n>>> tossup.set.name\n'2022 Prison Bowl'\n>>> (tossup.packet.number, tossup.number)\n(4, 20)\n>>> bonus = sync_client.random_bonus()[0]\n>>> bonus.leadin\n'The Curry\u2013Howard isomorphism states that computer programs are directly equivalent to these mathematical constructs, which can be automated using the languages Lean or Rocq (\u201crock\u201d). For 10 points each:'\n>>> bonus.leadin_sanitized\n'The Curry-Howard isomorphism states that computer programs are directly equivalent to these mathematical constructs, which can be automated using the languages Lean or Rocq (\"rock\"). For 10 points each:'\n>>> bonus.parts\n('Name these mathematical constructs that are used to formally demonstrate the truth of a mathematical statement.', 'According to the Curry\u2013Howard isomorphism, these programming concepts correspond to individual propositions of a proof. One method of \u201cinferring\u201d these things in programming languages like Python is named for the duck test.', 'Haskell Curry also lends his name to \u201ccurrying,\u201d a common tool in functional programming languages that transforms a function into a sequence of functions each with a smaller value for this property. A description is acceptable.')\n>>> bonus.parts_sanitized\n('Name these mathematical constructs that are used to formally demonstrate the truth of a mathematical statement.', 'According to the Curry-Howard isomorphism, these programming concepts correspond to individual propositions of a proof. One method of \"inferring\" these things in programming languages like Python is named for the duck test.', 'Haskell Curry also lends his name to \"currying,\" a common tool in functional programming languages that transforms a function into a sequence of functions each with a smaller value for this property. A description is acceptable.')\n>>> bonus.answers\n('mathematical <b><u>proof</u>s</b> [or formal <b><u>proof</u></b>s or <b><u>proof</u></b>s of correctness; accept <b><u>proof</u></b> assistant or theorem <b><u>prover</u></b> or Rocq <b><u>prover</u></b>]', 'data <b><u>type</u></b>s [accept <b><u>type</u></b> inference or duck <b><u>typing</u></b>]', '<b><u>arity</u></b> [accept descriptions of the <b><u>number of argument</u></b>s or the <b><u>number of parameter</u></b>s or the <b><u>number of</u> <u>input</u></b>s of a function]')\n>>> bonus.answers_sanitized\n('mathematical proofs [or formal proofs or proofs of correctness; accept proof assistant or theorem prover or Rocq prover]', 'data types [accept type inference or duck typing]', 'arity [accept descriptions of the number of arguments or the number of parameters or the number of inputs of a function]')\n>>> bonus.difficultyModifiers\n('e', 'm', 'h')\n>>> bonus.values\n(10, 10, 10)\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Quizbowl library and Python wrapper for the qbreader API",
    "version": "1.0.1",
    "project_urls": {
        "Documentation": "https://python-qbreader.readthedocs.io/",
        "Homepage": "https://github.com/qbreader/python-module",
        "Repository": "https://github.com/qbreader/python-module"
    },
    "split_keywords": [
        "quizbowl",
        " quiz bowl",
        " qbreader"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "934d5dca8d4dddaa7114b8fadbb63abbeb3fb789f6456dd7e35620a6ae3639eb",
                "md5": "7af43c71e028d6320563177616092739",
                "sha256": "83d821a7e41499238c0482fd58a3c9f625a22e641612df7b7a221c2722ee7b2a"
            },
            "downloads": -1,
            "filename": "qbreader-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7af43c71e028d6320563177616092739",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 17290,
            "upload_time": "2025-01-15T06:07:42",
            "upload_time_iso_8601": "2025-01-15T06:07:42.748828Z",
            "url": "https://files.pythonhosted.org/packages/93/4d/5dca8d4dddaa7114b8fadbb63abbeb3fb789f6456dd7e35620a6ae3639eb/qbreader-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5be74ec0f168861907370e3a5d142f5e8b60bb73ed8c58e415d6958bd424f938",
                "md5": "d6c4c06047d6a6798c19b3ab63b4d88d",
                "sha256": "d6cbe85788132372d698c2b063f7b7bfd7ffca0e1b3a38917cf2212e590c4890"
            },
            "downloads": -1,
            "filename": "qbreader-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "d6c4c06047d6a6798c19b3ab63b4d88d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 20926,
            "upload_time": "2025-01-15T06:07:44",
            "upload_time_iso_8601": "2025-01-15T06:07:44.960859Z",
            "url": "https://files.pythonhosted.org/packages/5b/e7/4ec0f168861907370e3a5d142f5e8b60bb73ed8c58e415d6958bd424f938/qbreader-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-15 06:07:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "qbreader",
    "github_project": "python-module",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "qbreader"
}
        
Elapsed time: 0.39826s