Skip to content

angusmcb/attribute-shortcut

Repository files navigation

Attribute Table Shortcut

tests codecov.io release

GPLv3 license

Ruff pre-commit

Description

Attribute Table Shortcut is a QGIS plugin that provides quick access buttons next to each layer in the layers list to open their attribute tables. This small plugin streamlines your workflow by eliminating the need to right-click layers or navigate through menus to access attribute data.

Features

  • Adds convenient buttons directly in the layers panel
  • One-click access to attribute tables for any layer
  • Streamlined workflow for attribute data management
  • Lightweight and efficient plugin design

Development

Create a virtual environment activate it and install needed dependencies with the following commands:

python create_qgis_venv.py
.venv\Scripts\activate # On Linux and macOS run `source .venv\bin\activate`
pip install -r requirements-dev.txt

For more detailed development instructions see development.

Testing the plugin on QGIS

A symbolic link / directory junction should be made to the directory containing the installed plugins pointing to the dev plugin package.

On Windows Command promt

mklink /J %AppData%\QGIS\QGIS3\profiles\default\python\plugins\attributeshortcut .\attributeshortcut

On Windows PowerShell

New-Item -ItemType SymbolicLink -Path ${env:APPDATA}\QGIS\QGIS3\profiles\default\python\plugins\attributeshortcut -Value ${pwd}\attributeshortcut

On Linux

ln -s attributeshortcut/ ~/.local/share/QGIS/QGIS3/profiles/default/python/plugins/attributeshortcut

After that you should be able to enable the plugin in the QGIS Plugin Manager.

VsCode setup

On VS Code use the workspace attribute-shortcut.code-workspace. The workspace contains all the settings and extensions needed for development.

Select the Python interpreter with Command Palette (Ctrl+Shift+P). Select Python: Select Interpreter and choose the one with the path .venv\Scripts\python.exe.

Keeping dependencies up to date

  1. Activate the virtual environment.
  2. pip install pip-tools
  3. pip-compile --upgrade requirements-dev.in
  4. pip install -r requirements-dev.txt or pip-sync requirements-dev.txt

Adding or editing source files

If you create or edit source files make sure that:

  • they contain absolute imports:
    from attributeshortcut.utils.exceptions import TestException # Good
    
    from ..utils.exceptions import TestException # Bad
  • you consider adding test files for the new functionality

Testing

Install python packages listed in requirements-dev.txt to the virtual environment and run tests with:

pytest

License

This plugin is distributed under the terms of the GNU General Public License, version 3 license.

See LICENSE for more information.

About

Attribute Table Shortcut QGIS plugin

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages