FoodTrend Analyzer
FoodTrend Analyzer is a Python package designed to analyze and summarize food trends by processing text inputs. Users can input articles, social media posts, or any text discussing food preferences and consumption patterns. The package uses llmatch-messages to ensure structured responses, providing insights into trends like the shift from pizza to fried chicken among Gen Z. It extracts key points, identifies trends, and presents them in a consistent format, making it easier to understand and act on food industry insights.
Features
- Text Processing: Analyze articles, social media posts, and other text inputs to extract food trends.
- Structured Responses: Use
llmatch-messagesto ensure consistent and structured output. - Customizable LLM: Use the default
ChatLLM7fromlangchain_llm7or pass your own LLM instance for flexibility. - API Key Management: Easily manage API keys for
ChatLLM7via environment variables or direct input.
Installation
You can install the package using pip:
pip install foodtrend_analyzer
Usage
Here is a basic example of how to use the foodtrend_analyzer package:
from foodtrend_analyzer import foodtrend_analyzer
# Example user input
user_input = "Gen Z is shifting from pizza to fried chicken."
# Analyze the input
response = foodtrend_analyzer(user_input)
# Print the response
print(response)
Input Parameters
user_input(str): The user input text to process.llm(Optional[BaseChatModel]): The LangChain LLM instance to use. If not provided, the defaultChatLLM7will be used.api_key(Optional[str]): The API key forChatLLM7. If not provided, the key will be fetched from the environment variableLLM7_API_KEY.
Custom LLM Usage
You can use different LLMs by passing your own LLM instance. Here are examples using OpenAI, Anthropic, and Google:
OpenAI
from langchain_openai import ChatOpenAI
from foodtrend_analyzer import foodtrend_analyzer
llm = ChatOpenAI()
response = foodtrend_analyzer(user_input, llm=llm)
Anthropic
from langchain_anthropic import ChatAnthropic
from foodtrend_analyzer import foodtrend_analyzer
llm = ChatAnthropic()
response = foodtrend_analyzer(user_input, llm=llm)
from langchain_google_genai import ChatGoogleGenerativeAI
from foodtrend_analyzer import foodtrend_analyzer
llm = ChatGoogleGenerativeAI()
response = foodtrend_analyzer(user_input, llm=llm)
API Key Management
The default rate limits for LLM7 free tier are sufficient for most use cases of this package. If you need higher rate limits, you can pass your own API key via the environment variable LLM7_API_KEY or directly in the function call:
response = foodtrend_analyzer(user_input, api_key="your_api_key")
You can get a free API key by registering at LLM7 Token.
Contributing
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
License
This project is licensed under the MIT License.
Author
- Eugene Evstafev
- Email: hi@euegne.plus
- GitHub: chigwell
Metadata
Release files for foodtrend-analyzer 2025.12.21184951
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| foodtrend_analyzer-2025.12.21184951.tar.gz | 5.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| foodtrend_analyzer-2025.12.21184951-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.8 kB
Release files / foodtrend_analyzer-2025.12.21184951.tar.gz
| Download URL | foodtrend_analyzer-2025.12.21184951.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8d6094ee2862035a0a2b9d095e1aec21ade1abf4c4de836942641cf15590d76a
|
|
BLAKE2b-256 checksum How to use checksums |
4b55f7dbaca2b3efe811d9e7ba7164be91ddec0c0071dca305a22a587cfc0f4d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.1
|
Release files / foodtrend_analyzer-2025.12.21184951-py3-none-any.whl
| Download URL | foodtrend_analyzer-2025.12.21184951-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7e3fd772140b706e8a89b59793fec9bff92706ec15948c3a8bcfc74f9aea5b5a
|
|
BLAKE2b-256 checksum How to use checksums |
a44d08a874ffa4f81618edd256da048207206efc0c1d614a361f94edf4ba124a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.1
|