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 Brainly
import asyncio
async def main():
questions = await Brainly().get_answers("Корень из 121", 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 tesseract and your language data for it.
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 Brainly
import asyncio
async def main():
query = OCR().recognize("image.png")["text"]
questions = await Brainly().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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.