.. sectionauthor:: Alice Jacques , Robert Nikutta *Version: 20220215* .. index:: single: Upload data .. _sec_UploadExternalData: ******************************** Upload External Data to Data Lab ******************************** .. contents:: :local: You may often find yourself wanting to analyze some data that you have together with large datasets that are available at Data Lab. It is then useful to upload your data file(s) to your Data Lab account. This can be achieved in various ways. Note that in order to use the datalab command line client, you must install it first with: ``pip install --ignore-installed --no-cache-dir astro-datalab`` Upload into your VOSpace ======================== Using the datalab command line client (DCLC) -------------------------------------------- For a file ``foo.csv`` locally stored on your computer, you can upload it to your VOSpace storage with the ``datalab put`` function: :: > datalab put fr="./foo.csv" to="vos://foo.csv" Upload into your notebooks space ================================ Using the Jupyter dashboard --------------------------- To upload your data to a Jupyter notebook, simply select the Upload button in the upper left corner (circled in red in the screenshot below) and choose your file. .. figure:: ED1.png :scale: 50 % :alt: In a Jupyter notebook, registered users can import their local file to VOSpace using the ``storeClient.put`` function: :: > from dl import authClient as ac, queryClient as qc, storeClient as sc > sc.put('./foo.csv','vos://foo') (1 / 1) ./foo.csv -> vos://foo ['OK'] Similarly, registered users can import their local table to MyDB using the ``queryClient.mydb_import`` function: :: > qc.mydb_import('foo','./foo.csv') 'OK' Upload into your personal MyDB database ======================================= Using the datalab command line client & ingest capability --------------------------------------------------------- For a table ``foo.csv`` locally stored on your computer, you can upload it to your MyDB database with the ``datalab mydb_import`` function: :: > datalab mydb_import table="foo" data="./foo.csv" For more datalab command line functions, see our page :ref:`The datalab Command `.