A new package would help users analyze and interpret game narratives or story structures, specifically focusing on the METR (Mechanics, Esthetics, Technology, and Rhetoric) plot framework used in game
Project description
game-metr-analyzer
A Python package to analyze and interpret game narratives or story structures, focusing on the METR (Mechanics, Esthetics, Technology, and Rhetoric) plot framework used in game design. It processes textual descriptions of game plots, mechanics, or player experiences and returns a structured breakdown of these elements. This helps game developers, critics, and educators systematically evaluate and enhance game narratives without subjective bias.
Installation
Install the package via pip:
pip install game_metr_analyzer
Usage
Import and use the main function as shown:
from game_metr_analyzer import game_metr_analyzer
response = game_metr_analyzer(
user_input="Your game plot description here",
# Optional: specify a custom LLM instance
# llm=your_llm_instance,
# Optional: specify API key for LLM7
# api_key="your_api_key"
)
Parameters
user_input(str): The textual description of the game plot, mechanics, or player experience to analyze.llm(Optional[BaseChatModel]): An instance of a language model (e.g., from langchain). If not provided, the defaultChatLLM7will be used.api_key(Optional[str]): The API key forChatLLM7. If not provided, it will be read from the environment variableLLM7_API_KEY.
Supported Language Models
This package uses ChatLLM7 from langchain_llm7 by default. You can pass your own language model instance to utilize other services such as:
-
OpenAI's models:
from langchain_openai import ChatOpenAI llm = ChatOpenAI() response = game_metr_analyzer(user_input, llm=llm)
-
Anthropic:
from langchain_anthropic import ChatAnthropic llm = ChatAnthropic() response = game_metr_analyzer(user_input, llm=llm)
-
Google Generative AI:
from langchain_google_genai import ChatGoogleGenerativeAI llm = ChatGoogleGenerativeAI() response = game_metr_analyzer(user_input, llm=llm)
API Key Management
The default rate limits for ChatLLM7 are sufficient for most use cases. To access higher limits:
- Set the
LLM7_API_KEYenvironment variable:export LLM7_API_KEY="your_api_key"
- Or pass it directly:
response = game_metr_analyzer(user_input, api_key="your_api_key")
You can obtain a free API key by registering at https://token.llm7.io/.
License
This project is licensed under the MIT License.
Author
- Eugene Evstafev
- Email: hi@eugene.plus
GitHub
Issues
For bugs or feature requests, please use the GitHub issues page: https://github.com/...
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 game_metr_analyzer-2025.12.21162154.tar.gz.
File metadata
- Download URL: game_metr_analyzer-2025.12.21162154.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84b2b0a8b5b8a84613acd1447da38db4d0780560bc79a2608d90c6bab26e4c47
|
|
| MD5 |
4de7cc5773bd48754de77e3f4aca68ea
|
|
| BLAKE2b-256 |
981c65d03b1f0f942af31302b7e9f6cf2272029c745ef64d4d19d828e443676d
|
File details
Details for the file game_metr_analyzer-2025.12.21162154-py3-none-any.whl.
File metadata
- Download URL: game_metr_analyzer-2025.12.21162154-py3-none-any.whl
- Upload date:
- Size: 5.3 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 |
6e819c6e152eca2791b48541c46468436357d0fda63e5bb92df54ca092f38520
|
|
| MD5 |
609cfb114dd75d49131d585de6b38051
|
|
| BLAKE2b-256 |
dbc83058dcaa2b3dc9db58b8e21717a7f4eb66d4d554a366f2d717f3ef9db40a
|