Skip to main content

phenomenon-interpreter

PyPI version License: MIT Downloads LinkedIn

A Python package for interpreting user-submitted text about natural or scientific phenomena, extracting structured insights, and classifying events based on textual input.


📌 Overview

phenomenon_interpreter is designed to analyze free-form descriptions of phenomena (e.g., solar storms, earthquakes, or other natural events) and generate structured summaries or classifications. It leverages large language models (LLMs) to extract domain-specific insights from unstructured text, enabling automated analysis without requiring multimedia processing.


🚀 Installation

Install the package via pip:

pip install phenomenon_interpreter

🔧 Usage

Basic Usage (Default LLM: ChatLLM7)

from phenomenon_interpreter import phenomenon_interpreter

user_input = "A massive solar storm caused radio blackouts in Australia today."
response = phenomenon_interpreter(user_input)
print(response)  # Structured output based on the input

Custom LLM Integration

You can replace the default ChatLLM7 with any LangChain-compatible LLM (e.g., OpenAI, Anthropic, Google Generative AI). Example:

Using OpenAI:

from langchain_openai import ChatOpenAI
from phenomenon_interpreter import phenomenon_interpreter

llm = ChatOpenAI()
response = phenomenon_interpreter(user_input, llm=llm)

Using Anthropic:

from langchain_anthropic import ChatAnthropic
from phenomenon_interpreter import phenomenon_interpreter

llm = ChatAnthropic()
response = phenomenon_interpreter(user_input, llm=llm)

Using Google Generative AI:

from langchain_google_genai import ChatGoogleGenerativeAI
from phenomenon_interpreter import phenomenon_interpreter

llm = ChatGoogleGenerativeAI()
response = phenomenon_interpreter(user_input, llm=llm)

🔑 API Key Configuration

By default, the package uses ChatLLM7 with an API key fetched from the environment variable LLM7_API_KEY. You can:

  1. Set it via environment variable:
    export LLM7_API_KEY="your_api_key_here"
    
  2. Pass it directly:
    from phenomenon_interpreter import phenomenon_interpreter
    response = phenomenon_interpreter(user_input, api_key="your_api_key_here")
    

Get a free API key from LLM7.


📝 Parameters

Parameter Type Description
user_input str The text describing the phenomenon to analyze.
api_key Optional[str] LLM7 API key (default: fetched from LLM7_API_KEY environment variable).
llm Optional[BaseChatModel] Custom LLM instance (e.g., ChatOpenAI, ChatAnthropic). Default: ChatLLM7.

📊 Output

The function returns a list of structured insights extracted from the input text, formatted to match predefined patterns (e.g., impact classification, event nature).


🔄 Rate Limits

  • LLM7 Free Tier: Sufficient for most use cases.
  • Custom API Key: For higher rate limits, provide your own api_key or set LLM7_API_KEY.

📜 License

MIT License.


📢 Support & Issues

For bugs or feature requests, open an issue on GitHub.


👤 Author


Release files for phenomenon-interpreter 2025.12.21230657

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

Source distribution (sdist)

Source distribution for phenomenon-interpreter 2025.12.21230657
File Size Uploaded
phenomenon_interpreter-2025.12.21230657.tar.gz 4.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for phenomenon-interpreter 2025.12.21230657
File Interpreter ABI Platform
phenomenon_interpreter-2025.12.21230657-py3-none-any.whl Python 3 none any Details

Total release size: 10.5 kB

Release files / phenomenon_interpreter-2025.12.21230657.tar.gz

Download URL phenomenon_interpreter-2025.12.21230657.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2c05cda21f4331b4305c45ad2f9b11f0c585904ca9e854bde844372ba171c0db
BLAKE2b-256 checksum
How to use checksums
03571f1cee344310da2461e971e27666a3dd15db839ab69f1feecff2cc50c177
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.1

Release files / phenomenon_interpreter-2025.12.21230657-py3-none-any.whl

Download URL phenomenon_interpreter-2025.12.21230657-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6bdbd992108a491817b94bf6360d5975446ab3bcef752614189810c09bb789d4
BLAKE2b-256 checksum
How to use checksums
7a33893fb8c5077b052abfffac4fc3589ebe6f449c23dc4cfbb360f29512dd38
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.21230657 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