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

authoringfw-0.2.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

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

authoringfw-0.2.0-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file authoringfw-0.2.0.tar.gz.

File metadata

  • Download URL: authoringfw-0.2.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for authoringfw-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b5e1733ead6164872d2e1f3da773c21603340dda0eca7b3b3c1e868b7fc05384
MD5 03b13f7ccd8ad8571620db0aaaaa9fe9
BLAKE2b-256 8648595bdf4d3c7e80776ff6f9e04afd8a1dcad8965d184ccba965175095c6be

See more details on using hashes here.

File details

Details for the file authoringfw-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: authoringfw-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for authoringfw-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 85bff3f16ba8d0ca76834b24638ae408f7dc5df29544d1508d7ad528e18136c2
MD5 d75a3c816bf4b6141cdadf13ab3ffc2f
BLAKE2b-256 6ba68caae7c94f6ee672aa4f84585bd159fd217545c8d6adc2fbd102933c6c79

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