Skip to main content

QGIS-Plugin-Manager

Tests PyPi version badge PyPI - Downloads PyPI - Python Version

Mainly designed for QGIS Server plugins, but it works also for desktop.

Not tested on Windows.

The CLI API is not stable yet.

Installation

Python 3.7 minimum, you can make a Python venv if needed.

python3 --version
pip3 install qgis-plugin-manager
python3 -m pip install qgis-plugin-manager

Environment variables

QGIS-Plugin-Manager will take care of following variables :

  • QGIS_PLUGIN_MANAGER_SOURCES_FILE for storing a path to the sources.list otherwise, the current folder will be used.
  • QGIS_PLUGIN_MANAGER_CACHE_DIR for storing all XML files downloaded otherwise, the current folder will be used .cache_qgis_plugin_manager
  • QGIS_PLUGIN_MANAGER_SKIP_SOURCES_FILE, boolean when we do not need a sources.list file, for instance to list plugins only
  • QGIS_PLUGIN_MANAGER_RESTART_FILE, path where the file must be created if QGIS server needs to be restarted. Read the documentation.
  • QGIS_PLUGINPATH for storing plugins, from QGIS Server documentation
  • PYTHONPATH for importing QGIS libraries

Utilisation

Either you need to go in the directory where you are storing plugins, or you can use the environment variable QGIS_PLUGINPATH. You can read the documentation on QGIS Server about this variable.

cd /path/where/you/have/plugins
# usually on a server
cd /usr/lib/qgis/plugins
# or
export QGIS_PLUGINPATH=/path/where/you/have/plugins
$ qgis-plugin-manager --help
usage: qgis-plugin-manager [-h] [-v] {init,list,remote,remove,update,upgrade,cache,search,install} ...

options:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit

commands:
  qgis-plugin-manager command

  {init,list,remote,remove,update,upgrade,cache,search,install}
    init                Create the `sources.list` with plugins.qgis.org as remote
    list                List all plugins in the directory
    remote              List all remote server
    remove              Remove a plugin by its name
    update              Update all index files
    upgrade             Upgrade all plugins installed
    cache               Look for a plugin in the cache
    search              Search for plugins
    install             Install a plugin

Init

To create the first sources.list in the directory with at least the default repository https://plugins.qgis.org :

$ qgis-plugin-manager init
$ cat sources.list 
https://plugins.qgis.org/plugins/plugins.xml?qgis=3.19

You can have one or many servers, one on each line.

List

List all plugins installed :

$ qgis-plugin-manager list
QGIS server version 3.19.0
List all plugins in /home/etienne/dev/qgis/server_plugin

------------------------------------------------------------------------------------------------------------------------------------
|  Name            |  Version  | Flags           |  QGIS min  |  QGIS max  |  Author         | Folder owner     | Action          |
------------------------------------------------------------------------------------------------------------------------------------
|Lizmap            |master     |                 |3.4         |3.99        |3Liz             | root : 0o755     | Unkown version   |
|wfsOutputExtension|1.5.3      |Server           |3.0         |            |3Liz             | etienne : 0o755  |                  |
|QuickOSM          |1.14.0     |Processing       |3.4         |3.99        |Etienne Trimaille| etienne : 0o755  | Upgrade to 1.16.0|
|cadastre          |1.6.2      |Server,Processing|3.0         |3.99        |3liz             | www-data : 0o755 |                  |
|atlasprint        |3.2.2      |Server           |3.10        |            |3Liz             | www-data : 0o755 |                  |
------------------------------------------------------------------------------------------------------------------

Install needed plugins only, mainly on QGIS server

Important note, install only plugins you need you. On QGIS desktop, plugins can slow down your computer. On QGIS server, plugins are like hooks into QGIS server, they can alter input or output of QGIS server. They can produce unexpected result if you don't know how the plugin works. Please refer to their respective documentation or the application that needs QGIS server plugins (for instance, plugins for Lizmap Web Client)

Remote

$ qgis-plugin-manager remote
List of remotes :

https://plugins.qgis.org/plugins/plugins.xml?qgis=3.22

$ cat sources.list 
https://plugins.qgis.org/plugins/plugins.xml?qgis=[VERSION]

[VERSION] is a token in the sources.list file to be replaced by the QGIS version, for instance 3.22. If QGIS is upgraded, the XML file will be updated as well.

You don't have to set the TOKEN for all URL :

https://docs.3liz.org/plugins.xml is valid.

Update

To fetch the XML files from each repository :

$ qgis-plugin-manager update
Downloading https://plugins.qgis.org/plugins/plugins.xml?qgis=3.19...
	Ok
$ ls .cache_qgis_plugin_manager/
https-plugins-qgis-org-plugins-plugins-xml-qgis-3-19.xml

Cache

Check if a plugin is available :

$ qgis-plugin-manager cache atlasprint
Plugin atlasprint : v3.2.2 available

Search

Look for plugins according to tags and title :

$ qgis-plugin-manager search dataviz
Data Plotly
QSoccer

Install

Plugins are case-sensitive and might have spaces in its name :

$ qgis-plugin-manager install dataplotly
Plugin dataplotly latest not found.
Do you mean maybe 'Data Plotly' ?
$ qgis-plugin-manager install 'Data Plotly'

Install the latest version :

$ qgis-plugin-manager install QuickOSM
Installation QuickOSM latest
	Ok QuickOSM.1.16.0.zip

or a specific version :

$ qgis-plugin-manager install QuickOSM==1.14.0
Installation QuickOSM 1.14.0
	Ok QuickOSM.1.14.0.zip

You can use --force or -f to force the installation even if the plugin with the same version is already installed.

Upgrade

Upgrade all plugins installed :

$ qgis-plugin-manager upgrade

You can use --force or -f to force the upgrade for all plugins despite their version.

Note, like APT, update is needed before to refresh the cache.

Remove

It's possible to use rm -rf folder_dir but you can also remove by the plugin name. It will take care of the QGIS_PLUGINPATH environment variable.

$ qgis-plugin-manager remove Quickosm
Plugin name 'Quickosm' not found
Do you mean maybe 'QuickOSM' ?
$ qgis-plugin-manager remove QuickOSM
Plugin QuickOSM removed
Tip : Do not forget to restart QGIS Server to reload plugins 😎

Notify upstream if a restart is needed

When a plugin is installed or removed and if the environment variable QGIS_PLUGIN_MANAGER_RESTART_FILE is set, an empty file will be created or touched. It can notify you if QGIS Server needs to be restarted for instance.

Note that you must manually remove this file.

Run tests

export PYTHONPATH=/home/etienne/dev/app/qgis-master/share/qgis/python/:/usr/lib/python3/dist-packages/
cd test
python3 -m unittest
flake8

Release files for qgis-plugin-manager 1.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qgis-plugin-manager 1.4.2
File Size Uploaded
qgis-plugin-manager-1.4.2.tar.gz 19.5 kB Details

Release files / qgis-plugin-manager-1.4.2.tar.gz

Download URL qgis-plugin-manager-1.4.2.tar.gz
Size 19.5 kB
Tags Source
SHA-256 checksum
How to use checksums
cb0bf515cf70b57aba8ae1f6940c9ed7a014362e1ef4bc37656d1558ec9f7672
BLAKE2b-256 checksum
How to use checksums
ebe2db617377b76eac68918ce1162f08ac26f8d80436f8e672b2d94935e21c47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release history Release notifications | RSS feed

1.7.5

1 release file

1.7.4

1 release file

1.7.3

1 release file

1.7.2

1 release file

1.7.1

1 release file

1.7.0

1 release file

1.6.5

1 release file

1.6.4

1 release file

1.6.3

1 release file

1.6.1

1 release file

1.6.0

1 release file

1.5.0

1 release file

This release

1.4.2 This release

1 release file

1.4.1

1 release file

1.4.0

1 release file

1.3.2

1 release file

1.3.0

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.1.4

1 release file

1.1.3

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page