> For the complete documentation index, see [llms.txt](https://docs.bdb.ai/data-pipeline-2/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bdb.ai/data-pipeline-2/getting-started/homepage/create/creating-a-new-job/python-job.md).

# Python Job

This feature allows users to write their own Python script and run their script in the ***Jobs*** section of ***Data Pipeline*** module.&#x20;

Before creating the ***Python Job***, the user has to create a project in the ***Data Science Lab*** module under ***Python Environment***. Please refer the below image for reference:&#x20;

<figure><img src="/files/epODb5ZbVwc7gM20xIT9" alt=""><figcaption><p><em><strong>Creating a Data Science Lab Project under Python Environment</strong></em></p></figcaption></figure>

After creating the Data Science project, the users need to activate it and create a Notebook where they can write their own Python script. Once the script is written, the user must save it and export it to be able to use it in the Python Jobs.

## **Creating a Python Job**

* Navigate to the ***Data Pipeline*** module homepage.&#x20;
* Click on the ***Create Job*** icon on the list pipeline page.&#x20;

<figure><img src="/files/DWqJyRRWdpLog6RvXeig" alt=""><figcaption><p><em><strong>The Create Job option</strong></em></p></figcaption></figure>

* The ***New Job*** dialog box appears redirecting the user to create a new Job.&#x20;
  * Enter a name for the new Job.&#x20;
  * Describe the Job (Optional).&#x20;
  * **Job Baseinfo:** Select Python Job from the drop-down.&#x20;
  * **Trigger By:** There are 2 options for triggering a job on success or failure of a job:&#x20;
    * **Success Job:** On successful execution of the selected job the current job will be triggered.
    * **Failure Job:** On failure of the selected job the current job will be triggered.&#x20;
  * **Is Scheduled?**&#x20;
    * A job can be scheduled for a particular timestamp. Every time at the same timestamp the job will be triggered.&#x20;
    * Job must be scheduled according to UTC.&#x20;
  * **Docker Configuration:** Select a resource allocation option using the radio button. The given choices are:&#x20;
    * **Low**&#x20;
    * **Medium**&#x20;
    * **High**
  * Provide the resources required to run the python Job in the limit and Request section.
    * **Limit:** Enter max CPU and Memory required for the Python Job.&#x20;
    * **Request:** Enter the CPU and Memory required for the job at the start. &#x20;
    * **Instances:** Enter the number of instances for the Python Job. &#x20;
  * Click the ***Save*** option to save the Python Job.

<figure><img src="/files/mmbFYeJw9aCWvr94BazK" alt=""><figcaption><p><em><strong>Creating a Python Job</strong></em></p></figcaption></figure>

* The Python Job gets saved, and it will redirect the users to the ***Job Editor*** workspace.&#x20;

<figure><img src="/files/ynE2lPwAwgaBfMTSvnK8" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
*Check out the below given demonstration configure a Python Job.*
{% endhint %}

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2Fi0LgI9FzK7qAnGWv8kNU%2F2023-05-03-13-45-17%20(online-video-cutter.com).mp4?alt=media&token=fae4b373-a0e9-4bc7-8b59-0a8d770060ae>" %}
***Configuring Python Job***
{% endembed %}

## **Configuring the Meta Information of Python Job**

Once the Python Job is created, follow the below given steps to configure the ***Meta Information*** tab of the Python Job.&#x20;

* **Project Name:** Select the same Project using the drop-down menu where the Notebook has been created.&#x20;
* **Script Name:** This field will list the exported Notebook names which are exported from the Data Science Lab module to Data Pipeline.&#x20;
* **External Library:** If any external libraries are used in the script the user can mention it here. The user can mention multiple libraries by giving comma (,) in between the names.&#x20;
* **Start Function:** Select the function name in which the script has been written.&#x20;
* **Script:** The Exported script appears under this space.&#x20;
* **Input Data:** If any parameter has been given in the function, then the name of the parameter is provided as Key, and value of the parameters has to be provided as value in this field. &#x20;

<figure><img src="/files/4uKhBb1Qrtm1Sg9FXYHH" alt=""><figcaption><p><em><strong>Meta Information tab</strong></em></p></figcaption></figure>
