A new package is designed to facilitate structured, reliable extraction of key insights from user-provided texts about cultural topics. It accepts a text input, such as an article or discussion prompt
Project description
summaryxtract
A Python package for structured, reliable extraction of key insights from cultural texts using LLM-powered pattern matching.
Overview
summaryxtract processes user-provided text (e.g., articles, discussions) to extract and summarize core themes, historical context, and contributions related to cultural topics. It leverages LLM7 (by default) or custom LLMs (via LangChain) with retry mechanisms and pattern validation for consistent, accurate results.
Key Features
✅ Structured Summarization – Extracts key insights from textual descriptions. ✅ Pattern Matching & Validation – Ensures responses adhere to predefined formats. ✅ LLM Flexibility – Works with LLM7 (default) or any LangChain-compatible LLM (OpenAI, Anthropic, Google, etc.). ✅ Retry Mechanism – Handles API failures gracefully. ✅ No Media Processing – Focuses purely on text extraction.
Installation
pip install summaryxtract
Usage
Basic Usage (Default LLM7)
from summaryxtract import summaryxtract
response = summaryxtract(user_input="Your text about cultural history here...")
print(response) # List of extracted insights
Custom LLM Integration
You can replace the default LLM7 with any LangChain-compatible LLM (e.g., OpenAI, Anthropic, Google).
Example: Using OpenAI
from langchain_openai import ChatOpenAI
from summaryxtract import summaryxtract
llm = ChatOpenAI()
response = summaryxtract(user_input="Your text...", llm=llm)
Example: Using Anthropic
from langchain_anthropic import ChatAnthropic
from summaryxtract import summaryxtract
llm = ChatAnthropic()
response = summaryxtract(user_input="Your text...", llm=llm)
Example: Using Google Vertex AI
from langchain_google_genai import ChatGoogleGenerativeAI
from summaryxtract import summaryxtract
llm = ChatGoogleGenerativeAI()
response = summaryxtract(user_input="Your text...", llm=llm)
Parameters
| Parameter | Type | Description |
|---|---|---|
user_input |
str |
The input text to analyze. |
api_key |
Optional[str] |
LLM7 API key (if not provided, checks LLM7_API_KEY env var). |
llm |
Optional[BaseChatModel] |
Custom LangChain LLM (optional; defaults to LLM7). |
Default LLM (LLM7)
- Provider: LLM7 (free tier available).
- Rate Limits: Sufficient for most use cases (free tier).
- Custom API Key: Pass via
api_keyorLLM7_API_KEYenv var.
Get a Free API Key: 🔗 Register at LLM7
Error Handling
- If the LLM call fails, a
RuntimeErroris raised with the error message. - Retry mechanisms ensure robustness.
Contributing & Issues
🐛 Report bugs/feature requests: 🔗 GitHub Issues
Author
👤 Eugene Evstafev 📧 hi@euegne.plus 🔗 GitHub: chigwell
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 summaryxtract-2025.12.21153710.tar.gz.
File metadata
- Download URL: summaryxtract-2025.12.21153710.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 |
6e556b86414d27a7307ee8baff109c7f89cada575c2c23e74e1e36cee0d26f13
|
|
| MD5 |
7032028e85fe7e1d612d7c7960e04990
|
|
| BLAKE2b-256 |
0cf25686051932836f94e8facc1c95dcac6161fc7fbecf82f457f6f67dc87ebc
|
File details
Details for the file summaryxtract-2025.12.21153710-py3-none-any.whl.
File metadata
- Download URL: summaryxtract-2025.12.21153710-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 |
f94bb77a5f96dea68e4a8998a23f39d649dcd7ec7fbb0128a16f15fcaf881e7c
|
|
| MD5 |
83d30e5117f9e54e8f930a9ab45d3621
|
|
| BLAKE2b-256 |
ce79d3603d1a5306af4b22ec2d91f314e07880237bbde608d325aa9e973c7c67
|