From ff051bc2859223a2979c1e050b8aae7fc947b6de Mon Sep 17 00:00:00 2001 From: Hemna Date: Wed, 28 Feb 2024 16:10:55 -0500 Subject: [PATCH] Added list-extensions and updated README.rst This patch adds the list-extensions command to support showing the available extensions for APRSD that live on pypi. --- README.rst | 133 +++++++++++++++++++------------------ aprsd/cmds/list_plugins.py | 99 ++++++++++++++++++++++++--- 2 files changed, 158 insertions(+), 74 deletions(-) diff --git a/README.rst b/README.rst index 088404b..24e727c 100644 --- a/README.rst +++ b/README.rst @@ -10,32 +10,38 @@ ____________________ `APRSD `_ is a Ham radio `APRS `_ message command gateway built on python. -APRSD listens on amateur radio aprs-is network for messages and respond to them. -It has a plugin architecture for extensibility. Users of APRSD can write their own -plugins that can respond to APRS-IS messages. -You must have an amateur radio callsign to use this software. APRSD gets -messages for the configured HAM callsign, and sends those messages to a -list of plugins for processing. There are a set of core plugins that -provide responding to messages to check email, get location, ping, -time of day, get weather, and fortune telling as well as version information -of aprsd itself. +What is APRSD +============= +APRSD is a python application for interacting with the APRS network and providing +APRS services for HAM radio operators. + +APRSD currently has 4 main commands to use. + * server - Connect to APRS and listen/respond to APRS messages + * webchat - web based chat program over APRS + * send-message - Send a message to a callsign via APRS_IS. + * listen - Listen to packets on the APRS-IS Network based on FILTER. + +Each of those commands can connect to the APRS-IS network if internet connectivity +is available. If internet is not available, then APRS can be configured to talk +to a TCP KISS TNC for radio connectivity. Please `read the docs`_ to learn more! - -.. contents:: :local: - - APRSD Overview Diagram ====================== .. image:: https://raw.githubusercontent.com/craigerl/aprsd/master/docs/_static/aprsd_overview.svg?sanitize=true - Typical use case ================ +APRSD's typical use case is that of providing an APRS wide service to all HAM +radio operators. For example the callsign 'REPEAT' on the APRS network is actually +an instance of APRSD that can provide a list of HAM repeaters in the area of the +callsign that sent the message. + + Ham radio operator using an APRS enabled HAM radio sends a message to check the weather. An APRS message is sent, and then picked up by APRSD. The APRS packet is decoded, and the message is sent through the list of plugins @@ -46,55 +52,6 @@ callsigns to look out for. The watch list can notify you when a HAM callsign in the list is seen and now available to message on the APRS network. -Current list of built-in plugins -====================================== - -:: - - โ””โ”€> aprsd list-plugins - ๐Ÿ APRSD Built-in Plugins ๐Ÿ - โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“ - โ”ƒ Plugin Name โ”ƒ Info โ”ƒ Type โ”ƒ Plugin Path โ”ƒ - โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ - โ”‚ AVWXWeatherPlugin โ”‚ AVWX weather of GPS Beacon location โ”‚ RegexCommand โ”‚ aprsd.plugins.weather.AVWXWeatherPlugin โ”‚ - โ”‚ EmailPlugin โ”‚ Send and Receive email โ”‚ RegexCommand โ”‚ aprsd.plugins.email.EmailPlugin โ”‚ - โ”‚ FortunePlugin โ”‚ Give me a fortune โ”‚ RegexCommand โ”‚ aprsd.plugins.fortune.FortunePlugin โ”‚ - โ”‚ LocationPlugin โ”‚ Where in the world is a CALLSIGN's last GPS beacon? โ”‚ RegexCommand โ”‚ aprsd.plugins.location.LocationPlugin โ”‚ - โ”‚ NotifySeenPlugin โ”‚ Notify me when a CALLSIGN is recently seen on APRS-IS โ”‚ WatchList โ”‚ aprsd.plugins.notify.NotifySeenPlugin โ”‚ - โ”‚ OWMWeatherPlugin โ”‚ OpenWeatherMap weather of GPS Beacon location โ”‚ RegexCommand โ”‚ aprsd.plugins.weather.OWMWeatherPlugin โ”‚ - โ”‚ PingPlugin โ”‚ reply with a Pong! โ”‚ RegexCommand โ”‚ aprsd.plugins.ping.PingPlugin โ”‚ - โ”‚ QueryPlugin โ”‚ APRSD Owner command to query messages in the MsgTrack โ”‚ RegexCommand โ”‚ aprsd.plugins.query.QueryPlugin โ”‚ - โ”‚ TimeOWMPlugin โ”‚ Current time of GPS beacon's timezone. Uses OpenWeatherMap โ”‚ RegexCommand โ”‚ aprsd.plugins.time.TimeOWMPlugin โ”‚ - โ”‚ TimePlugin โ”‚ What is the current local time. โ”‚ RegexCommand โ”‚ aprsd.plugins.time.TimePlugin โ”‚ - โ”‚ USMetarPlugin โ”‚ USA only METAR of GPS Beacon location โ”‚ RegexCommand โ”‚ aprsd.plugins.weather.USMetarPlugin โ”‚ - โ”‚ USWeatherPlugin โ”‚ Provide USA only weather of GPS Beacon location โ”‚ RegexCommand โ”‚ aprsd.plugins.weather.USWeatherPlugin โ”‚ - โ”‚ VersionPlugin โ”‚ What is the APRSD Version โ”‚ RegexCommand โ”‚ aprsd.plugins.version.VersionPlugin โ”‚ - โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ - - - Pypi.org APRSD Installable Plugin Packages - - Install any of the following plugins with 'pip install ' - โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“ - โ”ƒ Plugin Package Name โ”ƒ Description โ”ƒ Version โ”ƒ Released โ”ƒ Installed? โ”ƒ - โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ - โ”‚ ๐Ÿ“‚ aprsd-stock-plugin โ”‚ Ham Radio APRSD Plugin for fetching stock quotes โ”‚ 0.1.3 โ”‚ Dec 2, 2022 โ”‚ No โ”‚ - โ”‚ ๐Ÿ“‚ aprsd-sentry-plugin โ”‚ Ham radio APRSD plugin that does.... โ”‚ 0.1.2 โ”‚ Dec 2, 2022 โ”‚ No โ”‚ - โ”‚ ๐Ÿ“‚ aprsd-timeopencage-plugin โ”‚ APRSD plugin for fetching time based on GPS location โ”‚ 0.1.0 โ”‚ Dec 2, 2022 โ”‚ No โ”‚ - โ”‚ ๐Ÿ“‚ aprsd-weewx-plugin โ”‚ HAM Radio APRSD that reports weather from a weewx weather station. โ”‚ 0.1.4 โ”‚ Dec 7, 2021 โ”‚ Yes โ”‚ - โ”‚ ๐Ÿ“‚ aprsd-repeat-plugins โ”‚ APRSD Plugins for the REPEAT service โ”‚ 1.0.12 โ”‚ Dec 2, 2022 โ”‚ No โ”‚ - โ”‚ ๐Ÿ“‚ aprsd-telegram-plugin โ”‚ Ham Radio APRS APRSD plugin for Telegram IM service โ”‚ 0.1.3 โ”‚ Dec 2, 2022 โ”‚ No โ”‚ - โ”‚ ๐Ÿ“‚ aprsd-twitter-plugin โ”‚ Python APRSD plugin to send tweets โ”‚ 0.3.0 โ”‚ Dec 7, 2021 โ”‚ No โ”‚ - โ”‚ ๐Ÿ“‚ aprsd-slack-plugin โ”‚ Amateur radio APRS daemon which listens for messages and responds โ”‚ 1.0.5 โ”‚ Dec 18, 2022 โ”‚ No โ”‚ - โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ - - - ๐Ÿ APRSD Installed 3rd party Plugins ๐Ÿ - โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“ - โ”ƒ Package Name โ”ƒ Plugin Name โ”ƒ Version โ”ƒ Type โ”ƒ Plugin Path โ”ƒ - โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ - โ”‚ aprsd-weewx-plugin โ”‚ WeewxMQTTPlugin โ”‚ 1.0 โ”‚ RegexCommand โ”‚ aprsd_weewx_plugin.weewx.WeewxMQTTPlugin โ”‚ - โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ Installation ============= @@ -187,6 +144,56 @@ look for incomming commands to the callsign configured in the config file 12/07/2021 03:16:17 PM MainThread INFO aprs.logfile = /tmp/aprsd.log server.py:60 +Current list of built-in plugins +====================================== + +:: + + โ””โ”€> aprsd list-plugins + ๐Ÿ APRSD Built-in Plugins ๐Ÿ + โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“ + โ”ƒ Plugin Name โ”ƒ Info โ”ƒ Type โ”ƒ Plugin Path โ”ƒ + โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ + โ”‚ AVWXWeatherPlugin โ”‚ AVWX weather of GPS Beacon location โ”‚ RegexCommand โ”‚ aprsd.plugins.weather.AVWXWeatherPlugin โ”‚ + โ”‚ EmailPlugin โ”‚ Send and Receive email โ”‚ RegexCommand โ”‚ aprsd.plugins.email.EmailPlugin โ”‚ + โ”‚ FortunePlugin โ”‚ Give me a fortune โ”‚ RegexCommand โ”‚ aprsd.plugins.fortune.FortunePlugin โ”‚ + โ”‚ LocationPlugin โ”‚ Where in the world is a CALLSIGN's last GPS beacon? โ”‚ RegexCommand โ”‚ aprsd.plugins.location.LocationPlugin โ”‚ + โ”‚ NotifySeenPlugin โ”‚ Notify me when a CALLSIGN is recently seen on APRS-IS โ”‚ WatchList โ”‚ aprsd.plugins.notify.NotifySeenPlugin โ”‚ + โ”‚ OWMWeatherPlugin โ”‚ OpenWeatherMap weather of GPS Beacon location โ”‚ RegexCommand โ”‚ aprsd.plugins.weather.OWMWeatherPlugin โ”‚ + โ”‚ PingPlugin โ”‚ reply with a Pong! โ”‚ RegexCommand โ”‚ aprsd.plugins.ping.PingPlugin โ”‚ + โ”‚ QueryPlugin โ”‚ APRSD Owner command to query messages in the MsgTrack โ”‚ RegexCommand โ”‚ aprsd.plugins.query.QueryPlugin โ”‚ + โ”‚ TimeOWMPlugin โ”‚ Current time of GPS beacon's timezone. Uses OpenWeatherMap โ”‚ RegexCommand โ”‚ aprsd.plugins.time.TimeOWMPlugin โ”‚ + โ”‚ TimePlugin โ”‚ What is the current local time. โ”‚ RegexCommand โ”‚ aprsd.plugins.time.TimePlugin โ”‚ + โ”‚ USMetarPlugin โ”‚ USA only METAR of GPS Beacon location โ”‚ RegexCommand โ”‚ aprsd.plugins.weather.USMetarPlugin โ”‚ + โ”‚ USWeatherPlugin โ”‚ Provide USA only weather of GPS Beacon location โ”‚ RegexCommand โ”‚ aprsd.plugins.weather.USWeatherPlugin โ”‚ + โ”‚ VersionPlugin โ”‚ What is the APRSD Version โ”‚ RegexCommand โ”‚ aprsd.plugins.version.VersionPlugin โ”‚ + โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ + + + Pypi.org APRSD Installable Plugin Packages + + Install any of the following plugins with 'pip install ' + โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“ + โ”ƒ Plugin Package Name โ”ƒ Description โ”ƒ Version โ”ƒ Released โ”ƒ Installed? โ”ƒ + โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ + โ”‚ ๐Ÿ“‚ aprsd-stock-plugin โ”‚ Ham Radio APRSD Plugin for fetching stock quotes โ”‚ 0.1.3 โ”‚ Dec 2, 2022 โ”‚ No โ”‚ + โ”‚ ๐Ÿ“‚ aprsd-sentry-plugin โ”‚ Ham radio APRSD plugin that does.... โ”‚ 0.1.2 โ”‚ Dec 2, 2022 โ”‚ No โ”‚ + โ”‚ ๐Ÿ“‚ aprsd-timeopencage-plugin โ”‚ APRSD plugin for fetching time based on GPS location โ”‚ 0.1.0 โ”‚ Dec 2, 2022 โ”‚ No โ”‚ + โ”‚ ๐Ÿ“‚ aprsd-weewx-plugin โ”‚ HAM Radio APRSD that reports weather from a weewx weather station. โ”‚ 0.1.4 โ”‚ Dec 7, 2021 โ”‚ Yes โ”‚ + โ”‚ ๐Ÿ“‚ aprsd-repeat-plugins โ”‚ APRSD Plugins for the REPEAT service โ”‚ 1.0.12 โ”‚ Dec 2, 2022 โ”‚ No โ”‚ + โ”‚ ๐Ÿ“‚ aprsd-telegram-plugin โ”‚ Ham Radio APRS APRSD plugin for Telegram IM service โ”‚ 0.1.3 โ”‚ Dec 2, 2022 โ”‚ No โ”‚ + โ”‚ ๐Ÿ“‚ aprsd-twitter-plugin โ”‚ Python APRSD plugin to send tweets โ”‚ 0.3.0 โ”‚ Dec 7, 2021 โ”‚ No โ”‚ + โ”‚ ๐Ÿ“‚ aprsd-slack-plugin โ”‚ Amateur radio APRS daemon which listens for messages and responds โ”‚ 1.0.5 โ”‚ Dec 18, 2022 โ”‚ No โ”‚ + โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ + + + ๐Ÿ APRSD Installed 3rd party Plugins ๐Ÿ + โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“ + โ”ƒ Package Name โ”ƒ Plugin Name โ”ƒ Version โ”ƒ Type โ”ƒ Plugin Path โ”ƒ + โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ + โ”‚ aprsd-weewx-plugin โ”‚ WeewxMQTTPlugin โ”‚ 1.0 โ”‚ RegexCommand โ”‚ aprsd_weewx_plugin.weewx.WeewxMQTTPlugin โ”‚ + โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ + send-message diff --git a/aprsd/cmds/list_plugins.py b/aprsd/cmds/list_plugins.py index ac4b6cd..e57dd79 100644 --- a/aprsd/cmds/list_plugins.py +++ b/aprsd/cmds/list_plugins.py @@ -26,6 +26,7 @@ from aprsd.plugins import ( LOG = logging.getLogger("APRSD") +PYPI_URL = "https://pypi.org/search/" def onerror(name): @@ -88,19 +89,34 @@ def get_module_info(package_name, module_name, module_path): return obj_list - -def get_installed_plugins(): +def _get_installed_aprsd_items(): # installed plugins - ip = {} + plugins = {} + extensions = {} for finder, name, ispkg in pkgutil.iter_modules(): if name.startswith("aprsd_"): + print(f"Found aprsd_ module: {name}") if ispkg: module = importlib.import_module(name) pkgs = walk_package(module) for pkg in pkgs: pkg_info = get_module_info(module.__name__, pkg.name, module.__path__[0]) - ip[name] = pkg_info - return ip + if "plugin" in name: + plugins[name] = pkg_info + elif "extension" in name: + extensions[name] = pkg_info + return plugins, extensions + + + +def get_installed_plugins(): + # installed plugins + plugins, extensions = _get_installed_aprsd_items() + return plugins +def get_installed_extensions(): + # installed plugins + plugins, extensions = _get_installed_aprsd_items() + return extensions def show_built_in_plugins(console): @@ -144,22 +160,27 @@ def show_built_in_plugins(console): console.print(table) -def show_pypi_plugins(installed_plugins, console): +def _get_pypi_packages(): query = "aprsd" - api_url = "https://pypi.org/search/" snippets = [] s = requests.Session() for page in range(1, 3): params = {"q": query, "page": page} - r = s.get(api_url, params=params) + r = s.get(PYPI_URL, params=params) soup = BeautifulSoup(r.text, "html.parser") snippets += soup.select('a[class*="snippet"]') if not hasattr(s, "start_url"): s.start_url = r.url.rsplit("&page", maxsplit=1).pop(0) + return snippets + + +def show_pypi_plugins(installed_plugins, console): + snippets = _get_pypi_packages() + title = Text.assemble( ("Pypi.org APRSD Installable Plugin Packages\n\n", "bold magenta"), - ("Install any of the following plugins with ", "bold yellow"), + ("Install any of the following plugins with\n", "bold yellow"), ("'pip install ", "bold white"), ("'", "cyan"), ) @@ -171,7 +192,7 @@ def show_pypi_plugins(installed_plugins, console): table.add_column("Released", style="bold green", justify="center") table.add_column("Installed?", style="red", justify="center") for snippet in snippets: - link = urljoin(api_url, snippet.get("href")) + link = urljoin(PYPI_URL, snippet.get("href")) package = re.sub(r"\s+", " ", snippet.select_one('span[class*="name"]').text.strip()) version = re.sub(r"\s+", " ", snippet.select_one('span[class*="version"]').text.strip()) created = re.sub(r"\s+", " ", snippet.select_one('span[class*="created"]').text.strip()) @@ -194,7 +215,46 @@ def show_pypi_plugins(installed_plugins, console): console.print("\n") console.print(table) - return + +def show_pypi_extensions(installed_extensions, console): + snippets = _get_pypi_packages() + + title = Text.assemble( + ("Pypi.org APRSD Installable Extension Packages\n\n", "bold magenta"), + ("Install any of the following extensions by running\n", "bold yellow"), + ("'pip install ", "bold white"), + ("'", "cyan"), + ) + table = Table(title=title) + table.add_column("Extension Package Name", style="cyan", no_wrap=True) + table.add_column("Description", style="yellow") + table.add_column("Version", style="yellow", justify="center") + table.add_column("Released", style="bold green", justify="center") + table.add_column("Installed?", style="red", justify="center") + for snippet in snippets: + link = urljoin(PYPI_URL, snippet.get("href")) + package = re.sub(r"\s+", " ", snippet.select_one('span[class*="name"]').text.strip()) + version = re.sub(r"\s+", " ", snippet.select_one('span[class*="version"]').text.strip()) + created = re.sub(r"\s+", " ", snippet.select_one('span[class*="created"]').text.strip()) + description = re.sub(r"\s+", " ", snippet.select_one('p[class*="description"]').text.strip()) + emoji = ":open_file_folder:" + + if "aprsd-" not in package or "-extension" not in package: + continue + + under = package.replace("-", "_") + if under in installed_extensions: + installed = "Yes" + else: + installed = "No" + + table.add_row( + f"[link={link}]{emoji}[/link] {package}", + description, version, created, installed, + ) + + console.print("\n") + console.print(table) def show_installed_plugins(installed_plugins, console): @@ -240,3 +300,20 @@ def list_plugins(ctx): status.update("Looking for installed APRSD plugins") show_installed_plugins(installed_plugins, console) + + +@cli.command() +@cli_helper.add_options(cli_helper.common_options) +@click.pass_context +@cli_helper.process_standard_options_no_config +def list_extensions(ctx): + """List the built in plugins available to APRSD.""" + console = Console() + + with console.status("Show APRSD Extensions") as status: + status.update("Fetching pypi.org APRSD Extensions") + installed_extensions = get_installed_extensions() + show_pypi_extensions(installed_extensions, console) + + status.update("Looking for installed APRSD plugins") + #show_installed_extensions(installed_plugins, console)