Installation#
NEAT is distributed as a Python package. It is used primarily in a notebook environment such as, for example, Jupyter Notebooks. Another notebook environment is the CDF notebooks. Though, you will be soon able to plug NEAT to CDF Toolkit, which will then leverage neat for CDF data modeling.
CDF Notebooks Environment#
CDF Notebooks are a part of the Cognite Data Fusion (CDF) platform. These notebooks are a great way to get started with NEAT, even if you have no coding experience.
- Go to Cognite Data Fusion
- Login to your account
- Ensure you have selected the
Data Managementworkspace. - Select
Build solutionsin your left menubar. - Click on
Jupyter Notebooksunder the expandedBuild solutionsmenu. - Launch a new notebook.
- Install
cognite-neatby running%pip install cognite-neatin a cell. - Import
NeatSessionandCogniteClientand start using it as shown below
from cognite.client import CogniteClient
from cognite.neat import NeatSession
client = CogniteClient()
neat = NeatSession(client)
# Start using neat by typing neat.<TAB>
Local Notebook Environment#
Running neat locally requires a Python environment as well as a notebook environment. The following steps will
guide you through the installation process using Jupyter Lab as the notebook environment.
Prerequisites: Installed Python 3.10 or later, see python.org
- Create and enter directory for
neatinstallation - Create a virtual environment:
- Activate your virtual environment
- Install
cognite-neat - Install a notebook environment,
pip install jupyterlab - Install tqdm for progress bars,
pip install tqdm - Start your notebook environment,
jupyter lab - Import
NeatSessionandget_cognite_clientand start using it
In a notebook cell, you can now import NeatSession and get_cognite_client and start using it as shown below
from cognite.neat import NeatSession, get_cognite_client
client = get_cognite_client(".env")
neat = NeatSession(client)
# Start using neat by typing neat.<TAB>
Helper get_cognite_client function
The get_cognite_client function is a helper function that reads the environment variables from a .env file
and creates a CogniteClient instance. This is a common pattern when working with Cognite Data Fusion through
Python. Note that if you don't have a .env file, it will prompt you to enter environment variables
interactively and offer to save them to a .env file. You can instantiate a CogniteClient instance directly
if you prefer.