The package aims to help users analyze and understand nuanced narratives or statements by distinguishing between factual accounts and imaginative interpretations. Given a text input, it will process t
Project description
narrativeparser
A Python package for analyzing and understanding nuanced narratives by distinguishing between factual accounts and imaginative interpretations.
Installation
pip install narrativeparser
Usage
The package provides a function narrativeparser that processes input text and returns a structured representation separating factual and imaginative elements.
Basic Example
from narrativeparser import narrativeparser
user_input = "Your text to analyze here..."
result = narrativeparser(user_input)
print(result)
Using a Custom LLM
You can use any LangChain-compatible LLM by passing it to the llm parameter:
from langchain_openai import ChatOpenAI
from narrativeparser import narrativeparser
llm = ChatOpenAI()
user_input = "Your text to analyze here..."
response = narrativeparser(user_input, llm=llm)
from langchain_anthropic import ChatAnthropic
from narrativeparser import narrativeparser
llm = ChatAnthropic()
user_input = "Your text to analyze here..."
response = narrativeparser(user_input, llm=llm)
from langchain_google_genai import ChatGoogleGenerativeAI
from narrativeparser import narrativeparser
llm = ChatGoogleGenerativeAI()
user_input = "Your text to analyze here..."
response = narrativeparser(user_input, llm=llm)
API Key Configuration
The package uses ChatLLM7 by default. You can provide your API key in multiple ways:
- Via environment variable:
export LLM7_API_KEY="your_api_key_here"
- Directly in code:
from narrativeparser import narrativeparser
user_input = "Your text to analyze here..."
response = narrativeparser(user_input, api_key="your_api_key_here")
Get a free API key by registering at https://token.llm7.io/
Parameters
user_input(str): The text input to processllm(Optional[BaseChatModel]): LangChain LLM instance (defaults to ChatLLM7)api_key(Optional[str]): API key for LLM7 (if using default LLM)
Default LLM
The package uses ChatLLM7 by default, which provides sufficient rate limits for most use cases. For higher rate limits, provide your own API key.
Issues
Report issues and feature requests at GitHub Issues
Author
Eugene Evstafev - hi@euegne.plus
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 narrativeparser-2025.12.21083854.tar.gz.
File metadata
- Download URL: narrativeparser-2025.12.21083854.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a844c6c208a13770a93d1aa64d029a1e1d460e2ddf09c6493a9a0f889b910ef1
|
|
| MD5 |
5f80092bc26054fef9a5ee13caefb1f8
|
|
| BLAKE2b-256 |
bd1ad8054bbde79d6f28125b54dc7ce1ff6ecf462b2b19736051987122d7749f
|
File details
Details for the file narrativeparser-2025.12.21083854-py3-none-any.whl.
File metadata
- Download URL: narrativeparser-2025.12.21083854-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44551ae38461150bee788738617e3ad249a1770ef721c6ac049cda6243894c88
|
|
| MD5 |
41724df4f6380f523625a089eda26b5f
|
|
| BLAKE2b-256 |
9356fa9983a9a1695eaaaa755cdd5a910aa1f579e8d276fffa7e4c4701d58bfe
|