news-summerizer
A lightweight Python package that turns concise news headlines or short snippets into structured summaries in a simple XML‑like format.
The output is well‑defined and machine‑readable, making the data usable for news aggregation, content tagging, or quick briefing generation.
Features
- Extract key facts from a headline or short text: event, location, involved parties, significance.
- Output is constrained by a regular expression so the result is always predictable.
- Works with any LangChain
BaseChatModel, falling back to the default LLM7 model. - Zero‑configuration: install once, drop into any project and call
news_summerizer.
Installation
pip install news_summerizer
Quick Example
from news_summerizer import news_summerizer
user_input = (
"Tesla's new Gigafactory in Austin expands production capacity for the Model 3 "
"and the new Cybertruck, boosting U.S. manufacturing jobs."
)
summary = news_summerizer(user_input)
print(summary)
# [
# "<summary>",
# " <event>Expanding production capacity</event>",
# " <location>Austin</location>",
# " <parties>Tesla, Model 3, Cybertruck</parties>",
# " <significance>Boosts U.S. manufacturing jobs</significance>",
# "</summary>"
# ]
Parameters
| Parameter | Type | Description |
|---|---|---|
user_input |
str |
The headline or news snippet to process. |
llm |
Optional[BaseChatModel] |
A LangChain chat model instance. If omitted, the package automatically creates a ChatLLM7 instance. |
api_key |
Optional[str] |
LLM7 API key. If not supplied, the package looks for the LLM7_API_KEY environment variable, otherwise defaults to the free tier key ("None"). |
Custom LLMs
news_summerizer works with any LangChain model. Simply pass your own model instance:
OpenAI
from langchain_openai import ChatOpenAI
from news_summerizer import news_summerizer
llm = ChatOpenAI()
summary = news_summerizer(user_input, llm=llm)
Anthropic
from langchain_anthropic import ChatAnthropic
from news_summerizer import news_summerizer
llm = ChatAnthropic()
summary = news_summerizer(user_input, llm=llm)
Google Gemini
from langchain_google_genai import ChatGoogleGenerativeAI
from news_summerizer import news_summerizer
llm = ChatGoogleGenerativeAI()
summary = news_summerizer(user_input, llm=llm)
LLM7 API Key
The default free tier of LLM7 is usually sufficient. For higher rate limits:
- Set the
LLM7_API_KEYenvironment variable, or - Pass the key directly:
news_summerizer(user_input, api_key="your_api_key")
Free API keys can be obtained by registering at https://token.llm7.io/.
Project Links
- GitHub: https://github.com/chigwell/news-summerizer
- Issues: https://github.com/chigwell/news-summerizer/issues
Author
Eugene Evstafev
📧 hi@euegne.plus
👤 LinkedIn
License: MIT
Version: 0.1.0 (check PyPI for the latest release)
Metadata
Release files for news-summerizer 2025.12.20202646
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| news_summerizer-2025.12.20202646.tar.gz | 5.3 kB | Without provenance | Details for news_summerizer-2025.12.20202646.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| news_summerizer-2025.12.20202646-py3-none-any.whl | Python 3 | none | any | Details for news_summerizer-2025.12.20202646-py3-none-any.whl |
Total release size: 11.2 kB
Release files / news_summerizer-2025.12.20202646.tar.gz
| Download URL | news_summerizer-2025.12.20202646.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
22a24d0744ef6a5561ba6077a770e45e6aae67527869cfbd3fa899c8991cd033
|
|
BLAKE2b-256 checksum How to use checksums |
69fd3ac578014f6b45351ec39f89870438c15959a868e83a8ee92c50b62d7017
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.11
|
Release files / news_summerizer-2025.12.20202646-py3-none-any.whl
| Download URL | news_summerizer-2025.12.20202646-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f944714b296ae983c15366b909513aceb6b21c21eaf91389233e43410f47e968
|
|
BLAKE2b-256 checksum How to use checksums |
d34641789fd43db72bcdf826584e94afbc73451abf6b8ad6f52579c223304601
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.11
|
Security for news-summerizer 2025.12.20202646
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.