> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cognite.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Setting up NEAT

> Step-by-step guide to install NEAT in CDF Notebooks or locally with Jupyter Lab.

NEAT is distributed as a Python package and is used primarily in notebook environments such as Jupyter Notebooks or [CDF Notebooks](https://fusion.cogniteapp.com/).

## CDF Notebooks environment

CDF Notebooks provide a straightforward way to get started with NEAT, even if you have **no coding experience**.

<Info>
  **Prerequisites**: A CDF account with access to the **Data fusion** workspace and **Build solutions**.
</Info>

<Steps>
  <Step title="Open CDF and launch a notebook">
    Navigate to [Cognite Data Fusion](https://fusion.cogniteapp.com/), sign in, and select the **Data fusion** workspace. In the left menu, select **Build solutions**, then **Jupyter Notebooks**, and launch a new notebook.
  </Step>

  <Step title="Install cognite-neat">
    Run `%pip install cognite-neat` in a cell.
  </Step>

  <Step title="Import and start using NEAT">
    Import `NeatSession` and `CogniteClient` and start using NEAT as shown below.
  </Step>
</Steps>

```python wrap theme={"languages":{"custom":["/_languages/kuiper.json","../_languages/kuiper.json"]}}
from cognite.neat import NeatSession

neat = NeatSession(None)

# Start using neat by typing neat.<TAB>
```

## Local Notebook environment

Running NEAT locally requires Python 3.10 or later and a notebook environment. The steps below use [Jupyter Lab](https://jupyter.org/install).

<Info>
  **Prerequisites**: Installed Python 3.10 or later. See [python.org](https://www.python.org/downloads/).
</Info>

<Steps>
  <Step title="Create directory and virtual environment">
    Create a project directory and navigate into it. Create and activate a virtual environment.
  </Step>

  <Step title="Install cognite-neat and Jupyter Lab">
    Install `cognite-neat`, `jupyterlab`, and `tqdm` for progress bars.
  </Step>

  <Step title="Start Jupyter Lab">
    Run `jupyter lab` to start your notebook environment.
  </Step>
</Steps>

<Tabs>
  <Tab title="Windows">
    ```bash theme={"languages":{"custom":["/_languages/kuiper.json","../_languages/kuiper.json"]}}
    mkdir neat && cd neat
    python -m venv venv
    venv\Scripts\activate.bat
    pip install cognite-neat
    pip install jupyterlab
    pip install tqdm
    jupyter lab
    ```
  </Tab>

  <Tab title="Mac/Linux">
    ```bash theme={"languages":{"custom":["/_languages/kuiper.json","../_languages/kuiper.json"]}}
    mkdir neat && cd neat
    python -m venv venv
    source venv/bin/activate
    pip install "cognite-neat[pyoxigraph]"
    pip install jupyterlab
    pip install tqdm
    jupyter lab
    ```
  </Tab>
</Tabs>

In a notebook cell, import `NeatSession` and `get_cognite_client` and start using NEAT as shown below:

```python wrap theme={"languages":{"custom":["/_languages/kuiper.json","../_languages/kuiper.json"]}}
from cognite.neat import NeatSession, get_cognite_client

client = get_cognite_client(".env")

neat = NeatSession(client)

# Start using neat by typing neat.<TAB>

# Reading of a physical data model from CDF CDM

neat.physical_data_model.read.cdf("cdf_cdm", "CogniteCore", "v1")
```

<Tip>
  The `get_cognite_client` helper reads environment variables from a `.env` file and creates a `CogniteClient` instance. This is a common pattern when working with CDF through Python. If you don't have a `.env` file, the function prompts you to enter environment variables interactively and offers to save them. You can also instantiate `CogniteClient` directly if you prefer.
</Tip>

## Further reading

* [Data modeling principles](/cdf/deploy/neat/data_modeling/principles)
* [NeatSession reference](/cdf/deploy/neat/reference/session)
* [Introduction to NEAT v1](/cdf/deploy/neat/tutorials/introduction)
