Read Box files in Deepnote
Box is a popular cloud file manager, an alternative to Google Drive, Dropbox, or Microsoft OneDrive. In Deepnote, there is no native integration with Box (similar to Google Drive), however, you can use few lines of code to access your files and work with them directly.
First, you need to install boxsdk libraries.
You can use the built-in Environment variables integration in Deepnote, to store your Box-related secrets securely. You can follow the Boxsdk Getting Started tutorial to create your secrets to access Box API. Then you can follow along and create a Client instance and access your files.
Let's say we're interested in our CSV files in Box, but you can use similar code to access different types of files (like Excel, JSON, or imagery). The following block will download all CSV files to your Deepnote filesystem.
Downloading 'addresses.csv' to Deepnote filesystem
And finally, you can use the good old pandas function to load the CSV data into a DataFrame!