The easiest way to get going with developing is to install the package locally using venv:
python -m venv /path/to/new/virtual/environment
source /path/to/new/virtual/environment/bin/activate
pip3 install -e .
pip3 install -e plugins/example-plugin/.
Configuration is a JSON with 4 elements:
logging
- logging configlevel
- logging level (defaults toERROR
if not provided)log_file_base_name
- base name of the logging file (defaults toevent_web_scout
); will be suffixed with the date of the script launch and.log
quiet
- sets logging level toERROR
format
- logging message format (defaults to[%(levelname)s][%(name)s]%(asctime)s - %(message)s
)
plugin_entry_points
- list of entry points that will be scanned for pluginsplugin_execution
- plugin execution configtimeout_seconds
- how long a plugin is allowed to run for (in seconds); one setting for all plugins; if not provided, 30 seconds is the default
plugin_defaults
- default plugin config (overriden by config defined explicitly for each individual plugin); default value is an empty objectplugins
- array of configurations for individual plugins; each configuration has 3 properties:name
- name of the plugin (name of the plugin package)priority
- priority of plugin execution (lower number = higher priority); plugins with the same priority value will be executed in alphabetical orderenabled
- whether the plugin is enabledconfig
- individual plugin configuration; will be passed to the plugin constructor as the first argument
{
"logging": {
"level": "INFO",
"log_file_base_name": "event_web_scout",
"quiet": false,
"format": "[%(levelname)s][%(name)s]%(asctime)s - %(message)s"
},
"plugin_entry_points": [
"example_plugins"
],
"plugin_execution": {
"timeout_seconds": 30
},
"plugin_defaults": {
"priority": 10,
"enabled": false,
"config": {
"google_service_account_token_file": "google_service_account_token.json",
"google_calendar_id": "<google_calendar_id>"
}
},
"plugins": [
{
"name": "example_plugin",
"priority": 3,
"enabled": true,
"config": {
"example_prop_1": "example_value_1"
}
},
{
"name": "cool_plugin_1",
"config": {
"google_calendar_id": "cool_calendar_id"
}
}
]
}
JSON schema generation was done using these tools: