holiday-narrative-parser processes holiday event narratives to extract themes, tone, and key details for analysis and summarization.
Project description
holiday‑narrative‑parser
A lightweight Python package that extracts structured information from holiday‑themed narratives.
Given a free‑form text (e.g., “The Christmas Tree that came in from the Cold”), the parser identifies:
- Main theme
- Emotional tone
- Key story elements
- Relevant details
The extracted data is returned as a list of strings that match a predefined regular‑expression pattern, making it easy to feed into downstream analysis, categorisation, or summarisation pipelines.
Installation
pip install holiday_narrative_parser
Quick Start
from holiday_narrative_parser import holiday_narrative_parser
story = """
The Christmas tree arrived shivering from the frosty north,
its branches still dusted with snow. Yet inside the living room,
the glow of candlelight warmed its needles, and the family sang
songs of joy and togetherness.
"""
result = holiday_narrative_parser(user_input=story)
print(result)
# Example output:
# [
# "Theme: Christmas",
# "Tone: Warm, nostalgic",
# "Elements: Tree, Snow, Candlelight, Family singing",
# "Details: Tree came from cold, interior warmth"
# ]
API Reference
holiday_narrative_parser(
user_input: str,
llm: Optional[BaseChatModel] = None,
api_key: Optional[str] = None
) -> List[str]
| Parameter | Type | Description |
|---|---|---|
| user_input | str |
The narrative text to be processed. |
| llm | Optional[BaseChatModel] |
A LangChain BaseChatModel instance. If omitted, the default ChatLLM7 from langchain‑llm7 is used. |
| api_key | Optional[str] |
API key for the LLM7 service. If not supplied, the function looks for the LLM7_API_KEY environment variable; otherwise it falls back to a placeholder "None" (which triggers the default behaviour of ChatLLM7). |
Returns: A list of strings that match the extraction pattern defined in the package.
Using a Custom LLM
You can provide any LangChain‑compatible chat model (OpenAI, Anthropic, Google Gemini, etc.). This is useful if you need a different provider, higher token limits, or specialized model behaviour.
OpenAI (ChatGPT)
from langchain_openai import ChatOpenAI
from holiday_narrative_parser import holiday_narrative_parser
my_llm = ChatOpenAI(model="gpt-4o-mini")
response = holiday_narrative_parser(user_input=story, llm=my_llm)
print(response)
Anthropic (Claude)
from langchain_anthropic import ChatAnthropic
from holiday_narrative_parser import holiday_narrative_parser
my_llm = ChatAnthropic(model="claude-3-haiku-20240307")
response = holiday_narrative_parser(user_input=story, llm=my_llm)
print(response)
Google Gemini
from langchain_google_genai import ChatGoogleGenerativeAI
from holiday_narrative_parser import holiday_narrative_parser
my_llm = ChatGoogleGenerativeAI(model="gemini-1.5-flash")
response = holiday_narrative_parser(user_input=story, llm=my_llm)
print(response)
LLM7 Default Settings & Rate Limits
- By default the package uses
ChatLLM7from langchain‑llm7. - The free tier of LLM7 provides sufficient request‑per‑minute limits for typical development and small‑scale production use.
- For higher limits, supply your personal API key either via the
LLM7_API_KEYenvironment variable or directly:
response = holiday_narrative_parser(user_input=story, api_key="YOUR_LLM7_API_KEY")
You can obtain a free API key by registering at https://token.llm7.io/.
Contributing & Support
If you encounter bugs, have feature requests, or need help, please open an issue:
- GitHub Issues: https://github.com/chigwell/holiday_narrative_parser/issues
Author
Eugene Evstafev
📧 Email: hi@euegne.plus
🐙 GitHub: chigwell
License
This project is licensed under the MIT License. See the LICENSE file for details.
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 holiday_narrative_parser-2025.12.22105725.tar.gz.
File metadata
- Download URL: holiday_narrative_parser-2025.12.22105725.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dbd68e4936d518c83709e6db9a03c2b6e6f09ab718fc4dcd640c836400ed8f7d
|
|
| MD5 |
1ab4dde694fc6ed24dcc107ccb282876
|
|
| BLAKE2b-256 |
9f04eb8ae195d7e59cdac5cac236d59e3985987d621a9a20d8dbee71207f9ad0
|
File details
Details for the file holiday_narrative_parser-2025.12.22105725-py3-none-any.whl.
File metadata
- Download URL: holiday_narrative_parser-2025.12.22105725-py3-none-any.whl
- Upload date:
- Size: 5.6 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 |
e3a751948b1423c9c0c0150be80aa09c0017a4f3b6a549b22659c5d4b0643336
|
|
| MD5 |
3731388c6e1b77758e38c06521a996eb
|
|
| BLAKE2b-256 |
f8f95b8eaf4158404024b978417cafa2d6d9edce5b4b6d03336abae4965a8f6f
|