-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,53 @@ | ||
# Petersburgedu wrap | ||
This module is designed for work with petersburgedu internal API. | ||
This module is designed for work with petersburgedu internal API. | ||
|
||
## English | ||
### Work in progress | ||
|
||
## Русский(Russian) | ||
### Работа в процессе | ||
|
||
### Быстрый старт | ||
Для быстрого старта в моей библиотеке вы можете воспользоваться минимальным кодом | ||
|
||
|
||
```python | ||
import petersbugredu_wrap | ||
import logging | ||
# Импорт необходимых библиотек | ||
logging.basicConfig(level=logging.DEBUG) # Настройка логирования | ||
|
||
|
||
client = petersbugredu_wrap.client.Client() # Создание клиента | ||
client.login_by_token("Ваш токен") # Вход в систему через токен | ||
|
||
children = client.get_child_list() # Получить список детей | ||
|
||
education_id = children[0].education_id # Получить ученический id у ребенка | ||
|
||
teachers = client.get_teacher_list(education_id) # Получение списка учителей | ||
for teacher in teachers: | ||
print(f"Имя: {teacher.firstname}, Фамилия: {teacher.surname}, Занимаемая должность: {teacher.position_name}") | ||
``` | ||
|
||
Как альтернатива логина через токен, который можно получить на сайте петербургского образования можно использовать логин по почте и паролю | ||
|
||
```python | ||
import petersbugredu_wrap | ||
import logging | ||
# Импорт необходимых библиотек | ||
logging.basicConfig(level=logging.DEBUG) # Настройка логирования | ||
|
||
|
||
client = petersbugredu_wrap.client.Client() # Создание клиента | ||
client.login(login="Ваша почта", password="Ваш пароль") # Вход в систему через токен | ||
|
||
children = client.get_child_list() # Получить список детей | ||
|
||
education_id = children[0].education_id # Получить ученический id у ребенка | ||
|
||
teachers = client.get_teacher_list(education_id) # Получение списка учителей | ||
for teacher in teachers: | ||
print(f"Имя: {teacher.firstname}, Фамилия: {teacher.surname}, Занимаемая должность: {teacher.position_name}") | ||
``` | ||
#### Полная документация будет написана позже |