Connecting to Yandex Disk
Written by
Updated at August 15, 2025
You can connect to Yandex Disk
Getting started
Open the DataSphere project:
-
Select the project in your community or on the DataSphere home page
in the Recent projects tab. - Click Open project in JupyterLab and wait for the loading to complete.
- Open the notebook tab.
Importing the contents from a file on Yandex Disk to a DataSphere project file
-
Go to a new cell and paste the command to import the contents from a file on Yandex Disk:
# %pip install requests urllib if needed import requests from urllib.parse import urlencode base_url = 'https://cloud-api.yandex.net/v1/disk/public/resources/download?' public_key = '<link_to_file_on_Yandex_Disk>' final_url = base_url + urlencode(dict(public_key=public_key)) response = requests.get(final_url) download_url = response.json()['href'] response = requests.get(download_url) dist_path = '<path_to_file_in_project>' with open(dist_path, 'wb') as f: f.write(response.content)Where:
<link_to_file_on_Yandex_Disk>: Link to the Yandex Disk file whose contents you need to import to DataSphere. To get the link, right-click the file and select Share ⟶ Copy link.<path_to_file_in_project>: Path to the DataSphere project file to import data to. To get the path, right-click the file and select Copy path.
-
Run the cell by selecting Run → Run Selected Cells or pressing Shift + Enter.
Importing the contents from a folder on Yandex Disk to a DataSphere project folder
-
Go to a new cell and paste the command to import the contents from a folder on Yandex Disk:
# %pip install requests urllib if needed import requests from urllib.parse import urlencode from io import BytesIO from zipfile import ZipFile base_url = 'https://cloud-api.yandex.net/v1/disk/public/resources/download?' public_key = '<link_to_folder_on_Yandex_Disk>' final_url = base_url + urlencode(dict(public_key=public_key)) response = requests.get(final_url) download_url = response.json()['href'] response = requests.get(download_url) dist_path = '<path_to_folder_in_project>' zipfile = ZipFile(BytesIO(response.content)) zipfile.extractall(path=dist_path)Where:
<link_to_folder_on_Yandex_Disk>: Link to the Yandex Disk folder whose contents you need to import to DataSphere. To get the link, right-click the folder and select Share ⟶ Copy link.<path_to_folder_in_project>: Path to the DataSphere project folder to import data to. To get the path, right-click the folder and select Copy path.
-
Run the cell.