dmlog-agent
Agent framework for dmlog.ai — dungeon master tools for D&D and tabletop RPG campaigns. Manages session notes, NPCs, factions, locations, and encounters.
Features
- NPC Tracking — Track non-player characters with secrets, motivations, alignment, and status
- Faction Management — Organize factions with influence ratings, allies, and enemies
- Location Database — Map campaign locations with connections and notable features
- Encounter Builder — Create rated encounters with terrain, creatures, and objectives
- Session Notes — Record sessions with party members, loot, and quest progress
- Export/Import — JSON serialization for backup and portability
Installation
pip install dmlog-agent
Quick Start
from dmlog_agent import (
DMLogAgent,
NPC,
Faction,
Location,
Encounter,
EncounterDifficulty,
Alignment,
)
agent = DMLogAgent()
# Add NPCs
agent.add_npc(
name="Mira Black",
race="Half-Elf",
occupation="Thieves Guild Leader",
alignment=Alignment.ChaoticNeutral,
faction="Thieves Guild",
description="Silver-haired rogue with a sharp tongue",
secrets="Secretly funding the rebellion",
)
# Add a faction
agent.add_faction(
name="Thieves Guild",
leader="Mira Black",
headquarters="The Rusty Nail Tavern",
influence=65,
goals="Control the city's underground trade",
enemies=["City Guard", "Merchants Association"],
)
# Add a location
agent.add_location(
name="The Sunken Temple",
region="Blighted Coast",
description="An old temple half-submerged in black water",
notable_features=["Altar of the Deep Ones", "Trident statues"],
dangers="Carrion crawlers, water weird",
loot="500 gp, potion of water breathing",
connected_locations=["Blighted Coast", "Harbor Town"],
)
# Build an encounter
encounter = agent.build_encounter(
title="Temple Guardians",
creatures=["Carrion Crawler", "Water Weird"],
creature_count=4,
difficulty=EncounterDifficulty.Hard,
location="The Sunken Temple",
terrain="Partially flooded, crumbling pillars",
objectives="Protect the mage casting Detect Treasure",
)
# Plan a session
agent.plan_session(
session_number=1,
title="The Sunken Temple",
location="Blighted Coast",
party_members=["Aldric", "Lyra", "Thorne", "Zara"],
NPCs_present=["Mira Black"],
encounters=[encounter],
quest_progress="Found map to the Sunken Temple",
next_session_hooks="What lies beneath the altar?",
duration_minutes=180,
)
# Stats
stats = agent.get_campaign_stats()
print(f"Sessions run: {stats['total_sessions']}")
print(f"Total XP awarded: {stats['total_xp_awarded']}")
API Overview
NPCs
npc = agent.add_npc(
name="Grimjaw the Orc",
race="Orc",
occupation="Mercenary Captain",
alignment=Alignment.NeutralEvil,
location="Crossroads Inn",
faction="Iron Banner Company",
motivations="Gold and glory",
secrets="Works for a secret benefactor",
)
Factions
faction = agent.add_faction(
name="Iron Banner Company",
leader="Captain Vorn",
headquarters="Fort Ironhold",
influence=70,
allies=["Thieves Guild"],
enemies=["Shadow Covenant"],
)
Locations
loc = agent.add_location(
name="Crossroads Inn",
region="Heartland",
description="A busy inn at the intersection of two trade routes",
notable_features=["Trading post", "Job board", "Secret basement"],
connected_locations=["Capital City", "Border Fort"],
)
Encounters
enc = agent.build_encounter(
title="Ambush at the Crossroads",
creatures=["Bandit", "Bandit Captain"],
creature_count=6,
difficulty=EncounterDifficulty.Medium,
terrain="Open road, overturned cart cover",
objectives="Survive and capture the leader",
)
Development
pip install -e .
pytest tests/
License
MIT
Metadata
Release files for dmlog-agent 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dmlog_agent-0.1.0.tar.gz | 8.6 kB | Without provenance | Details for dmlog_agent-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dmlog_agent-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for dmlog_agent-0.1.0-py3-none-any.whl |
Total release size: 16.6 kB
Release files / dmlog_agent-0.1.0.tar.gz
| Download URL | dmlog_agent-0.1.0.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
28704c6a130ae85d60b45526822cade1e104da54e1d2d20c95080d64f1ce0a83
|
|
BLAKE2b-256 checksum How to use checksums |
c3c9f89e4f395248366e70283d36366fe773a64d40cdbc2f80d54cf48a625311
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Release files / dmlog_agent-0.1.0-py3-none-any.whl
| Download URL | dmlog_agent-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ea3dc965db7a017c5875a521763c47046cda8126e74ed2f73118567b05c815c3
|
|
BLAKE2b-256 checksum How to use checksums |
a92a1ce3a3c5a02c190f2522c2de35a111c98bdfdad3b4509f1c302702449e96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Security for dmlog-agent 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.