Metadata-Version: 2.4
Name: binaryninja-finder
Version: 0.3.0
Summary: Find and install Binary Ninja's Python API
License-Expression: MIT
License-File: LICENSE
Requires-Python: >=3.9
Project-URL: Issues, https://github.com/trailofbits/binaryninja-finder/issues
Project-URL: Source, https://github.com/trailofbits/binaryninja-finder
Description-Content-Type: text/markdown

# binaryninja-finder

Finds a local Binary Ninja installation so you can `import binaryninja` in Python. Running outside the GUI requires a [license that supports headless use](https://docs.binary.ninja/dev/batch.html).

## Usage

Add it to a project.

```console
uv add binaryninja-finder
```

Try it without adding a project dependency.

```console
uv run --with binaryninja-finder python -c 'import binaryninja; print(binaryninja.core_version())'
```

## Standalone script

Save this as `example.py`.

```python
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.10"
# dependencies = ["binaryninja-finder"]
# ///

import binaryninja

print(binaryninja.core_version())
```

Run the script with `uv`.

```console
uv run --script example.py
```

On systems that support shebangs, you can also run `chmod +x example.py` and then `./example.py`.

## Configuration

- Set `BN_INSTALL_DIR` to your Binary Ninja installation path if automatic discovery misses it.
- Set `BN_USER_DIRECTORY` if you use a custom Binary Ninja settings directory.

[MIT License](LICENSE)
