Skip to main content

impact-parser processes text to extract structured data on service disruptions, including affected areas, impact scope, causes, and restoration times.

Project description

impact_parser

PyPI version License: MIT Downloads LinkedIn

A Python package for parsing text input to extract and structure information about service disruptions and restorations.

Overview

This package takes text input describing incidents like power outages, internet disruptions, or transportation delays, and returns a structured output with key details such as the affected area, number of impacted users, cause of the disruption, and estimated restoration time.

Installation

pip install impact_parser

Usage

from impact_parser import impact_parser

response = impact_parser(
    user_input="The power outage occurred in the downtown area due to a storm, affecting 1000 homes and businesses. Estimated restoration time is 2 hours.",
    api_key=None,
    llm=None,
)
print(response)

Parameters

  • user_input: The text input to process
  • llm: The Langchain LLM instance to use (optional, defaults to ChatLLM7 with no API key)
  • api_key: The API key for LLM7 (optional, defaults to None)

LLM Options

You can safely pass your own LLM instance (based on https://docs.langchain.io/) if you want to use another LLM.

Examples:

from langchain_openai import ChatOpenAI
from impact_parser import impact_parser
llm = ChatOpenAI()
response = impact_parser(user_input, llm=llm)

from langchain_anthropic import ChatAnthropic
from impact_parser import impact_parser
llm = ChatAnthropic()
response = impact_parser(user_input, llm=llm)

from langchain_google_genai import ChatGoogleGenerativeAI
from impact_parser import impact_parser
llm = ChatGoogleGenerativeAI()
response = impact_parser(user_input, llm=llm)

LLM7 Rate Limits

The default rate limits for LLM7 free tier are sufficient for most use cases of this package. If you need higher rate limits for LLM7, you can pass your own API key via environment variable LLM7_API_KEY or via passing it directly like impact_parser(user_input, api_key="your_api_key").

To get a free API key, register at https://token.llm7.io/

Issues

Refer to the GitHub issues page: https://github.com/chigwell/impact-parser/issues

Author

Eugene Evstafev eugene@eugene.plus

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

impact_parser-2025.12.21202313.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

impact_parser-2025.12.21202313-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file impact_parser-2025.12.21202313.tar.gz.

File metadata

File hashes

Hashes for impact_parser-2025.12.21202313.tar.gz
Algorithm Hash digest
SHA256 33d5c99cfb50772af8591a0a6f7adecc8a2d1dc7ff74547db3a08544cdc5548b
MD5 e5e97113ba6399a16b949215f7b28754
BLAKE2b-256 c360ac508349d9f5f28a6052fa2851a6fae5ce9b5945268e9649af52061519d9

See more details on using hashes here.

File details

Details for the file impact_parser-2025.12.21202313-py3-none-any.whl.

File metadata

File hashes

Hashes for impact_parser-2025.12.21202313-py3-none-any.whl
Algorithm Hash digest
SHA256 226e91e19f681829bf3255b6a09f81b91833e8fab4be14c0f69ea512c54759a2
MD5 399cc4d20737adc0653caa2d73949d9a
BLAKE2b-256 c6c4d5411f39756f104cbd93d9a2733d2126539cf0e9090dab9dcd050ddc99f3

See more details on using hashes here.

Supported by

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