Skip to main content

Authoring Framework — domain schemas for AI-assisted creative writing applications

Project description

authoringfw — Authoring Framework

Domain schemas for AI-assisted creative writing applications.

Installation

pip install authoringfw

Quick Start

from authoringfw import StyleProfile, CharacterProfile, WorldContext, get_format

# Style constraints for prompt injection
style = StyleProfile(tone="melancholic", pov="third_limited", tense="past")
constraints = style.to_constraints()

# Character context
alice = CharacterProfile(
    name="Alice",
    role="protagonist",
    personality_traits=["brave", "curious"],
    arc="From fear to courage",
)
print(alice.to_context_string())

# World context
world = WorldContext(
    title="The Shattered Realms",
    genre="fantasy",
    world_rules=["Magic costs life force", "Dragons are extinct"],
)
print(world.to_context_string())

# Format profiles (novel, essay, series, scientific)
roman = get_format("roman")
print(roman.style_constraints)

Schemas

  • StyleProfile — tone, POV, tense, vocabulary, sentence rhythm
  • CharacterProfile — name, role, traits, backstory, arc, relationships
  • WorldContext — title, genre, setting, world rules, locations, lore
  • VersionMetadata — immutable content snapshot with hash, semver, LLM metadata
  • PhaseSnapshot — project state at a workflow phase boundary

Format Profiles

Built-in formats: roman, essay, serie, scientific

from authoringfw.formats.base import get_format, WorkflowPhase

novel = get_format("roman")
outline_steps = novel.steps_for_phase(WorkflowPhase.OUTLINE)

Adapter Interfaces

Protocol-based adapters — no inheritance required:

from authoringfw.adapters.interfaces import IStyleAdapter

class MyStyleAdapter:
    async def get_profile(self, style_id): ...
    async def analyze_text(self, text): ...
    def generate_style_constraints(self, profile): ...
    async def score_conformity(self, text, profile): ...

adapter = MyStyleAdapter()
assert isinstance(adapter, IStyleAdapter)  # True via @runtime_checkable

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

iil_authoringfw-0.3.0.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

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

iil_authoringfw-0.3.0-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file iil_authoringfw-0.3.0.tar.gz.

File metadata

  • Download URL: iil_authoringfw-0.3.0.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for iil_authoringfw-0.3.0.tar.gz
Algorithm Hash digest
SHA256 be3f8eaf6f2ee26c987b668084b61ac803ad20f9bc47ebd7f9420fa06375fef4
MD5 efd6c2fe0c35edfcf9a936c101d59aaf
BLAKE2b-256 e02d284f836ad65f52517a678cfe8e8df8dddd0f8d0c36fe687ece40e5cd781f

See more details on using hashes here.

File details

Details for the file iil_authoringfw-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for iil_authoringfw-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fe2922101b5879e9f2239472f4bd89cb310767d27d13d398e2734e86c9f41968
MD5 9afeecd90413f2ef1a3506153df23585
BLAKE2b-256 499c766cdfdca646999fd918d509bc19473d2f14cf87d5160c3ca23b7d396c7c

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