Позволяет шифровать и хранить файлы в облачном хранилище
Используется потоковое шифрование
Доступные хранилища:
- Yandex.Disk (sync/async)
- AWS S3 (sync/async)
Установка
Поддержка только яндекс диска
pip install encrypt-storage
С поддержкой AWS S3
pip install encrypt-storage[aws]
Пример
Синхронное использование
from encrypt_storage import YandexDiskStorage
# Замените 'YOUR_ACCESS_TOKEN' на ваш токен Яндекс.Диска
# Замените 'YOUR_ENCRYPTION_KEY' на ваш ключ шифрования
yandex_disk = YandexDiskStorage(
"YOUR_ACCESS_TOKEN",
"YOUR_ENCRYPTION_KEY",
)
# Пример загрузки и шифрования файла
local_file = "docker-compose.yaml"
remote_path = "docker-compose.yaml"
yandex_disk.upload_and_encrypt_file(local_file, remote_path)
# Пример дешифрования файла
decrypted_local_file = "docker-compose2.yaml"
yandex_disk.download_and_decrypt_file(remote_path, decrypted_local_file)
# Пример получения данных файлов
files = yandex_disk.list_files("/")
print(files)
Асинхронное использование
import asyncio
from encrypt_storage.asyncio import YandexDiskStorage
async def main():
# Замените 'YOUR_ACCESS_TOKEN' на ваш токен Яндекс.Диска
# Замените 'YOUR_ENCRYPTION_KEY' на ваш ключ шифрования
yandex_disk = YandexDiskStorage(
"YOUR_ACCESS_TOKEN",
"YOUR_ENCRYPTION_KEY",
)
# Пример загрузки и шифрования файла
local_file = "docker-compose.yaml"
remote_path = "docker-compose.yaml"
await yandex_disk.upload_and_encrypt_file(local_file, remote_path)
# Пример дешифрования файла
decrypted_local_file = "docker-compose2.yaml"
await yandex_disk.download_and_decrypt_file(remote_path, decrypted_local_file)
# Пример получения метаданных файлов
files = await yandex_disk.list_files("/")
print(files)
if __name__ == "__main__":
asyncio.run(main())
Metadata
Release files for encrypt-storage 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| encrypt_storage-0.2.3.tar.gz | 5.7 kB | Without provenance | Details for encrypt_storage-0.2.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| encrypt_storage-0.2.3-py3-none-any.whl | Python 3 | none | any | Details for encrypt_storage-0.2.3-py3-none-any.whl |
Total release size: 15.4 kB
Release files / encrypt_storage-0.2.3.tar.gz
| Download URL | encrypt_storage-0.2.3.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
951192f34327650fcf600a1e30040a8dcf9586899ba7f4bb2685498bdf0ef0c8
|
|
BLAKE2b-256 checksum How to use checksums |
9c5afc26c847807b01751262a94cfbcccf179dfc4ee4901e17affff0245a4382
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.10.2 Windows/10
|
Release files / encrypt_storage-0.2.3-py3-none-any.whl
| Download URL | encrypt_storage-0.2.3-py3-none-any.whl |
|---|---|
| Size | 9.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2e20c2370cc94eca833c17909aa0788833bfd61deb414bc78b9fc5f8bcb960ae
|
|
BLAKE2b-256 checksum How to use checksums |
ae8d933f96fb3f0863d9a70ccd302e4b90e7b1d4094db75b85050153525f08f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.10.2 Windows/10
|
Security for encrypt-storage 0.2.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.