# Writers

The Data Science Lab provides writers tab to write the output of the data science experiments.

{% hint style="success" %}
*Check out the given illustration on how use the Writers operation inside the Notebook.*
{% endhint %}

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBLGYLEkBUnc8nVEBAuEI%2Fuploads%2F1aOd5fe81xHojQaeq5U0%2FPython%20Data%20Writers.mp4?alt=media&token=5bcf6dc0-2d5c-42d8-ab5f-03b7846448a0>" %}
***Using Writers inside Notebook***
{% endembed %}

* The user can run a code cell with dataset details.
* Run the cell.&#x20;

<figure><img src="https://content.gitbook.com/content/1QeOywZjV1cHo55cMW8u/blobs/SecrN7zA1TCkcBKSfo1U/image.png" alt=""><figcaption></figcaption></figure>

* The preview of the dataset appears below.

<figure><img src="https://content.gitbook.com/content/1QeOywZjV1cHo55cMW8u/blobs/wlh1NGN7r3PesVcfNmAp/image.png" alt=""><figcaption></figcaption></figure>

* Click the ***Secrets*** tab to get the registered DB secrets.
* Select a registered DB secret keys from the given filter option under the ***Secrets*** tab.
* Add new code cell.&#x20;
* Get the Secrets keys of the DB in it by using the checkboxes provided for the listed Secret keys.&#x20;
* Add a new code cell.
* Check the authorization of the DB by running the cell.

<figure><img src="https://content.gitbook.com/content/1QeOywZjV1cHo55cMW8u/blobs/Pa1xOeizCv1vA59uNb5q/image.png" alt=""><figcaption></figcaption></figure>

* Add a new code cell.
* Open the Writers section.
* Use the given checkbox to select a driver type for the writers.
* The code get added to the newly added cell.

<figure><img src="https://content.gitbook.com/content/1QeOywZjV1cHo55cMW8u/blobs/oZxMDHuHwAyJNcd4nMb8/image.png" alt=""><figcaption></figcaption></figure>

* Provide the Secret values for the required information of the writer such as  Username, Password, Host, Port.&#x20;

<figure><img src="https://content.gitbook.com/content/1QeOywZjV1cHo55cMW8u/blobs/p03udWiMywbr2DhOIca3/image.png" alt=""><figcaption></figcaption></figure>

* Also provide the authenticated database, table name and data frame to write the chosen data.

<figure><img src="https://content.gitbook.com/content/1QeOywZjV1cHo55cMW8u/blobs/2MlD899lauvJZfvZpHeN/image.png" alt=""><figcaption></figcaption></figure>

* Run the code cell with the modified databased details.
* A message appears below stating that the DataFrame has been written to the database. The data gets written to the specified database.

<figure><img src="https://content.gitbook.com/content/1QeOywZjV1cHo55cMW8u/blobs/dur3enIVVKuPJ5dpsQBf/image.png" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
*<mark style="color:green;">Please Note:</mark>* *Refer the* [***Data Science Lab Quick Start Flow***](https://docs.bdb.ai/data-science-lab-4/data-science-lab-quick-start-flow) *page to get an overview of the **Data Science Lab** module in nutshell.*&#x20;
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bdb.ai/data-science-lab-4/project/tabs-for-a-data-science-lab-project/tabs-for-tensorflow-and-pytorch-environment/notebook/notebook-page/notebook-operations/writers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
