Yandex.disk HTTP API Python library
Get your access token [here](https://tech.yandex.ru/disk/api/concepts/quickstart-docpage/)
Example usage:
import yadisk_api
disk = yadisk_api.YandexDisk('my_token')
# get info about my disk
info = disk.get_disk_info()
# get meta info about file/directory in my app directory/trash
meta_info = disk.get_meta_info(
path='path/to/my/file.jpg',
preview_size='100x100',
)
# get audio files list in my disk
files_info = disk.get_files_list(
limit=50,
media_type='audio',
)
# get last uploaded files list
last_uploaded = disk.get_last_uploaded(
limit=10,
media_type='video',
)
# set meta data to file in your app directory
setted_result = disk.set_meta_to_resource(
'my/file/to/extra/meta/data.txt,
data={'Custom Header': 'custom value'},
)
# upload file to yandex disk
with open('/path/to/my/file.txt', 'rb') as f:
disk.upload_file(
f,
path='app:/directory/file.txt',
overwrite=True
)
# upload file to disk by url
disk.upload_file_from_url(
'http://example.com/sitemap.xml',
path='app:/sitemap_example.xml',
)
# download file content from yandex.disk
content = disk.download_file(
'app:/sitemap_example.xml',
stream=False,
)
# copy resource in disk
disk.copy_resource(
from_path='app:/sitemap_example.xml',
to_path='app:/sitemap_example_copy.xml',
)
# move resource in your disk
disk.move_resource(
from_path='app:/sitemap_example_copy.xml',
to_path='app:/sitemap_example_movied_copy.xml',
)
# delete resource
disk.delete_resource(
'app:/sitemap_example_movied_copy.xml',
permanently=False, # to trash
)
# create folder in your disk
disk.create_folder(
'app:/new_folder',
)
# publish
disk.publish_resource('app:/new_folder')
# unpublish
disk.unpublish_resource('app:/new_folder')
# fully empty trash
disk.empty_trash()
# or remove file from trash
disk.empty_trash('app:/sitemap_example_movied_copy.xml')
# restore resource from trash
disk.restore_from_trash('app:/sitemap_example_movied_copy.xml')
Metadata
Release files for yadisk-api 1.0
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 |
|---|---|---|---|---|
| yadisk-api-1.0.tar.gz | 5.3 kB | Without provenance | Details for yadisk-api-1.0.tar.gz |
Release files / yadisk-api-1.0.tar.gz
| Download URL | yadisk-api-1.0.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6ef22d7c88e1bde27286d02039df530d38ea703b3a043a6247fcc574ff80dd63
|
|
BLAKE2b-256 checksum How to use checksums |
3da66b763f9708085676ec0eb4acc5b07d920d2d26bef557b96ba438680429a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for yadisk-api 1.0
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.