Skip to main content

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

PyPI version License: MIT Downloads LinkedIn

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_key or LLM7_API_KEY env var.

Get a Free API Key: 🔗 Register at LLM7


Error Handling

  • If the LLM call fails, a RuntimeError is 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

summaryxtract-2025.12.21153710.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

summaryxtract-2025.12.21153710-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file summaryxtract-2025.12.21153710.tar.gz.

File metadata

File hashes

Hashes for summaryxtract-2025.12.21153710.tar.gz
Algorithm Hash digest
SHA256 6e556b86414d27a7307ee8baff109c7f89cada575c2c23e74e1e36cee0d26f13
MD5 7032028e85fe7e1d612d7c7960e04990
BLAKE2b-256 0cf25686051932836f94e8facc1c95dcac6161fc7fbecf82f457f6f67dc87ebc

See more details on using hashes here.

File details

Details for the file summaryxtract-2025.12.21153710-py3-none-any.whl.

File metadata

File hashes

Hashes for summaryxtract-2025.12.21153710-py3-none-any.whl
Algorithm Hash digest
SHA256 f94bb77a5f96dea68e4a8998a23f39d649dcd7ec7fbb0128a16f15fcaf881e7c
MD5 83d30e5117f9e54e8f930a9ab45d3621
BLAKE2b-256 ce79d3603d1a5306af4b22ec2d91f314e07880237bbde608d325aa9e973c7c67

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page