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
Metadata
Release files for summaryxtract 2025.12.21153710
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| summaryxtract-2025.12.21153710.tar.gz | 4.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| summaryxtract-2025.12.21153710-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.3 kB
Release files / summaryxtract-2025.12.21153710.tar.gz
| Download URL | summaryxtract-2025.12.21153710.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6e556b86414d27a7307ee8baff109c7f89cada575c2c23e74e1e36cee0d26f13
|
|
BLAKE2b-256 checksum How to use checksums |
0cf25686051932836f94e8facc1c95dcac6161fc7fbecf82f457f6f67dc87ebc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.1
|
Release files / summaryxtract-2025.12.21153710-py3-none-any.whl
| Download URL | summaryxtract-2025.12.21153710-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f94bb77a5f96dea68e4a8998a23f39d649dcd7ec7fbb0128a16f15fcaf881e7c
|
|
BLAKE2b-256 checksum How to use checksums |
ce79d3603d1a5306af4b22ec2d91f314e07880237bbde608d325aa9e973c7c67
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.1
|