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
Release history Release notifications | RSS feed
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.tar.gz
(6.9 kB
view hashes)
Built Distribution
lcwc-0.3-py3-none-any.whl
(7.8 kB
view hashes)