{
  "name": "ndev-settings",
  "display_name": "ndev settings",
  "visibility": "public",
  "icon": "",
  "categories": [],
  "schema_version": "0.2.1",
  "on_activate": null,
  "on_deactivate": null,
  "contributions": {
    "commands": [
      {
        "id": "ndev-settings.make_settings_container",
        "title": "Make Settings Container",
        "python_name": "ndev_settings._settings_widget:SettingsContainer",
        "short_title": null,
        "category": null,
        "icon": null,
        "enablement": null
      }
    ],
    "readers": null,
    "writers": null,
    "widgets": [
      {
        "command": "ndev-settings.make_settings_container",
        "display_name": "ndev Settings",
        "autogenerate": false
      }
    ],
    "sample_data": null,
    "themes": null,
    "menus": {},
    "submenus": null,
    "keybindings": null,
    "configuration": []
  },
  "package_metadata": {
    "metadata_version": "2.4",
    "name": "ndev-settings",
    "version": "0.4.2",
    "dynamic": [
      "license-file"
    ],
    "platform": null,
    "supported_platform": null,
    "summary": "Reusable settings and customization widget for the ndev-kit",
    "description": "# ndev-settings\n\n[![License BSD-3](https://img.shields.io/pypi/l/ndev-settings.svg?color=green)](https://github.com/ndev-kit/ndev-settings/raw/main/LICENSE)\n[![PyPI](https://img.shields.io/pypi/v/ndev-settings.svg?color=green)](https://pypi.org/project/ndev-settings)\n[![Python Version](https://img.shields.io/pypi/pyversions/ndev-settings.svg?color=green)](https://python.org)\n[![tests](https://github.com/ndev-kit/ndev-settings/workflows/tests/badge.svg)](https://github.com/ndev-kit/ndev-settings/actions)\n[![codecov](https://codecov.io/gh/ndev-kit/ndev-settings/branch/main/graph/badge.svg)](https://codecov.io/gh/ndev-kit/ndev-settings)\n[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/ndev-settings)](https://napari-hub.org/plugins/ndev-settings)\n[![npe2](https://img.shields.io/badge/plugin-npe2-blue?link=https://napari.org/stable/plugins/index.html)](https://napari.org/stable/plugins/index.html)\n[![Copier](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-purple.json)](https://github.com/copier-org/copier)\n\nReusable settings and customization widget for the ndev-kit\n\n----------------------------------\n\nThis [napari] plugin was generated with [copier] using the [napari-plugin-template] v1.1.0.\n\n<!--\nDon't miss the full getting started guide to set up your new package:\nhttps://github.com/napari/napari-plugin-template#getting-started\n\nand review the napari docs for plugin developers:\nhttps://napari.org/stable/plugins/index.html\n-->\n\n## Installation\n\nYou can install `ndev-settings` via [pip]:\n\n```\npip install ndev-settings\n```\n\nIf napari is not already installed, you can install `ndev-settings` with napari and Qt via:\n\n```\npip install \"ndev-settings[all]\"\n```\n\n\nTo install latest development version :\n\n```\npip install git+https://github.com/ndev-kit/ndev-settings.git\n```\n\n## Use with external libraries\n\nExternal libraries can provide their settings in YAML format with the same structure as your main `ndev_settings.yaml`.\n\n**Step 1**: Create a YAML file in the external library (e.g., `ndev_settings.yaml`):\n\n```yaml\nndevio_reader:\n  preferred_reader:\n    default: bioio-ome-tiff\n    dynamic_choices:\n      fallback_message: No readers found\n      provider: bioio.readers\n    tooltip: Preferred reader to use when opening images\n    value: bioio-ome-tiff\n  scene_handling:\n    choices:\n    - Open Scene Widget\n    - View All Scenes\n    - View First Scene Only\n    default: Open Scene Widget\n    tooltip: How to handle files with multiple scenes\n    value: View First Scene Only\n  clear_layers_on_new_scene:\n    default: false\n    tooltip: Whether to clear the viewer when selecting a new scene\n    value: false\n\nndevio_export:\n  canvas_scale:\n    default: 1.0\n    max: 100.0\n    min: 0.1\n    tooltip: Scales exported figures and screenshots by this value\n    value: 1.0\n  override_canvas_size:\n    default: false\n    tooltip: Whether to override the canvas size when exporting canvas screenshot\n    value: false\n  canvas_size:\n    default: !!python/tuple\n    - 1024\n    - 1024\n    tooltip: Height x width of the canvas when exporting a screenshot\n    value: !!python/tuple\n    - 1024\n    - 1024\n```\n\n**Step 2**: Register the entry point in `pyproject.toml`:\n\n```toml\n[project.entry-points.\"ndev_settings.manifest\"]\nndevio = \"ndevio:ndev_settings.yaml\"\n```\n\n**Step 3**: Use the autogenerated widget in napari!\n\n![external settings contributed automatically to the ndev-settings widget](./resources/widget.png)\n\n## Usage Example\n\n```python\nfrom ndev_settings import get_settings\n\nsettings = get_settings()\n\n# Access settings from main file\nprint(settings.Canvas.canvas_scale)\n\n# Access settings from external libraries (if installed)\nprint(settings.Reader.preferred_reader)  # From ndevio\nprint(settings.Export.compression_level)  # From ndevio\n\n# Modify and save settings\nsettings.Canvas.canvas_scale = 2.0\nsettings.save()  # Persists across sessions\n\n# Reset to defaults\nsettings.reset_to_default(\"canvas_scale\")  # Reset single setting\nsettings.reset_to_default(group=\"Canvas\")  # Reset entire group\nsettings.reset_to_default()  # Reset all settings\n```\n\n## Performance Note: npe1 Plugin Compatibility\n\nIf you have many legacy npe1 plugins installed (e.g., `napari-assistant`, `napari-segment-blobs-and-things-with-membranes`, `napari-simpleitk-image-processing`), you may experience slow widget loading times (10+ seconds) the first time you open the settings plugin widget in a napari session. This is a known issue in napari's npe1 compatibility layer, not specific to ndev-settings. The npe1 adapter iterates through all plugin widgets and performs expensive metadata lookups for each legacy plugin.\n\n**Workaround**: If you don't need npe1 runtime behavior plugins, you can disable the adapter in napari:\n\n1. Go to `File` -> `Preferences` -> `Plugins`\n2. Uncheck \"Use npe2 adapter\"\n3. Restart napari\n\nThis dramatically improves widget loading times since only pure npe2 plugins are discovered.\n\n## How Settings Persistence Works\n\nSettings are automatically cached to improve startup performance:\n\n1. **First load**: Settings are discovered from all installed packages via entry points, merged together, and saved to a user config file\n2. **Subsequent loads**: Settings are loaded directly from the cached file (much faster)\n3. **Package changes**: When packages are installed/removed, settings are re-discovered and merged while preserving your customizations\n\n**Storage location**: Settings are stored in a platform-appropriate config directory:\n\n- **Windows**: `%LOCALAPPDATA%\\ndev-settings\\settings.yaml`\n- **macOS**: `~/Library/Application Support/ndev-settings/settings.yaml`\n- **Linux**: `~/.config/ndev-settings/settings.yaml`\n\n**Clearing the cache**: To force re-discovery of settings (e.g., after manual edits to package YAML files):\n\n```python\nfrom ndev_settings import clear_settings\nclear_settings()  # Deletes cached settings, next load will re-discover\n```\n\n## Pre-commit hook\n\nYou can use the `reset-settings-values` pre-commit hook to reset all settings values\nto their defaults before committing. To do so, add the following to your\n`.pre-commit-config.yaml`:\n\n```yaml\n-   repo: https://github.com/ndev-kit/ndev-settings\n    rev: v0.3.0\n    hooks:\n      - id: reset-settings-values\n```\n\n## Contributing\n\nContributions are very welcome. Tests can be run with [tox], please ensure\nthe coverage at least stays the same before you submit a pull request.\n\n## License\n\nDistributed under the terms of the [BSD-3] license,\n\"ndev-settings\" is free and open source software\n\n## Issues\n\nIf you encounter any problems, please [file an issue] along with a detailed description.\n\n[napari]: https://github.com/napari/napari\n[copier]: https://copier.readthedocs.io/en/stable/\n[@napari]: https://github.com/napari\n[MIT]: http://opensource.org/licenses/MIT\n[BSD-3]: http://opensource.org/licenses/BSD-3-Clause\n[GNU GPL v3.0]: http://www.gnu.org/licenses/gpl-3.0.txt\n[GNU LGPL v3.0]: http://www.gnu.org/licenses/lgpl-3.0.txt\n[Apache Software License 2.0]: http://www.apache.org/licenses/LICENSE-2.0\n[Mozilla Public License 2.0]: https://www.mozilla.org/media/MPL/2.0/index.txt\n[napari-plugin-template]: https://github.com/napari/napari-plugin-template\n\n[file an issue]: https://github.com/ndev-kit/ndev-settings/issues\n\n[napari]: https://github.com/napari/napari\n[tox]: https://tox.readthedocs.io/en/latest/\n[pip]: https://pypi.org/project/pip/\n[PyPI]: https://pypi.org/\n",
    "description_content_type": "text/markdown",
    "keywords": null,
    "home_page": null,
    "download_url": null,
    "author": "Tim Monko",
    "author_email": "timmonko@gmail.com",
    "maintainer": null,
    "maintainer_email": null,
    "license": null,
    "classifier": [
      "Development Status :: 2 - Pre-Alpha",
      "Framework :: napari",
      "Intended Audience :: Developers",
      "Operating System :: OS Independent",
      "Programming Language :: Python",
      "Programming Language :: Python :: 3",
      "Programming Language :: Python :: 3 :: Only",
      "Programming Language :: Python :: 3.10",
      "Programming Language :: Python :: 3.11",
      "Programming Language :: Python :: 3.12",
      "Programming Language :: Python :: 3.13",
      "Topic :: Scientific/Engineering :: Image Processing"
    ],
    "requires_dist": [
      "appdirs",
      "magicgui",
      "magic-class",
      "pyyaml",
      "napari[pyqt6]; extra == \"all\""
    ],
    "requires_python": ">=3.10",
    "requires_external": null,
    "project_url": [
      "Bug Tracker, https://github.com/ndev-kit/ndev-settings/issues",
      "Documentation, https://github.com/ndev-kit/ndev-settings#README.md",
      "Source Code, https://github.com/ndev-kit/ndev-settings",
      "User Support, https://github.com/ndev-kit/ndev-settings/issues"
    ],
    "provides_extra": [
      "all"
    ],
    "provides_dist": null,
    "obsoletes_dist": null
  },
  "npe1_shim": false
}