PyPi Notifier
A script to notify you about new releases of Python packages via Discord webhooks. The script checks for updates on the specified packages at regular intervals, stores the information in a SQLite database, and sends notifications when a new version is released.
Upon initial launch, no notifications will be sent until a new update is detected.
Supported Notification Clients:
- Discord
Prerequisites
- Python 3.10 or higher
- Docker (if using Docker setup)
Setup
Options for Use
- Docker
- Package
Running the Script as a Package
-
Install the package
poetry add pypi-notifier # or pip install pypi-notifier
-
Use in your Python code
from pypi_notifier import PyPiNotifier notifier = PyPiNotifier( discord_webhook="https://discord.com/api/webhooks/...", tracked_packages={ "PySide6": "https://pypi.org/rss/project/PySide6/releases.xml", "TkFontSelector": "https://pypi.org/rss/project/tkfontselector/releases.xml", }, cron_schedule="0 * * * *", # Cron schedule format for checking updates every hour ) # Run the notifier once notifier.run() # Or run continuously as scheduled by cron notifier.run_forever()
Running the Docker Container
To run the Docker container with the appropriate environment variables, use the following command:
docker run -e "DISCORD_WEBHOOK=<your_webhook_url>" -e "TRACKED_PACKAGES=<your_tracked_packages_json>" -e "CRON_SCHEDULE=0 * * * *" -v "app_data:/app_data"
- Replace
<your_webhook_url>with your Discord webhook URL. - Replace
<your_tracked_packages_json>with the JSON string of your tracked packages, for example:
{
"PySide6": "https://pypi.org/rss/project/PySide6/releases.xml",
"TkFontSelector": "https://pypi.org/rss/project/tkfontselector/releases.xml"
}
This command will mount the app_data volume to persist the database and logs across container restarts.
Checking Logs
Outside of Docker, you can view the logs in ./app_data/logs/.
Notes
- The
app_datavolume is used for persistent storage, including the SQLite database and logs. - If you're running the script outside Docker, the
app_datafolder will be created in your local directory to store logs and the database. - The cron_schedule format follows standard cron syntax for scheduling tasks. For example,
0 * * * *runs the script every hour. - If no updates are detected for a package, no notifications will be sent until a newer version is found.
Troubleshooting
- Error Logs: If something goes wrong, check the logs at
./app_data/logs/for more details. - Database Issues: Ensure that the SQLite database is properly initialized and accessible.
Release files for pypi-notifier 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pypi_notifier-0.1.1.tar.gz | 6.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pypi_notifier-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.8 kB
Release files / pypi_notifier-0.1.1.tar.gz
| Download URL | pypi_notifier-0.1.1.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
29a0710bd8f119d6ec3a27b3247a11810bf9bb78349e5c98e491ed39c8cf47ce
|
|
BLAKE2b-256 checksum How to use checksums |
3fa3e900fbf9730879114200ab911d2af5067dc37502187d803d53dac5bddfe2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.11.9 Windows/10
|
Release files / pypi_notifier-0.1.1-py3-none-any.whl
| Download URL | pypi_notifier-0.1.1-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
04587c1a97ab5e9fe5d012268228119ced1d344b4400b4cc5048dca27567af03
|
|
BLAKE2b-256 checksum How to use checksums |
7822ba5b4d22e8451af259880f360c6580c0912552f07231086d416b25844c43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.11.9 Windows/10
|