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

# Python Package

`ntop-core` is a Pythonic, NumPy-native wrapper around the nTop Core engine, built with [nanobind](https://github.com/wjakob/nanobind). It replaces the raw `ctypes` marshalling shown in the [Python Examples](/Product-Documentation/ntop-core/examples/python) with a package you `pip install` and `import ntop.core`.

```python theme={null}
>>> import numpy as np
>>> points = np.array([[0.0, 0.0, 0.0], [0.01, 0.0, 0.0], [0.02, 0.0, 0.0]])

>>> import ntop.core as ntc
>>> body = ntc.load("assets/sphere.implicit")
>>> body.field(points)
array([-0.005,  0.005,  0.015])
```

<Note>ntop-core-python is currently in beta. Breaking changes may occur between any two versions.</Note>

## Installation

ntop-core-python runs on Python 3.10+. It is not published on PyPI; download it from [app.ntop.com/addons](https://app.ntop.com/addons). If you have received a copy of nTop Core with `python_packages`, run:

```shell theme={null}
pip install --follow-links ./python_packages/ ntop-core
```

## Locating the ntop\_core library

At import time, `ntop.core` needs to find the `ntop_core` shared library (`ntop_core.dll` on Windows; on Linux, the highest-versioned `libntop_core.so.<version>` if one is present, otherwise the bare `libntop_core.so`). It searches, in order:

1. The `NTOP_CORE_LIB` environment variable, if set, must point directly at the library file.
2. A directory bundled alongside the package itself.
3. `$CONDA_PREFIX` (when running inside a conda environment).
4. The Windows Registry (`InstallLocationNtopCore` under `HKLM\SOFTWARE\nTopology\nTopology`).
5. The default nTopology install path: `%PROGRAMFILES%\nTopology\nTopology\ntop_core.dll` on Windows (defaults to `C:\Program Files\nTopology\nTopology\ntop_core.dll`), or `/opt/nTopology/nTopology/libntop_core.so` on Linux.
6. The `ntopcl` default install root (Linux only): `/usr/local/ntop/nTop`.
7. The platform's standard dynamic-linker search (`ldconfig` / `PATH` / `LD_LIBRARY_PATH`).

To point at a specific copy of the library, set `NTOP_CORE_LIB` before importing `ntop.core`:

```shell theme={null}
# Windows
$env:NTOP_CORE_LIB = "C:\Downloads\nTop-Core-SDK\lib\ntop_core.dll"

# Linux
export NTOP_CORE_LIB=/path/to/nTop-Core-SDK/lib/libntop_core.so
```

Set `NTOP_DEBUG_LIBRARY_LOAD=1` to log each discovery step to stderr, which is useful for diagnosing why the wrong library (or none) was found.

Once loaded, `ntop.core.__version__` reports the version of the `ntop_core` library that was actually picked up by discovery. This is the library's own version, not the version of nTop that created any particular `.implicit` file.

## Units

As with the rest of nTop Core, all coordinates, distances, and field values are in **meters**. Convert from your application's native units before querying.

## Next steps

* Follow the [Quickstart](/Product-Documentation/ntop-core/python-package/quickstart) for a runnable, end-to-end walkthrough of every operation.
* See the [API Reference](/Product-Documentation/ntop-core/python-package/api-reference) for every method, type, and exception exposed by the package.
