pypi-notifier


Namepypi-notifier JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummarySimple utility to parse PyPI packages and send notifications
upload_time2024-12-14 20:13:23
maintainerjlw_4049
docs_urlNone
authorjlw_4049
requires_python<4.0,>=3.10
licenseMIT
keywords python notifications watch update pypi packages
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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

1. Install the package

   ```bash
   poetry add pypi-notifier
   # or
   pip install pypi-notifier
   ```

2. Use in your Python code

   ```python
   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:

```bash
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:

```json
{
  "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_data` volume is used for persistent storage, including the SQLite database and logs.
- If you're running the script outside Docker, the `app_data` folder 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.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pypi-notifier",
    "maintainer": "jlw_4049",
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": "jessielw4049@gmail.com",
    "keywords": "python, notifications, watch, update, pypi, packages",
    "author": "jlw_4049",
    "author_email": "jessielw4049@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/3f/a3/e900fbf9730879114200ab911d2af5067dc37502187d803d53dac5bddfe2/pypi_notifier-0.1.1.tar.gz",
    "platform": null,
    "description": "# PyPi Notifier\n\nA 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.\n\nUpon initial launch, no notifications will be sent until a **new update** is detected.\n\n### Supported Notification Clients:\n\n- **Discord**\n\n## Prerequisites\n\n- Python 3.10 or higher\n- Docker (if using Docker setup)\n\n## Setup\n\n#### Options for Use\n\n- Docker\n- Package\n\n#### Running the Script as a Package\n\n1. Install the package\n\n   ```bash\n   poetry add pypi-notifier\n   # or\n   pip install pypi-notifier\n   ```\n\n2. Use in your Python code\n\n   ```python\n   from pypi_notifier import PyPiNotifier\n   notifier = PyPiNotifier(\n        discord_webhook=\"https://discord.com/api/webhooks/...\",\n        tracked_packages={\n            \"PySide6\": \"https://pypi.org/rss/project/PySide6/releases.xml\",\n            \"TkFontSelector\": \"https://pypi.org/rss/project/tkfontselector/releases.xml\",\n        },\n        cron_schedule=\"0 * * * *\",  # Cron schedule format for checking updates every hour\n   )\n\n   # Run the notifier once\n   notifier.run()\n\n   # Or run continuously as scheduled by cron\n   notifier.run_forever()\n   ```\n\n#### Running the Docker Container\n\nTo run the Docker container with the appropriate environment variables, use the following command:\n\n```bash\ndocker run -e \"DISCORD_WEBHOOK=<your_webhook_url>\" -e \"TRACKED_PACKAGES=<your_tracked_packages_json>\" -e \"CRON_SCHEDULE=0 * * * *\" -v \"app_data:/app_data\"\n```\n\n- Replace `<your_webhook_url>` with your Discord webhook URL.\n- Replace `<your_tracked_packages_json>` with the JSON string of your tracked packages, for example:\n\n```json\n{\n  \"PySide6\": \"https://pypi.org/rss/project/PySide6/releases.xml\",\n  \"TkFontSelector\": \"https://pypi.org/rss/project/tkfontselector/releases.xml\"\n}\n```\n\nThis command will mount the `app_data` volume to persist the database and logs across container restarts.\n\n#### Checking Logs\n\nOutside of Docker, you can view the logs in `./app_data/logs/`.\n\n### Notes\n\n- The `app_data` volume is used for persistent storage, including the SQLite database and logs.\n- If you're running the script outside Docker, the `app_data` folder will be created in your local directory to store logs and the database.\n- The **cron_schedule** format follows standard cron syntax for scheduling tasks. For example, `0 * * * *` runs the script every hour.\n- If no updates are detected for a package, no notifications will be sent until a newer version is found.\n\n### Troubleshooting\n\n- **Error Logs**: If something goes wrong, check the logs at `./app_data/logs/` for more details.\n- **Database Issues**: Ensure that the SQLite database is properly initialized and accessible.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Simple utility to parse PyPI packages and send notifications",
    "version": "0.1.1",
    "project_urls": null,
    "split_keywords": [
        "python",
        " notifications",
        " watch",
        " update",
        " pypi",
        " packages"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7822ba5b4d22e8451af259880f360c6580c0912552f07231086d416b25844c43",
                "md5": "f3be6b32bedb244e9ec4389feddee6c1",
                "sha256": "04587c1a97ab5e9fe5d012268228119ced1d344b4400b4cc5048dca27567af03"
            },
            "downloads": -1,
            "filename": "pypi_notifier-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f3be6b32bedb244e9ec4389feddee6c1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 7885,
            "upload_time": "2024-12-14T20:13:20",
            "upload_time_iso_8601": "2024-12-14T20:13:20.750991Z",
            "url": "https://files.pythonhosted.org/packages/78/22/ba5b4d22e8451af259880f360c6580c0912552f07231086d416b25844c43/pypi_notifier-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3fa3e900fbf9730879114200ab911d2af5067dc37502187d803d53dac5bddfe2",
                "md5": "bc8934283b342940b7fc67d9868a6477",
                "sha256": "29a0710bd8f119d6ec3a27b3247a11810bf9bb78349e5c98e491ed39c8cf47ce"
            },
            "downloads": -1,
            "filename": "pypi_notifier-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "bc8934283b342940b7fc67d9868a6477",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 6925,
            "upload_time": "2024-12-14T20:13:23",
            "upload_time_iso_8601": "2024-12-14T20:13:23.281838Z",
            "url": "https://files.pythonhosted.org/packages/3f/a3/e900fbf9730879114200ab911d2af5067dc37502187d803d53dac5bddfe2/pypi_notifier-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-14 20:13:23",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pypi-notifier"
}
        
Elapsed time: 8.64603s