# Exporting a Script From Data Science Lab

This feature enables users to export their written scripts from DS Lab notebook in order to use them in Pipeline and Jobs

{% hint style="warning" %}
_<mark style="color:orange;">**Prerequisite:**</mark> The user needs to create a project under the DS Lab module before using this feature._
{% endhint %}

{% embed url="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvmyGSlDvDj86v7eh3RHM%2Fuploads%2FYlUWLSV3LRcHiFFqRblU%2F2024-02-27-19-17-36%20(online-video-cutter.com).mp4?alt=media&token=a8e43817-dc62-45e3-bfb4-c90e6b9db512" %}
_**Exporting a Script from DS Lab notebook**_
{% endembed %}

**Follow the below-given steps to export a script from the DS Lab notebook:**

* Activate and open a project under the DS Lab module.
* The user can create or open the previously created notebook where the scripts have been written.
* Go to the Notebook options and click the _**Export**_ option.

<figure><img src="https://3157314867-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvmyGSlDvDj86v7eh3RHM%2Fuploads%2F0Mj5neaSbPc8sxeJKjk8%2Fimage.png?alt=media&#x26;token=2cf1bbe9-75c5-4644-83c5-1380967f73a6" alt=""><figcaption></figcaption></figure>

* The _**Export to Pipeline/Git**_ panel opens from the right side of the window; select Export to Pipeline option.
* Select the scripts using the check boxes to export them.
* Click the _**Next**_ option.&#x20;

<figure><img src="https://3157314867-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvmyGSlDvDj86v7eh3RHM%2Fuploads%2FhsencGVjvEIIcB0C91uL%2Fimage.png?alt=media&#x26;token=204b6e10-48a2-4964-848d-82eb68c007dd" alt=""><figcaption><p><em>Exporting a Script</em></p></figcaption></figure>

* Click the _**Validate**_ icon to validate the selected scripts.
*   The user can also export _**External Libraries**_ used in the project along with scripts.&#x20;

    * Click the _**External Libraries**_ ![](https://3157314867-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvmyGSlDvDj86v7eh3RHM%2Fuploads%2FYe9209FFlbm8YO1loG2H%2Fimage.png?alt=media\&token=89d68f31-9043-4f3c-bb89-41f0b1d30188)icon.&#x20;
    * The _**Libraries**_ panel opens. Select the necessary libraries to be exported along with the scripts.

    &#x20;      ![](https://3157314867-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvmyGSlDvDj86v7eh3RHM%2Fuploads%2F0TGK7SPk4bqtK4KKpk0T%2Fimage.png?alt=media\&token=d75a68b2-f085-4b97-93ea-134b20a389a6)
* A notification message appears to ensure the user for the validation of the script.

<figure><img src="https://3157314867-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvmyGSlDvDj86v7eh3RHM%2Fuploads%2FxbKZI8ydwn93iznWcmKX%2Fimage.png?alt=media&#x26;token=ce1d58d3-5a45-496b-9f88-7d53d9f143ba" alt=""><figcaption><p><em><strong>Validating the script while exporting</strong></em></p></figcaption></figure>

* After that, click on the _**Export to Pipeline**_ option, and the selected scripts will be exported along with the chosen external libraries.
* The user can use the exported scripts in the Pipeline, Jobs ([_**Python Job**_](creating-a-new-job/python-job), [_**PySpark Job**_](creating-a-new-job/pyspark-job)).

{% hint style="info" %}
_<mark style="color:green;">**Please Note:**</mark> Files with the  **.ipynb** extension can be exported to the pipelines and jobs for the further user, while those with the  **.py** extension can only be utilized as the utility files. Additional information on utility files can be found here:_ [_**Utility**_](https://app.gitbook.com/o/BHXEmSpD7W3xDgxnOIpk/s/vmyGSlDvDj86v7eh3RHM/~/changes/26/getting-started/homepage/create/utility)
{% endhint %}
