clima-nutri analyzes text on CO2's impact on food quality, summarizing nutritional and caloric changes for policy and research.
Project description
clima-nutri
clima-nutri is a Python package designed to assist researchers, policymakers, and health professionals in understanding the impact of rising carbon dioxide levels on food quality. This tool analyzes text input describing food-related studies, reports, or observations and extracts structured summaries highlighting key findings about increasing caloric contents and decreasing nutritional values of food due to climate change. Leveraging advanced language models and pattern matching, clima-nutri simplifies the process of trend analysis, data comparison, and strategy development to mitigate adverse climate effects on nutrition.
Installation
Install the package via pip:
pip install clima_nutri
Usage
Import the package and call the main function with your input text. You can use the default language model (ChatLLM7 from langchain_llm7), or pass a custom instance of any compatible language model.
Basic example with default LLM:
from clima_nutri import clima_nutri
response = clima_nutri(user_input="Your text describing studies or observations about food and climate change.")
print(response)
Using your own language model instance
The package defaults to using ChatLLM7 from langchain_llm7 sourced from PyPI (https://pypi.org/project/langchain-llm7/). You can also provide your own LLM instance for flexibility, such as OpenAI, Anthropic, or Google models.
Example with OpenAI:
from langchain_openai import ChatOpenAI
from clima_nutri import clima_nutri
llm = ChatOpenAI()
response = clima_nutri(user_input="Your input text here.", llm=llm)
Example with Anthropic:
from langchain_anthropic import ChatAnthropic
from clima_nutri import clima_nutri
llm = ChatAnthropic()
response = clima_nutri(user_input="Your input text here.", llm=llm)
Example with Google Generative AI:
from langchain_google_genai import ChatGoogleGenerativeAI
from clima_nutri import clima_nutri
llm = ChatGoogleGenerativeAI()
response = clima_nutri(user_input="Your input text here.", llm=llm)
API Key Management
The function can automatically retrieve the default API key for LLM7 from the environment variable LLM7_API_KEY. For higher rate limits or custom usage, you can pass your API key directly:
response = clima_nutri(user_input="Your input text here.", api_key="your_api_key")
You can obtain a free API key at https://token.llm7.io/.
Function Signature
clima_nutri(
user_input: str,
api_key: Optional[str] = None,
llm: Optional[BaseChatModel] = None
) -> List[str]
- user_input: Text describing food studies, reports, or observations.
- api_key: Optional string for LLM7 API access.
- llm: Optional custom language model instance; defaults to
ChatLLM7.
Underlying Technology
This package relies on ChatLLM7 from the langchain_llm7 library. It enables flexible integration with various language models, including OpenAI, Anthropic, and Google Generative AI, facilitating broad compatibility.
Support and Feedback
For issues or feature requests, please visit the GitHub repository: https://github.com/chigwell/clima-nutri/issues
Author
Eugene Evstafev
Email: hi@euegne.plus
GitHub: @chigwell
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 clima_nutri-2025.12.21233357.tar.gz.
File metadata
- Download URL: clima_nutri-2025.12.21233357.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1fb1fa25ad8eeb12b84caeff7b38f555edc51c9a2fab17741f84981e5d04d77
|
|
| MD5 |
104f27ac3d52d56a9b86fa321b619f7b
|
|
| BLAKE2b-256 |
31d0e705f606a2f690fe21a8c949e502623d411d853bfdee8e5f1528a14790aa
|
File details
Details for the file clima_nutri-2025.12.21233357-py3-none-any.whl.
File metadata
- Download URL: clima_nutri-2025.12.21233357-py3-none-any.whl
- Upload date:
- Size: 5.0 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 |
6f5858d681f63419927a8392b0e3e85bc76ad00b3c52786c007425ae1cf49b64
|
|
| MD5 |
ddadaf6bc1968b0ca3b4483b3f18689f
|
|
| BLAKE2b-256 |
28d4e81dba44ad446066801fc8edfdd9b658f0720f912957d39aa1a33d18b20c
|