Skip to main content

Python library for fetching the Lancaster County-Wide Communications live incident list.

Project description

python-lcwc

python-lcwc is a Python library for the LCWC incident feed.

The library features both a web scraper and a RSS feed parser. The web scraper client is more reliable due to the RSS feed not categorizing incidents so we have to attempt to extrapolate the category from the incident description/units assigned. Functionally, it should be mostly accurate but edge cases may pop up. Addtionally, the feed parser offers a GUID. This is a unique identifier for each incident. The web client does not offer this.

Installation

pip install lcwc

Example

import aiohttp
from lcwc import feedclient

client = feedclient.IncidentFeedClient()

async with aiohttp.ClientSession() as session:
    incidents = await client.fetch_and_parse(session)

    for incident in incidents:
        print(f'{incident.date} - {incident.description}')

TODO

  • Identify potential duplicate incidents reported under multiple categories (e.g. "Fire" and "Traffic" for vehicle fire)
  • Backing store and event emitter

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

lcwc-0.3.1.tar.gz (7.0 kB view hashes)

Uploaded Source

Built Distribution

lcwc-0.3.1-py3-none-any.whl (7.9 kB view hashes)

Uploaded Python 3

Supported by

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