Skip to main content

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)

Source distribution for lcwc 0.15.0
File Size Uploaded
lcwc-0.15.0.tar.gz 23.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lcwc 0.15.0
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.15.0 This release

2 release files

0.14.0

2 release files

0.12.3

2 release files

0.12.2

2 release files

0.12.1

2 release files

0.12

2 release files

0.11

2 release files

0.10

2 release files

0.9.2

2 release files

0.9

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8

2 release files

0.7

2 release files

0.6

2 release files

0.5

2 release files

0.4

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3

2 release files

0.2.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page