Skip to main content

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

PyPI version License: MIT Downloads LinkedIn

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:

  1. Via environment variable:
export LLM7_API_KEY="your_api_key_here"
  1. 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 process
  • llm (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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

narrativeparser-2025.12.21083854.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

narrativeparser-2025.12.21083854-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file narrativeparser-2025.12.21083854.tar.gz.

File metadata

File hashes

Hashes for narrativeparser-2025.12.21083854.tar.gz
Algorithm Hash digest
SHA256 a844c6c208a13770a93d1aa64d029a1e1d460e2ddf09c6493a9a0f889b910ef1
MD5 5f80092bc26054fef9a5ee13caefb1f8
BLAKE2b-256 bd1ad8054bbde79d6f28125b54dc7ce1ff6ecf462b2b19736051987122d7749f

See more details on using hashes here.

File details

Details for the file narrativeparser-2025.12.21083854-py3-none-any.whl.

File metadata

File hashes

Hashes for narrativeparser-2025.12.21083854-py3-none-any.whl
Algorithm Hash digest
SHA256 44551ae38461150bee788738617e3ad249a1770ef721c6ac049cda6243894c88
MD5 41724df4f6380f523625a089eda26b5f
BLAKE2b-256 9356fa9983a9a1695eaaaa755cdd5a910aa1f579e8d276fffa7e4c4701d58bfe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page