Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,14 @@ All BirdNET data (models, benchmarks) is stored in the application-data director
- **macOS:** ``~/Library/Application Support/birdnet``
- **Windows:** ``%APPDATA%/birdnet``

The default location can be overridden by setting the ``BIRDNET_APP_DATA`` environment variable to any absolute path before the ``birdnet`` package is imported.::
Comment thread
Josef-Haupt marked this conversation as resolved.
Outdated

# Windows pre-execution script
set BIRDNET_APP_DATA=C:\Program Files\BirdNET-Analyzer\birdnet-data

# Linux / macOS pre-execution script
export BIRDNET_APP_DATA=/opt/birdnet-analyzer/birdnet-data

Why is Python 3.10 not supported?
^^^^

Expand Down
2 changes: 2 additions & 0 deletions src/birdnet/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@

PKG_NAME = "birdnet"

ENV_VAR_APP_DATA = "BIRDNET_APP_DATA"

# flag for "can be written to" = free
WRITABLE_FLAG = np.uint8(0)

Expand Down
4 changes: 4 additions & 0 deletions src/birdnet/utils/local_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from birdnet.globals import (
ACOUSTIC_MODEL_VERSIONS,
ENV_VAR_APP_DATA,
GEO_MODEL_VERSIONS,
MODEL_BACKEND_PB,
MODEL_BACKEND_TF,
Expand Down Expand Up @@ -38,6 +39,9 @@ def get_app_data_path() -> Path:


def get_birdnet_app_data_folder() -> Path:
override = os.getenv(ENV_VAR_APP_DATA)
if override is not None:
return Path(override)
Comment thread
Josef-Haupt marked this conversation as resolved.
Outdated
Comment thread
Josef-Haupt marked this conversation as resolved.
Outdated
Comment thread
Josef-Haupt marked this conversation as resolved.
Outdated
app_data = get_app_data_path()
result = app_data / PKG_NAME
return result
Expand Down
Loading