python-lcwc
python-lcwc is a Python library for the LCWC incident feed.
The library features multiple clients for retrieving incidents: a web scraper, an RSS feed parser, and an ArcGIS REST client. See notes below for more information.
Installation
pip install lcwc
Example
import asyncio
import aiohttp
from lcwc.feed import FeedClient
async def main():
client = FeedClient()
async with aiohttp.ClientSession() as session:
incidents = await client.get_incidents(session)
for incident in incidents:
print(f'{incident.date} - {incident.description}')
asyncio.run(main())
Notes
Web Client
The web client uses web-scraping which can be a bit limited for identification purposes but is the most reliable. The web client is the recommended client for use unless you need more granular information such as static identifers.
Feed Client
The feed client uses the RSS feed and is similar to the web client except it overs an (admittedly arbitrary) GUID for each incident. Categorization can be a bit off since the feed doesn't supply that in formation so we have to attempt to extrapolate the category from the incident description/units assigned. Use the web client if you need more accurate categorization.
ArcGIS REST Client
The ArcGIS REST client uses the ArcGIS REST API to retrieve incidents. This is the most accurate client since it uses the same data source as the LCWC website. This is still a bit of a prototype and may be subject to change. The ArcGIS REST client is the recommended client if you need more granular information such as static identifiers and coordinates.
Note that coordinates is None for incidents the service has not geocoded, and that the service does not publish non-emergency EMS activity (ROUTINE TRANSFER, EMS ACTIVITY) at all. See ArcGIS live feed service behavior for the measured details.
Release files for lcwc 0.15.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| lcwc-0.15.0.tar.gz | 23.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lcwc-0.15.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 52.2 kB
Release files / lcwc-0.15.0.tar.gz
| Download URL | lcwc-0.15.0.tar.gz |
|---|---|
| Size | 23.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8fa6cc026dd2338b8a2013a11f7d514a3755b2f6310b5c40ca616ee2d56ebb9b
|
|
BLAKE2b-256 checksum How to use checksums |
4f2b537a613afa8319067443115df825e6d43d4d4b4c9ad00cb63c0959e40620
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.2
|
Release files / lcwc-0.15.0-py3-none-any.whl
| Download URL | lcwc-0.15.0-py3-none-any.whl |
|---|---|
| Size | 28.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b2ed6d8775520031fc464086fbdef19694dc374d2d10896a9f1783150ebcdd08
|
|
BLAKE2b-256 checksum How to use checksums |
fddbdee84f2a8d410744de8b342ef5e4034b410b96f6214f45d3323576b3827d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.2
|