Modern GIS toolkit for Python - Simplifying geospatial workflows with built-in data sources, intelligent caching, and fluent APIs
This example demonstrates how to discover and list available plugins within the PyMapGIS environment using both its Python API and command-line interface (CLI).
PyMapGIS features a plugin system that allows for its functionality to be extended. This example focuses on how a user can see which plugins are currently registered and available.
The Python script plugin_list_example.py
:
pymapgis.plugins.plugin_registry
).plugin_registry.list_plugins()
or pmg.list_plugins()
) to retrieve a list of available plugin names.The script also provides the equivalent CLI command for listing plugins.
Ensure PyMapGIS is installed: If you haven’t installed PyMapGIS: ```bash pip install pymapgis ``` The availability and behavior of the plugin system might depend on the version of PyMapGIS and its core components.
Navigate to the example directory: ```bash cd docs/examples/plugin_system_example ```
Run the script: ```bash python plugin_list_example.py ```
The script will print to the console:
pymapgis plugin list
).Example output might look like:
--- PyMapGIS Plugin System Example ---
--- Listing available plugins (API) ---
Available plugins:
- core_data_provider_census
- core_data_provider_tiger
...or...
No plugins are currently registered or reported by the registry.
--- Corresponding CLI Command (for informational purposes) ---
You can list plugins using the PyMapGIS CLI:
pymapgis plugin list
To list plugins directly from your terminal, use:
```bash pymapgis plugin list ```
This command will query the plugin registry and display the names of all detected plugins.