Набор модулей для работы с таблицами Synology
Процесс установки
pip install synodrivekit
Как пользоваться
Импорт и создание класса
import synodrivekit
drive_client = synodrivekit.DriveConnectorShared()
Подключение через расшаренную ссылку
link = 'https://drive.domain.ru/d/s/34fr90wj23/afkj31'
drive_client.login_shared(link)
Подключение через логин и пароль, даже если включен двухфактор
str_login_drive = 'name.surname@domain.ru'
str_password_drive = '*parol123*'
link = 'https://drive.domain.ru/oo/r/34fr90wj23'
drive_client.login_mfa(link, str_login_drive, str_password_drive)
Что можно:
Посмотреть логи подключения через вебсокет
drive_client.logs
Посмотреть список таблиц
drive_client.list_tables()
Посмотреть содержимое таблицы (может работать нестабильно)
drive_client.get_table('Таблица1')
Почистить таблицу (может работать нестабильно)
drive_client.clear_table('Таблица1')
Создать таблицу (из-за особенностей драйва нельзя сразу задать название таблицы)
drive_client.create_table()
Переименовать таблицу
drive_client.rename_table('Таблица2', 'Таблица 2')
Удалить таблицу
drive_client.del_table('Таблица 2')
Записать датафрейм таблицу (скопируем содержимое Таблица1 в Таблица 2)
df = drive_client.get_table('Таблица1').copy()
drive_client.write_to_table(df, 'Таблица 2')
Отправлять собственные команды (посмотреть примеры можно в режиме разрабочика, найдя нужное сообщение в вебсокете)
drive_client.send_cmd('425["set",{"cmd": "worksheet.create", "titleTpl": "Таблица{0}"}]')
Записать в строку 3 столбца 38 (в обоих случаях отсчет начинается с нуля) значение 123
drive_client.send_cmd('423["set",{"cmd":"value","id":"sh_1","changes":[[' + str(3) + ',' + str(38) + ',' + str(123) + ']],"nfRefs":[0],"nfs":[],"rev":1}]')
Metadata
Release files for synodrivekit 1.4.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| synodrivekit-1.4.3-py3-none-any.whl | Python 3 | none | any | Details |
Release files / synodrivekit-1.4.3-py3-none-any.whl
| Download URL | synodrivekit-1.4.3-py3-none-any.whl |
|---|---|
| Size | 9.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
978a63eb7f898a25ef0ee4b1453d3d86131b8345f739498210c7fc882dfe3a3a
|
|
BLAKE2b-256 checksum How to use checksums |
131a0677f76c69955a0dca1ec384cb03a671a00d755f602340c7b3d94bfc5cbd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.7
|
Security for synodrivekit 1.4.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.