fabricatio_novel.models.novel

This module contains the models for the novel.

Classes

Chapter

A chapter in a novel.

Novel

A novel.

Module Contents

class fabricatio_novel.models.novel.Chapter(/, **data: Any)

Bases: fabricatio_core.models.generic.SketchedAble, fabricatio_capabilities.models.generic.PersistentAble, fabricatio_core.models.generic.Titled, fabricatio_capabilities.models.generic.WordCount

A chapter in a novel.

chapter_index: int

Zero-based index of this chapter within the novel.

content: str

The content of the chapter.

to_xhtml() str

Convert the chapter to XHTML format.

property exact_word_count: int

Calculate the exact word count of the chapter.

classmethod with_raw_content(raw: str, title: str, expected_word_count: int, chapter_index: int) Self

Create a chapter from raw text, converting to XHTML paragraphs.

classmethod from_plan_and_raw_content(chapter_plan: fabricatio_novel.models.plan.ChapterPlan, raw: str) Self

Create a chapter from a chapter plan and raw generated text.

class fabricatio_novel.models.novel.Novel(/, **data: Any)

Bases: fabricatio_core.models.generic.SketchedAble, fabricatio_capabilities.models.generic.PersistentAble, fabricatio_core.models.generic.Titled, fabricatio_capabilities.models.generic.WordCount

A novel.

synopsis: str

A summary of the novel’s plot.

chapters: List[Chapter]

List of chapters in the novel.

property exact_word_count: int

Calculate the exact word count of the novel.

property word_count_compliance_ratio: float

Calculate the compliance ratio of the novel’s word count.