Skip to main content

undesirablereasons

PyPI version License: MIT Downloads LinkedIn

undesirablereasons is a lightweight Python package that helps you extract and organize key “undesirable” reasons from free‑form text. It leverages llmatch‑messages together with a language model (by default ChatLLM7) to return a clean, structured list of reasons – perfect for content creators, researchers, or anyone who wants to summarize the negative aspects of a topic.

Installation

pip install undesirablereasons

Quick Start

from undesirablereasons import undesirablereasons

user_input = """
Becoming famous sounds great, but it also means losing privacy,
being constantly judged, dealing with paparazzi, and facing intense
pressure to maintain a public image. Fame can attract false
friendships, tax complexities, and the loss of a normal childhood.
"""

reasons = undesirablereasons(user_input)
print(reasons)

Output (example)

[
    "Loss of privacy",
    "Constant judgment and pressure",
    "Paparazzi intrusion",
    "False friendships",
    "Tax complexities",
    "Loss of a normal childhood"
]

API Reference

undesirablereasons(user_input, api_key=None, llm=None) -> List[str]

Parameter Type Description
user_input str The raw text you want to analyse.
api_key Optional[str] API key for LLM7. If omitted, the function reads LLM7_API_KEY from the environment or falls back to the default (free tier).
llm Optional[BaseChatModel] Any LangChain BaseChatModel instance. If omitted, the package creates a ChatLLM7 instance automatically.
  • Returns a list of extracted reasons (strings).
  • Raises RuntimeError if the LLM call fails.

Using a Custom LLM

You can plug in any LangChain‑compatible chat model:

OpenAI

from langchain_openai import ChatOpenAI
from undesirablereasons import undesirablereasons

llm = ChatOpenAI(model="gpt-4o-mini")
reasons = undesirablereasons("...", llm=llm)

Anthropic

from langchain_anthropic import ChatAnthropic
from undesirablereasons import undesirablereasons

llm = ChatAnthropic(model="claude-3-haiku-20240307")
reasons = undesirablereasons("...", llm=llm)

Google Generative AI

from langchain_google_genai import ChatGoogleGenerativeAI
from undesirablereasons import undesirablereasons

llm = ChatGoogleGenerativeAI(model="gemini-1.5-flash")
reasons = undesirablereasons("...", llm=llm)

LLM7 Rate Limits

The free tier of LLM7 provides generous rate limits that are sufficient for most typical uses of this package. If you need higher limits, simply provide your own API key:

reasons = undesirablereasons("...", api_key="YOUR_LLM7_API_KEY")

You can obtain a free API key by registering at https://token.llm7.io/.

Development

Feel free to open an issue for bugs, feature requests, or questions.

Contributing

Contributions are welcome! Fork the repository, make your changes, and submit a pull request. Please ensure that new code follows the existing style and includes appropriate tests.

License

This project is licensed under the MIT License.

Author

Eugene Evstafev – hi@euegne.plus

GitHub: chigwell

Metadata

Release files for undesirablereasons 2025.12.21151640

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for undesirablereasons 2025.12.21151640
File Size Uploaded
undesirablereasons-2025.12.21151640.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for undesirablereasons 2025.12.21151640
File Interpreter ABI Platform
undesirablereasons-2025.12.21151640-py3-none-any.whl Python 3 none any Details

Total release size: 10.3 kB

Release files / undesirablereasons-2025.12.21151640.tar.gz

Download URL undesirablereasons-2025.12.21151640.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
be2f0a4ab840d315a96af90e66d1d4a6e125244d97c5834fd7e843fe568fab0f
BLAKE2b-256 checksum
How to use checksums
fbb74cc152197a158424acd9fc4b0738b3765643b60742dd4fafd747d271fd73
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.1

Release files / undesirablereasons-2025.12.21151640-py3-none-any.whl

Download URL undesirablereasons-2025.12.21151640-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9174f0bc8943894055d1f5e0117a55b480aaf13f3fc80d7ce681efe47af6c324
BLAKE2b-256 checksum
How to use checksums
1a52bc886e25104bf66732f55d2af0f8c17edbde849ce3aa4ecc652083db6a54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.1

Release history Release notifications | RSS feed

This release

2025.12.21151640 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page