========
Projects
========

Projects contain all of the components needed to use or run an application. This includes relevant packages, channels, scripts, notebooks, files, environment variables, services and commands, and a core configuration file named ``anaconda-project.yml``. They provide a method to accurately reproduce your work and collaborate on it with other team members. Projects automate setup steps such as installing packages, downloading files, setting environment variables, and running commands. 

Use ``Anaconda Project`` to archive your project directory into a ``.tar.bz2``, ``.tar.gz``, or ``.zip`` file for portability purposes and to share with others. For more information, see the official `Anaconda Project documentation <https://anaconda-project.readthedocs.io/en/latest/>`_.

Package Security Manager enables you to upload and share Anaconda Project files within a channel. You can move, copy, and share your project with your team or provide authorized users access to the channel. 

.. _upload_project:

Uploading a project
===================

The process for preparing a project for upload differs depending on the project type. Please follow the relevant guide to prepare your project for upload before continuing:

  * `sdist and wheels <https://packaging.python.org/tutorials/packaging-projects/#generating-distribution-archives>`_
  * `cran <http://r-pkgs.had.co.nz/package.html>`_ 
  * `conda-build <https://docs.conda.io/projects/conda-build/en/latest/>`_ 

#. Log in to Package Security Manager. 
#. Select a channel that you want to upload a project to.
#. Open the |gear| **Manage** dropdown menu and select **Upload File**.
#. Open the **Type** dropdown menu and select **Anaconda Project**.
#. Click **Select files...** then locate and upload your project file, or drag and drop your project file into the field.
#. Click **Upload**.

   .. thumbnail:: ../img/as_upload_project.png
      :align: center

Downloading a project
=====================

To download a notebook from a channel or subchannel: 

#. From the channel or subchannel details page, select the **Projects** tab. 
#. Select a project to view its details page.
#. Click the project name to download it. 

.. thumbnail:: ../img/as_download_project.png       
   :align: center

Viewing project metadata
========================

From the project details page, click the |circle-info| information to view a file's metadata.

.. thumbnail:: ../img/as_project_metadata.png
   :align: center

Moving a project
================

#. From the channel or subchannel details page, select the **Projects** tab. 
#. Select the checkbox beside the projects you want to move. File management buttons appear at the top of the list. 
#. Click **Move # projects**. 
#. Open the **Move To:** dropdown menu and select a destination channel or subchannel for your project. 
#. Click **Move**.

.. note:: 
    
    Moving a project will remove it from its origin channel. 

Copying a project
-----------------
To copy a project from one channel or subchannel to another:

#. From the channel or subchannel details page, select the **Projects** tab. 
#. Select the checkbox beside the projects you want to copy. File management buttons appear at the top of the list.
#. Click **Copy # projects**.
#. Open the **Copy To:** dropdown menu and select a destination channel for your projects. 
#. Click **Copy**.

.. note:: 
    
    Copying a project will not remove it from its origin channel. 

Deleting a project
------------------

To delete a project from a channel or subchannel: 

#. From the channel or subchannel details page, select the **Projects** tab. 
#. Select the checkbox beside the projects you want to delete. File management buttons appear at the top of the list.
#. Click **Delete # projects**.
#. Click **Delete** to verify you want to delete your selected projects.

.. |circle-info| raw:: html

   <i class="fa-light fa-circle-info"></i>

.. |gear| raw:: html

    <svg class="inline" xmlns="http://www.w3.org/2000/svg" height="20" width="20" viewBox="0 0 512 512"><path d="M211.6 28.5c1.6-7.3 8.1-12.5 15.6-12.5h57.6c7.5 0 14 5.2 15.6 12.5l12.9 57.1c.6 2.6 2.5 4.8 5 5.7c17.9 6.8 34.5 16.4 49.1 28.4c2.1 1.7 4.9 2.2 7.4 1.4l56-17.4c7.1-2.2 14.9 .8 18.6 7.3L478.3 161c3.7 6.5 2.5 14.7-3 19.8l-43.1 39.8c-2 1.8-2.9 4.5-2.5 7.2c1.5 9.2 2.3 18.7 2.3 28.4s-.8 19.1-2.3 28.4c-.4 2.6 .5 5.3 2.5 7.2l43.1 39.8c5.5 5.1 6.7 13.3 3 19.8L449.4 401c-3.7 6.5-11.5 9.5-18.6 7.3l-56-17.4c-2.6-.8-5.4-.3-7.4 1.4c-14.6 11.9-31.2 21.6-49.1 28.4c-2.5 1-4.4 3.1-5 5.7l-12.9 57.1c-1.6 7.3-8.1 12.5-15.6 12.5H227.2c-7.5 0-14-5.2-15.6-12.5l-12.9-57.1c-.6-2.6-2.5-4.8-5-5.7c-17.9-6.8-34.5-16.4-49.1-28.4c-2.1-1.7-4.9-2.2-7.4-1.4l-56 17.4c-7.1 2.2-14.9-.8-18.6-7.3L33.7 351c-3.7-6.5-2.5-14.7 3-19.8l43.1-39.8c2-1.8 2.9-4.5 2.5-7.2C80.8 275.1 80 265.7 80 256s.8-19.1 2.3-28.4c.4-2.6-.5-5.3-2.5-7.2L36.7 180.7c-5.5-5.1-6.7-13.3-3-19.8L62.6 111c3.7-6.5 11.5-9.5 18.6-7.3l2.4-7.6-2.4 7.6 56 17.4c2.6 .8 5.4 .3 7.4-1.4c14.6-12 31.2-21.6 49.1-28.4c2.5-1 4.4-3.1 5-5.7l12.9-57.1zM227.2 0c-15 0-27.9 10.4-31.2 25L184 78c-16.7 6.8-32.2 15.8-46.1 26.7L85.9 88.5C71.6 84 56.2 90.1 48.7 103L19.9 153c-7.5 13-5 29.4 6 39.5l39.9 36.9C64.6 238.1 64 247 64 256s.6 17.9 1.8 26.6L25.9 319.5l5.4 5.9-5.4-5.9c-11 10.1-13.5 26.6-6 39.5L48.7 409c7.5 13 22.9 19 37.2 14.6l51.9-16.2c14 10.9 29.5 19.9 46.1 26.7l12 53c3.3 14.6 16.3 25 31.2 25h57.6c15 0 27.9-10.4 31.2-25l12-53c16.7-6.7 32.2-15.8 46.1-26.7l51.9 16.2c14.3 4.4 29.7-1.6 37.2-14.6L492.1 359c7.5-13 5-29.4-6-39.5l-39.9-36.9c1.2-8.7 1.8-17.6 1.8-26.6s-.6-17.9-1.8-26.6l39.9-36.9c11-10.1 13.5-26.6 6-39.5L463.3 103c-7.5-13-22.9-19-37.2-14.6l-51.9 16.2C360.2 93.7 344.7 84.7 328 78L316 25c-3.3-14.6-16.3-25-31.2-25H227.2zM192 256a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zm144 0a80 80 0 1 0 -160 0 80 80 0 1 0 160 0z"/></svg>