Add files
The procedures in this article explain how to upload files into your workspaces and notebooks.
Procedures
Upload files into a workspace from Home page
The procedure adds files from your local file system to a selected workspace using the Home page interface.
From the left-hand menu of the Home page, select the workspace where you want to add your files.
Click the Import button in the upper right corner.
Select Upload files from the expanded list of options.
Use the file browser to select files for upload.
(Optional) If some of the selected files are notebooks, you will see the Import notebook dialog, which will suggest importing them as notebook. Select one of the options:
Import will import these files to the Notebooks section of the workspace.
Upload will upload these files to the Data section of the workspace.
Cancel will abort the upload process.
Results
Unless it's the default Private Workspace, the uploaded files are automatically attached to all of the workspace's notebooks. Private Workspace data files must be attached using the Attached data tool.
Upload a folder into a workspace from Home page
The procedure adds a folder from your local file system to a selected workspace using the Home page interface.
From the left-hand menu of the Home page, select the workspace where you want to upload your folder.
In the expanded workspace menu of the selected workspace, select Data from the left-hand menu.
Click the Import button in the upper right corner.
Select Upload folder from the expanded list of options.
Use the file browser to select and upload a folder.
In the confirmation dialog, click the Upload button.
(Optional) Select how you want to upload the files of the folder in the Import notebooks and files dialog. By default, Datalore will suggest importing notebooks to a new folder in the Notebooks section of the workspace, and the other files to a folder with the same name in the section. Switch the tabs to move between the two categories and do the following:
To exclude a file from the upload, deselect the respective checkbox.
To upload a notebook as a file in the Data section of the workspace, expand the list in the Import as column and select File.
Click the Upload button to finish the procedure.
Results
Unless it's the default Private Workspace, the uploaded folder is automatically attached to all of the workspace's notebooks. Private Workspace data folders must be attached using the Attached data tool.
If the uploaded folder contained both notebooks that you imported to the Not
Upload files as notebook attachments
The procedure adds files from your local file system or a URL to the attached data of a selected notebook. You can upload files:
As notebook files: they will be stored in the notebook attachments (/data/notebook_files directory).
As workspace files: they will be stored in the respective workspace attachments (/data/workspace_files directory)
Into an attached cloud storage: they will be stored in the cloud storage (/data/[cloud_storage_name] directory)
Open the Attached data from the left-hand sidebar of the editor.
Click the arrow next to the Upload files button for the required attached data source.
Use one of the options:
To upload individual files, select Upload files and use the file browser to select files to upload.
To upload a folder, select Upload folder and use the file browser to select a folder to upload.
Create files for notebook attachments
The procedure creates text-based files (CSV, TSV, and other formats) and attaches them to an attached data source of a notebook.
Open the Attached data tool from the left-hand sidebar of the editor.
Click the attached data source where you want to create a file.
Click the New file icon on the toolbar in the upper left corner of the list.
Alternatively, you can right-click anywhere in the list area and select New file from the popup menu. The new file is added to the list.
Provide a name for the new file and specify its extension. You can create any text-based file (CSV, TSV, and other formats).
To open and edie the file in the text editor, double-click it. The changes that you make are saved automatically every ten seconds or on the explicit ⌘+S action.
Quick file upload
This is the quickest way to add a file to your notebook and start using it in the code:
Drag a file from your file system and drop it anywhere in the editor.
To refer to the file in your code, use the file name.
For example, the code below uses a file called 'libraries_by_python_version.csv'.
libraries = pd.read_csv('libraries_by_python_version.csv') libraries
Results and further actions
If added to a specific notebook, the new files are only available inside this notebook.
If added to a workspace other than the default Private Workspace, the new files are available inside all notebooks residing in this workspace. be attached to any notebook from this workspace.
If added to the default Private Workspace, the new files can be available inside any notebook residing in this workspace once attached to it.
Keywords
upload files, attach files, add files, data sources, data, data files, notebook attachments