Skip to main content

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.

Release files for ruotvet 1.3.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ruotvet 1.3.1.1
File Size Uploaded
ruotvet-1.3.1.1.tar.gz 10.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ruotvet 1.3.1.1
File Interpreter ABI Platform
ruotvet-1.3.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 28.9 kB

Release files / ruotvet-1.3.1.1.tar.gz

Download URL ruotvet-1.3.1.1.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f0ea723ddfac0f0be5957d22918b60131c24fa3869513aea766d2fb1155139f9
BLAKE2b-256 checksum
How to use checksums
2123bcb9ba7d04099a45401e6b935bd21b965032512ccd7dc6ac765ce105904a
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / ruotvet-1.3.1.1-py3-none-any.whl

Download URL ruotvet-1.3.1.1-py3-none-any.whl
Size 18.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0e636406aa4e0500fd3127374cd8520d0a807cfe3e314cabb215a1521d5dd9d4
BLAKE2b-256 checksum
How to use checksums
93bc579926a81483c37a23ef78dd1060217ac4ebdd30030af30762857f1fcc1b
Upload date
Uploaded using Trusted Publishing?
What is 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
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page