Skip to main content

Lightweight polling and notification framework

Project description

pypoller

Overview

pypoller is a lightweight and easy-to-use framework for polling a resource at regular intervals and providing notifications on any updates. It is designed to simplify the process of monitoring a remote service for changes and alerting users or systems when relevant updates occur.

Detailed docs available here.

Features

  • Polling: The library allows you to define a polling interval, specifying how frequently the resource should be checked for updates.

  • Notifications: When a change is detected in the service, the library supports customizable notification mechanisms. Currently messaging via Twilio is implemented.

  • Configurability: The library is highly configurable and extensible. Adding support for any notification mechanism or resource should be seamless.

Currently implemented resource checkers:

  • US Visa appointments
  • Parks Canada campsites

Currently implemented notifier:

  • SMS (via Twilio)
  • Rocket.Chat

All submodules can be used independently as well. For example, to check for availability of US Visa appointments:

UGANDA_EMBASSY = "en-ug"
SCHEDULE_ID = "50295138"
FACILITY_ID = "106"
USER_EMAIL = "user_email"
PASSWORD = "password"

# Initialize resource checker for US Visa availability
availability_checker = USVisaResourceChecker(
    UGANDA_EMBASSY, SCHEDULE_ID, FACILITY_ID, USER_EMAIL, PASSWORD
)

date_range_request = DateRangeRequest(
    start_date=dt.datetime(2024, 3, 14),
    end_date=dt.datetime(2025, 7, 1),
)

response = availability_checker.check_resource(date_range_request)

Installation

pip install pypoller

For playwrigt (US Visa):

playwright install chromium

Usage

Refer to examples to learn how to use the library.

To provide twilio / rocketchat credentials for the examples, create a .env file by copying the env.sample file, and replace the placeholder twilio parameters to enable notifications via SMS.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pypoller-0.1.6.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

pypoller-0.1.6-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

Details for the file pypoller-0.1.6.tar.gz.

File metadata

  • Download URL: pypoller-0.1.6.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for pypoller-0.1.6.tar.gz
Algorithm Hash digest
SHA256 9f0df2e64c8ce5207a1393a815357d327d1d74dfb27834ecdda8f1169bf3a495
MD5 8cbb89c809939033a52b9aa0b77f80b0
BLAKE2b-256 3bc3e24edd79e8d43010fb254cda7a933a09ea508c270a7c72f221a7876462bc

See more details on using hashes here.

File details

Details for the file pypoller-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: pypoller-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 20.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for pypoller-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 681b6c9b3bcae1aeb0d9c323b1886f675ca1bfe85beab855e0f44a2555ee6a11
MD5 d5b6a3cd0f761d170dca0e46f87cd567
BLAKE2b-256 7a336936206a48350d73ff7ba0c01147a268f8bed0948922da7c2e99797cdea0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page