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 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 aiohttp
from lcwc.feed import Client

client = Client()

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

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

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.

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.12.3.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

lcwc-0.12.3-py3-none-any.whl (27.2 kB view details)

Uploaded Python 3

File details

Details for the file lcwc-0.12.3.tar.gz.

File metadata

  • Download URL: lcwc-0.12.3.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.2

File hashes

Hashes for lcwc-0.12.3.tar.gz
Algorithm Hash digest
SHA256 c7d0beaa3f207403f4a5dc5795d6d7be35c6929e93513f1f5cdae2a9147b3be3
MD5 b95d13430917f7e4c86dc57a3eb344e2
BLAKE2b-256 4126813de35795fef13f7f8f4aff3a1a3968ae268cd7e80d403a97b521e75ffa

See more details on using hashes here.

File details

Details for the file lcwc-0.12.3-py3-none-any.whl.

File metadata

  • Download URL: lcwc-0.12.3-py3-none-any.whl
  • Upload date:
  • Size: 27.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.2

File hashes

Hashes for lcwc-0.12.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c0d739cf8aa67f4f7ebaf88ef9efd2db70f65654b4d9461ea76f85080020c1a5
MD5 dee97726f0e3ea0c466e1cec81529705
BLAKE2b-256 b65f032c83df4dbeb1857ac83fe2055dc3a0e77de9545618402af6671b881117

See more details on using hashes here.

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