A new package designed to extract and structure key insights from opinionated articles or social media posts. The package takes a text input, such as a blog post or a tweet, and uses llmatch-messages
Project description
insightminer
insightminer is a lightweight Python package that extracts and structures key insights from opinionated articles, blog posts, tweets, and other short texts. It leverages the llmatch‑messages library together with a language model (LLM) to parse free‑form input into a predefined, regex‑validated structure, making downstream analysis (sentiment, trend tracking, etc.) straightforward and consistent.
✨ Features
- One‑function interface – Call
insightminer()with your text and get a list of extracted fields. - Built‑in LLM – Uses
ChatLLM7from thelangchain_llm7package by default (free tier suitable for most workloads). - Pluggable LLM – Pass any LangChain‑compatible chat model (OpenAI, Anthropic, Google, etc.) if you prefer a different provider.
- Regex‑driven pattern matching – Guarantees that the output conforms to the pattern you define.
- Simple installation – Available on PyPI.
📦 Installation
pip install insightminer
🚀 Quick Start
from insightminer import insightminer
user_input = "I Wouldn't Want John Solomon's New CMO Job at Mozilla"
results = insightminer(user_input)
print(results)
# Example output: ['John Solomon', 'new CMO job', 'Mozilla']
Parameters
| Parameter | Type | Description |
|---|---|---|
| user_input | str |
The text to be processed (e.g., a blog post title, tweet, etc.). |
| llm | Optional[BaseChatModel] |
A LangChain chat model instance. If omitted, the default ChatLLM7 is used. |
| api_key | Optional[str] |
API key for LLM7. If omitted, the function reads the LLM7_API_KEY environment variable or falls back to the default key ("None"). |
🔧 Using a Custom LLM
You can safely replace the default ChatLLM7 with any LangChain‑compatible chat model.
OpenAI
from langchain_openai import ChatOpenAI
from insightminer import insightminer
llm = ChatOpenAI()
response = insightminer("Your text here", llm=llm)
print(response)
Anthropic
from langchain_anthropic import ChatAnthropic
from insightminer import insightminer
llm = ChatAnthropic()
response = insightminer("Your text here", llm=llm)
print(response)
Google Generative AI
from langchain_google_genai import ChatGoogleGenerativeAI
from insightminer import insightminer
llm = ChatGoogleGenerativeAI()
response = insightminer("Your text here", llm=llm)
print(response)
🔑 LLM7 API Key
- Default behaviour: The function looks for an environment variable
LLM7_API_KEY. - Providing manually: Pass
api_key="YOUR_KEY"when callinginsightminer. - Free tier: Sufficient for typical usage of this package.
- Get a key: Register for free at https://token.llm7.io/.
📚 Documentation & References
ChatLLM7package: https://pypi.org/project/langchain-llm7/- LangChain LLM documentation: https://python.langchain.com/docs/
🐞 Issues & Contributions
If you encounter bugs or have feature requests, please open an issue:
Pull requests are welcome! Follow the standard GitHub workflow and ensure tests (if any) pass before submitting.
✉️ Author
Eugene Evstafev – hi@euegne.plus
GitHub: chigwell
📄 License
This project is licensed under the MIT License. See the LICENSE file for details.
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 insightminer-2025.12.21123144.tar.gz.
File metadata
- Download URL: insightminer-2025.12.21123144.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fb8e1620cfc9deeeeb9e87d36f864234e55098cce1f0bb1e69e36b188083cb1
|
|
| MD5 |
67623d3deda1d9273628335852da1343
|
|
| BLAKE2b-256 |
c99030917fa18430cd5e14c690f7ca9a22dbb717bcc745a56ad57df030157cda
|
File details
Details for the file insightminer-2025.12.21123144-py3-none-any.whl.
File metadata
- Download URL: insightminer-2025.12.21123144-py3-none-any.whl
- Upload date:
- Size: 6.4 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 |
ae316072d053e0849ebb0fdcfa72d3fc928ae272d8ab9cb6584ca3c76ff03f49
|
|
| MD5 |
c0bffd8fd39aca53bb3dee14c56c19f5
|
|
| BLAKE2b-256 |
97543baf5f9f2ec523efb91bd23cfa71a2d0b41465093aab00e56590f22146e6
|