impact-parser processes text to extract structured data on service disruptions, including affected areas, impact scope, causes, and restoration times.
Project description
impact_parser
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 processllm: The Langchain LLM instance to use (optional, defaults toChatLLM7with no API key)api_key: The API key for LLM7 (optional, defaults toNone)
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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file impact_parser-2025.12.21202313.tar.gz.
File metadata
- Download URL: impact_parser-2025.12.21202313.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33d5c99cfb50772af8591a0a6f7adecc8a2d1dc7ff74547db3a08544cdc5548b
|
|
| MD5 |
e5e97113ba6399a16b949215f7b28754
|
|
| BLAKE2b-256 |
c360ac508349d9f5f28a6052fa2851a6fae5ce9b5945268e9649af52061519d9
|
File details
Details for the file impact_parser-2025.12.21202313-py3-none-any.whl.
File metadata
- Download URL: impact_parser-2025.12.21202313-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
226e91e19f681829bf3255b6a09f81b91833e8fab4be14c0f69ea512c54759a2
|
|
| MD5 |
399cc4d20737adc0653caa2d73949d9a
|
|
| BLAKE2b-256 |
c6c4d5411f39756f104cbd93d9a2733d2126539cf0e9090dab9dcd050ddc99f3
|