A Python package that analyzes financial news and sentiment to identify and summarize market trends and risks related to AI and technology stocks.
Fin-Trend-Analyzer is a linguistic tool that quickly assesses market perceptions and potential bubble indicators by processing text inputs from news articles, reports, or social media posts. It returns structured insights, such as key risk factors, sentiment scores, and trend summaries, using pattern matching to ensure consistent and reliable output.
pip install fin_trend_analyzerfrom fin_trend_analyzer import fin_trend_analyzer
response = fin_trend_analyzer(user_input="This week's earnings report was outstanding.")-
fin_trend_analyzer(user_input: str, api_key: Optional[str] = None, llm: Optional[BaseChatModel] = None) -> List[str]:user_input: The user input text to process.api_key: The API key for LLM7, default isNoneand will use the environment variableLLM7_API_KEY.llm: The langchain LLM instance to use, default isChatLLM7fromlangchain_llm7.
Example using a custom LLM instance (e.g., OpenAI, Anthropic, or Google):
from langchain_openai import ChatOpenAI from fin_trend_analyzer import fin_trend_analyzer llm = ChatOpenAI() response = fin_trend_analyzer(user_input="This week's earnings report was outstanding.", llm=llm)
The default rate limits for LLM7 free tier are sufficient for most use cases of this package. If higher rate limits are needed, pass your own API key via environment variable LLM7_API_KEY or via passing it directly:
from fin_trend_analyzer import fin_trend_analyzer
response = fin_trend_analyzer(user_input="This week's earnings report was outstanding.", api_key="your_api_key")You can get a free API key by registering at https://token.llm7.io/.
Eugene Evstafev
- Email: hi@euegne.plus
- GitHub: https://github.com/chigwell