Skip to main content

Library for searching answers to school questions.

Project description

RuOtvet

Library for searching answers to school questions in the big count of services.

Installation:

Download library using pip
$ pip3 install ruotvet -U

Usage examples:

Query with attachment saving example:
from ruotvet.utils import get_attachment
from ruotvet import YandexQ
import asyncio


async def main():
    questions = await YandexQ().get_answers("Что такое математика", count=1)
    for question in questions:
        print("Answer: ", question.answer)
        if question.attachments:
            print("Answer attachment: ", await get_attachment(attachment=question.attachments[0]))


loop = asyncio.get_event_loop()
loop.run_until_complete(main())

Image OCR example:

Before using OCR you need to install our sub-package for recognition and tesseract with language data for it.

Install our subpackage:

$ pip3 install ruotvet[ocr]

.. and after that install tesseract:

In macOS simply install it using brew:

$ brew install tesseract
$ brew install tesseract-lang

In unix-like you should do it like this:

$ sudo apt-get install tesseract-ocr
$ sudo apt-get install tesseract-ocr-all

For using OCR in Windows, follow this instruction.

from ruotvet.utils import OCR
from ruotvet import YandexQ
import asyncio


async def main():
    query = OCR().recognize("image.png")["text"]
    questions = await YandexQ().get_answers(query, count=1)
    for question in questions:
        print("Answer: ", question.answer)


loop = asyncio.get_event_loop()
loop.run_until_complete(main())

License

The library is under the GNU LGPLv3 license.

BE AWARE THAT THE AUTHORS ARE UNDER NO CIRCUMSTANCES RESPONSIBLE FOR CONSEQUENCES OF USE AND ANY INTERACTION WITH THE LIBRARY. NOT LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. THE CODE IS PROVIDED FOR EDUCATION PURPOSES ONLY.

Read the LICENSE for more information.

Contributing

Feel free to contribute.

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

ruotvet-1.3.1.1.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

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

ruotvet-1.3.1.1-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

File details

Details for the file ruotvet-1.3.1.1.tar.gz.

File metadata

  • Download URL: ruotvet-1.3.1.1.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for ruotvet-1.3.1.1.tar.gz
Algorithm Hash digest
SHA256 f0ea723ddfac0f0be5957d22918b60131c24fa3869513aea766d2fb1155139f9
MD5 a679a15712e27f7a6a0a5d888abebcd9
BLAKE2b-256 2123bcb9ba7d04099a45401e6b935bd21b965032512ccd7dc6ac765ce105904a

See more details on using hashes here.

File details

Details for the file ruotvet-1.3.1.1-py3-none-any.whl.

File metadata

  • Download URL: ruotvet-1.3.1.1-py3-none-any.whl
  • Upload date:
  • Size: 18.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for ruotvet-1.3.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0e636406aa4e0500fd3127374cd8520d0a807cfe3e314cabb215a1521d5dd9d4
MD5 697fc3c6bcdc7f6a5db8ed255b8f7dcd
BLAKE2b-256 93bc579926a81483c37a23ef78dd1060217ac4ebdd30030af30762857f1fcc1b

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