Parser of everything from the Russian reshebnik GDZ.RU
Project description
SudoGDZ
Parser of everything from the Russian reshebnik GDZ.RU
Install
To start, execute this command in command line
pip install sudogdz
Using and examples
Get books and copybooks from GDZ.ru
To start using you have to import sudogdz into your project
import sudogdz
Lets get a list of algebra textbooks for 7 Class and print textbook name and authors?
script.py
import sudogdz as gdz
schoolitems = (
gdz.getSchoolItems()
) # ["matematika", "english", "russkii_yazik", "algebra", ...]
for i in gdz.getBooks("books", schoolclass=7, schoolitem=schoolitems[3]):
print(f'{i["name"]}\n{i["class"]}')
Get information about book / copybook
To get information about the textbook, we need to call the getBooks function and select the desired item.
We can get information about the textbook such as name, url, authors, publish house, class and cover.
script.py
import sudogdz as gdz
schoolitems = (
gdz.getSchoolItems()
) # ["matematika", "english", "russkii_yazik", "algebra", ...]
booklist = gdz.getBooks("books", schoolclass=7, schoolitem=schoolitems[3])
book = booklist[3] # can be any number as you want.
print(
f"""
Имя: {book["name"]}
Ссылка: {book["url"]["with_domain"]}
Авторы: {",".join(book["authors"])}
Издательство: {book["pubhouse"]}
Обложка: {book["cover"]}
"""
)
Get task list for book / copybook
To get a list of tasks for a specific book, you need to take the URL of the book and call the getTasksForBook function
script.py
import sudogdz as gdz
books = gdz.getBooks("popularBooks")
book = books[6]
print(
gdz.getTasksForBook(book["url"]["without_domain"])
) # you could replace "without_domain" on "with_domain".
Get answers for book / copybook
To get a list of answers, you also need to take the book's URL and call the getAnswerForBook function. You can parse the response image.
script.py
import sudogdz as gdz
for answer in gdz.getAnswerForBook(
"https://gdz.ru/class-6/matematika/a-g-merzlyak/3-18/"
):
print(answer["png"]) # answer image.
Build from source
In order to build a library from source, you need to install some dependencies
pip install -r requirements.txt
Since the library uses flit to easily build the library, you need to enter the following command
flit build
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.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sudogdz-1.0.2.tar.gz.
File metadata
- Download URL: sudogdz-1.0.2.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.26.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c2a78a8404ea41fe6ae46863fdd9d77efe6d35a85b4ee18a9ce75a75f184bdd
|
|
| MD5 |
7f3dc5ad18e204b54b11bfc94010ac1f
|
|
| BLAKE2b-256 |
e66414d068f308baa1eb683cfa12b1ff9e1eb27557a326a18062a6c129f9a425
|
File details
Details for the file sudogdz-1.0.2-py3-none-any.whl.
File metadata
- Download URL: sudogdz-1.0.2-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.26.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7017882e35d5f497908036ab81c18b14fec83f665f37a26c76481a9a91da4b2d
|
|
| MD5 |
943fb112dc67586226b567e33b856c02
|
|
| BLAKE2b-256 |
048d8df2740462a1fbe2a9d8b84d3e5deebc907cd493e26d73d00341675d046e
|