concept‑extractor
concept‑extractor is a lightweight Python package that turns complex, philosophical or thematic text prompts (e.g., “Dark Enlightenment”) into concise, well‑structured summaries or analyses. It leverages language models via LangChain and a pattern‑matching helper (llmatch) to guarantee that the output conforms to a user‑defined regular‑expression pattern.
Key points
- Text‑only – no multimedia handling.
- Deterministic output thanks to regex‑based validation.
- Works out‑of‑the‑box with the default
ChatLLM7model; any LangChain‑compatible LLM can be swapped in.
Installation
pip install concept_extractor
Quick start
from concept_extractor import concept_extractor
# Your prompt describing a complex concept
user_input = """
The Dark Enlightenment is a contemporary philosophical movement that...
"""
# Run the extractor (uses ChatLLM7 by default)
summary = concept_extractor(user_input)
print(summary)
summary is a list of strings that matches the pattern defined in concept_extractor.prompts.
Function signature
def concept_extractor(
user_input: str,
api_key: Optional[str] = None,
llm: Optional[BaseChatModel] = None,
) -> List[str]:
| Parameter | Type | Description |
|---|---|---|
| user_input | str |
The text you want to analyse. |
| api_key | Optional[str] |
API key for LLM7. If omitted, the environment variable LLM7_API_KEY is used; otherwise a placeholder "None" is supplied. |
| llm | Optional[BaseChatModel] |
Any LangChain BaseChatModel instance. When omitted the package creates a ChatLLM7 instance automatically. |
The function returns a List[str] containing the extracted data that matches the internal regex pattern.
Using a custom LLM
If you prefer another provider (OpenAI, Anthropic, Google, etc.), simply pass a LangChain chat model instance:
OpenAI
from langchain_openai import ChatOpenAI
from concept_extractor import concept_extractor
llm = ChatOpenAI(model="gpt-4o-mini")
response = concept_extractor(user_input, llm=llm)
print(response)
Anthropic
from langchain_anthropic import ChatAnthropic
from concept_extractor import concept_extractor
llm = ChatAnthropic(model="claude-3-haiku-20240307")
response = concept_extractor(user_input, llm=llm)
print(response)
Google Generative AI
from langchain_google_genai import ChatGoogleGenerativeAI
from concept_extractor import concept_extractor
llm = ChatGoogleGenerativeAI(model="gemini-1.5-flash")
response = concept_extractor(user_input, llm=llm)
print(response)
API key & rate limits
- The default free tier of LLM7 (the model used when you don’t supply an
llm) provides generous rate limits that satisfy most use cases of this package. - To use higher limits or your own quota, set the environment variable
LLM7_API_KEYor pass the key directly:
response = concept_extractor(user_input, api_key="your_llm7_api_key")
- Obtain a free API key by registering at: https://token.llm7.io/
Contributing & support
- Issues & bug reports: https://github.com/chigwell/concept_extractor/issues
- Pull requests are welcome – see the repository for the contribution guidelines.
Author
Eugene Evstafev – hi@euegne.plus
GitHub: chigwell
License
This project is licensed under the MIT License. See the LICENSE file in the repository for details.
Metadata
Release files for concept-extractor 2025.12.21170754
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 |
|---|---|---|---|---|
| concept_extractor-2025.12.21170754.tar.gz | 5.1 kB | Without provenance | Details for concept_extractor-2025.12.21170754.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| concept_extractor-2025.12.21170754-py3-none-any.whl | Python 3 | none | any | Details for concept_extractor-2025.12.21170754-py3-none-any.whl |
Total release size: 11.0 kB
Release files / concept_extractor-2025.12.21170754.tar.gz
| Download URL | concept_extractor-2025.12.21170754.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c8785a7ff296ce6c01f844fe53869f42945ece5edd87ce22323b6733c7eaa7e2
|
|
BLAKE2b-256 checksum How to use checksums |
b3db8af416b2b5bec118f01fdf3704d2b86eb38f51e445108dc5d440441e7bc8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.1
|
Release files / concept_extractor-2025.12.21170754-py3-none-any.whl
| Download URL | concept_extractor-2025.12.21170754-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6500eb2e2fc81cf3c7fd57dc0095088791a54ab0ac1908367f7f5c53ff2ec66c
|
|
BLAKE2b-256 checksum How to use checksums |
4dee678677ef73999ce38ee789ca96ab0fd8e5f70eb4eeadec38549318f5db8f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.1
|
Security for concept-extractor 2025.12.21170754
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.