Skip to main content

eventlytics-summarizer

PyPI version License: MIT Downloads LinkedIn

eventlytics-summarizer is a tiny Python package that wraps a language‑model call with pattern‑matching and retry logic, making it easy to get concise, structured summaries and key‑point extractions from free‑form event descriptions.
It is especially suited for incident reports, news snippets, or any narrative that needs to be turned into a predictable, machine‑readable format.

Installation

pip install eventlytics_summarizer

Quick start

from eventlytics_summarizer import eventlytics_summarizer

text = """
Gloria Ramirez, a 31‑year‑old patient at the emergency department, suddenly began
seizing and emitting a strange, oily odor.  Shortly after, several staff members
lost consciousness.  The incident was later attributed to a toxic reaction to a
medication administered to Ms. Ramirez.
"""

summary = eventlytics_summarizer(user_input=text)
print(summary)
# -> ['...']   # a list of strings that match the defined output pattern

API

eventlytics_summarizer(
    user_input: str,
    llm: Optional[BaseChatModel] = None,
    api_key: Optional[str] = None
) -> List[str]
Parameter Type Description
user_input str The raw narrative you want to summarize / extract.
llm BaseChatModel (optional) Any LangChain‑compatible chat model. If omitted, the package creates a ChatLLM7 instance automatically.
api_key str (optional) API key for LLM7. If not supplied, the function looks for the LLM7_API_KEY environment variable, falling back to a placeholder "None" (which triggers the default free‑tier limits).

Default LLM (LLM7)

If you do not provide your own model, eventlytics_summarizer uses ChatLLM7 from the langchain_llm7 package:

from langchain_llm7 import ChatLLM7

The free tier of LLM7 provides enough calls for typical usage. To increase limits, supply your own API key:

summary = eventlytics_summarizer(user_input=text, api_key="YOUR_LLM7_API_KEY")

You can obtain a free key by registering at https://token.llm7.io/.

Using a custom LLM

You can plug any LangChain chat model that implements BaseChatModel. Below are a few common examples.

OpenAI (ChatGPT)

from langchain_openai import ChatOpenAI
from eventlytics_summarizer import eventlytics_summarizer

llm = ChatOpenAI(model="gpt-4o-mini")  # or any other OpenAI model
summary = eventlytics_summarizer(user_input=text, llm=llm)

Anthropic (Claude)

from langchain_anthropic import ChatAnthropic
from eventlytics_summarizer import eventlytics_summarizer

llm = ChatAnthropic(model="claude-3-haiku-20240307")
summary = eventlytics_summarizer(user_input=text, llm=llm)

Google Gemini

from langchain_google_genai import ChatGoogleGenerativeAI
from eventlytics_summarizer import eventlytics_summarizer

llm = ChatGoogleGenerativeAI(model="gemini-1.5-flash")
summary = eventlytics_summarizer(user_input=text, llm=llm)

How it works

  1. Prompt construction – a system prompt guides the model to produce concise, domain‑appropriate output, while a human prompt injects your user_input.
  2. Pattern matching – the expected output format is described by a regular expression (eventlytics_summarizer.prompts.pattern). The response is validated against this regex.
  3. Retry / error handling – llmatch automatically retries on mismatches and surfaces a clear RuntimeError if the model cannot satisfy the pattern.

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

License

This project is licensed under the MIT License.

Author

Eugene Evstafev – hi@eugene.plus
GitHub: chigwell

Bugs & feature requests

If you encounter any problems or have ideas for improvement, please file an issue at:
https://github.com/chigwell/eventlytics-summarizer/issues

Metadata

Release files for eventlytics-summarizer 2025.12.21101526

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for eventlytics-summarizer 2025.12.21101526
File Size Uploaded
eventlytics_summarizer-2025.12.21101526.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for eventlytics-summarizer 2025.12.21101526
File Interpreter ABI Platform
eventlytics_summarizer-2025.12.21101526-py3-none-any.whl Python 3 none any Details

Total release size: 10.4 kB

Release files / eventlytics_summarizer-2025.12.21101526.tar.gz

Download URL eventlytics_summarizer-2025.12.21101526.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
170368a6d9ececb7d7f27c61f13f7bdb58464b32edda47d08cc9c3fc80bd728d
BLAKE2b-256 checksum
How to use checksums
ff80388966100f29abfa630ad2bdeef1494cc0fcae352d5826769b9af27c38b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.11

Release files / eventlytics_summarizer-2025.12.21101526-py3-none-any.whl

Download URL eventlytics_summarizer-2025.12.21101526-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ccd13de56814c3ee0d4255ff09cbc47c13b800fcd1b3eb35eed2cb0549f70828
BLAKE2b-256 checksum
How to use checksums
19f875cad98ead03ab0d40a2bf85384fdf96335eac7fd17dca6aa066d167562a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.11

Release history Release notifications | RSS feed

This release

2025.12.21101526 This release

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