.. index:: install, pip, clone, git, datalab-client .. sectionauthor:: Robert Nikutta .. _sec_InstallDataLab: **************** Install Data Lab **************** You can install the Data Lab client interfaces and the command line tool easily on your computer. There are several methods. All assume that you already have a working Python installation on your system (we recommend the `Anaconda distribution `_, since it comes with all Python packages that most users with ever need, and is very easy to install). .. _sec_pipinstall: Install using pip ================= The simplest way to install the Data Lab client interfaces and the command line tool is with pip: .. code-block:: python pip install --upgrade noaodatalab You should now be able to execute the datalab command from anywhere on your system: .. code-block:: python datalab help The installation will also enable you to import the various Data Lab client interfaces and helpers in your own Python programs. For instance, in a Python or Ipython session: .. code-block:: python :linenos: # this is for Python 3 from dl import authClient as ac, queryClient as qc from dl.helpers.utils import convert from getpass import getpass token = ac.login(input('Enter user name: '),getpass('Enter password: ')) # obtain authentication token query = 'SELECT ra,dec FROM smash_dr1.exposure LIMIT 100' # SQL query string result = qc.query(token,query) # your query result as a CSV-formatted string df = convert(result,'pandas') # result as a Pandas data frame .. _sec_gitclone: Clone directly from Data Lab's github repository ================================================ If you have ``git`` installed on your system, you can simply clone the Data Lab client interfaces and the command line tool from the Data Lab github repository: .. code-block:: python git clone https://github.com/noaodatalab/datalab.git This will create a directory ``datalab-client/`` in the current directory. You can then change to to it, and run the installation: .. code-block:: python cd datalab/ python setup.py install Then you should be able to use the datalab command line tool and the Python interfaces in the same manner as describen in the :ref:`pip install ` section above. You can also visit the `github repository `_ online.