Skip to main content

Manwha Module Documentation

A lightweight Python module for writing text-based manhwas with structured dialogue, narration, and character management. Output is rendered as clean, readable Markdown.


Table of Contents

  1. Installation & Setup
  2. Core Concepts
  3. API Reference
  4. Examples
  5. Output Format

Installation & Setup

pip install manwha

and

import manwha

That's it! Import the module and start building your story.


Core Concepts

Characters

Every story needs a cast. Define characters once, use them throughout.

hero = manwha.Character(
    role="Protagonist",
    name="Kaelen",
    age=19,
    power="Spatial Manipulation",
    powername="Void Step"
)

Characters are automatically registered in manwha.charList and appear in your final markdown output.

Chapters

Stories are organized into chapters. Set the active chapter before adding any content.

manwha.chapter(1, "The Awakening")

All subsequent narration, dialogue, and thoughts are added to this chapter until you call chapter() again.

Story Elements

Four main ways to add content to a chapter:

  • Narration — Scene description (with emphasis)
  • Silent Narration — Scene description (plain text)
  • Dialogue — Character speech
  • Thoughts — Internal monologue

API Reference

Character(role, name, age, power, powername="power", story=None)

Creates a character for your story.

Parameters:

  • role (str) — Character's role (e.g., "Protagonist", "Antagonist", "Ally")
  • name (str) — Character's name
  • age (int) — Character's age
  • power (str) — Description of their power
  • powername (str, optional) — Name of their power ability (default: "power")
  • story (str, optional) — Brief character backstory/description

Returns: Character object

Example:

vesper = manwha.Character(
    role="Antagonist",
    name="Vesper",
    age=22,
    power="Chronos Anchor",
    powername="Frozen Second",
    story="A rogue time manipulator seeking to rewrite the past"
)

chapter(number, title)

Sets the active chapter for incoming content.

Parameters:

  • number (int) — Chapter number
  • title (str) — Chapter title

Returns: None

Example:

manwha.chapter(1, "The Fracture")
manwha.chapter(2, "Rising Shadows")

narrate(text)

Adds a narrator description block with asterisk emphasis (rendered as italicized text).

Parameters:

  • text (str) — The narrative description

Returns: Formatted line string

Example:

manwha.narrate("The sky tears open like wet paper.")

Output:

* The sky tears open like wet paper. *

narrateSilent(text)

Adds a narrator description block without asterisks (plain text).

Parameters:

  • text (str) — The narrative description

Returns: Formatted line string

Example:

manwha.narrateSilent("Three hours later...")

Output:

Three hours later...

sceneBreak()

Adds a visual scene break separator (---).

Parameters: None

Returns: Separator string

Example:

manwha.sceneBreak()

Output:

---

character.Dialogue(text, target=None)

Character speaks. Creates a dialogue line.

Parameters:

  • text (str) — What the character says
  • target (Character, optional) — If dialogue is directed at another character, include them here

Returns: Formatted dialogue string

Example:

kaelen.Dialogue("Where am I?")
vesper.Dialogue("You're in my domain now.", target=kaelen)

Output:

**Kaelen**: "Where am I?"
**Vesper** (to Kaelen): "You're in my domain now."

character.Thought(text)

Character has an internal thought. Formats as thought (in parentheses).

Parameters:

  • text (str) — The internal monologue

Returns: Formatted thought string

Example:

kaelen.Thought("His power... it's evolved.")

Output:

**Kaelen**: (His power... it's evolved.)

writeMain(title, saveFile="manwha.md")

Exports your entire story to a Markdown file.

Parameters:

  • title (str) — Story title (appears as H1 header)
  • saveFile (str, optional) — Output filename (default: "manwha.md")

Returns: None (prints confirmation message)

Example:

manwha.writeMain("Echoes of the Aether", saveFile="my_story.md")

Examples

Simple Scene

import manwha

# Define character
hero = manwha.Character(
    role="Protagonist",
    name="Kaelen",
    age=19,
    power="Spatial Manipulation",
    powername="Void Step"
)

# Set chapter
manwha.chapter(1, "First Light")

# Add content
manwha.narrate("The morning sun breaks through the clouds.")
hero.Thought("Another day. Another battle.")
hero.Dialogue("Time to train.")

# Export
manwha.writeMain("My Story")

Multi-Character Scene with Scene Break

import manwha

# Characters
hero = manwha.Character("Protagonist", "Kaelen", 19, "Spatial Manipulation", "Void Step")
rival = manwha.Character("Antagonist", "Vesper", 22, "Chronos Anchor", "Frozen Second")

# Story
manwha.chapter(1, "The Confrontation")

manwha.narrate("They stand face to face in the ruins of the tower.")

hero.Dialogue("Vesper! Why have you done this?")
rival.Thought("Naive. He still doesn't understand.")
rival.Dialogue("Because the old world must fall.", target=hero)

manwha.sceneBreak()

manwha.narrateSilent("Hours later, the battle concluded...")

hero.Thought("I'm alive. But at what cost?")

manwha.writeMain("Clash of Titans")

Using Markdown Formatting in Text

You can use Markdown syntax directly in your text for emphasis:

manwha.narrate("Reality *bends* at the seams as **ancient power** awakens.")
hero.Dialogue("This is ***impossible***!")

Output Format

File Structure

The exported Markdown file has the following structure:

# Story Title

## Characters
- **Name** the Role (Age: XX, PowerName: Power Description)
- **Name** the Role (Age: XX, PowerName: Power Description)

---

## Story Script

### Chapter 1: Chapter Title

* Narrated scene description. *

**Character**: "Dialogue"

**Character**: (Internal thought)

---

### Chapter 2: Next Chapter Title

...

Character List

  • Auto-generated from all Character() instances
  • Shows: Name, Role, Age, Power Name, Power Description
  • Appears at the top of the file for easy reference

Story Script

  • Organized by chapter number (in order)
  • Narration appears in * asterisks *
  • Silent narration appears as plain text
  • Dialogue and thoughts are clearly attributed to characters
  • Scene breaks appear as ---

Tips & Tricks

1. Use narrateSilent() for Smooth Transitions

manwha.narrate("The battle raged for hours.")
manwha.sceneBreak()
manwha.narrateSilent("By dawn, the dust had settled.")

2. Markdown Emphasis Works Everywhere

hero.Dialogue("I won't let this ***happen*** again!")
manwha.narrate("The sky **burns** with **crimson** light.")

3. Direct Dialogue to Specific Characters

hero.Dialogue("Why did you betray us?", target=villain)
# Output: **Hero** (to Villain): "Why did you betray us?"

4. Use Story Parameter for Character Bio

mage = manwha.Character(
    role="Ally",
    name="Mira",
    age=18,
    power="Aether Sense",
    powername="Echo Sight",
    story="A gifted mage haunted by her past"
)

5. Multiple Chapters in One Script

manwha.chapter(1, "The Beginning")
# ... add content ...

manwha.chapter(2, "The Storm")
# ... add more content ...

manwha.chapter(3, "The Truth")
# ... add even more ...

manwha.writeMain("Epic Story")
# All chapters exported in order!

Global Variables

manwha.charList

List of all Character objects created. Auto-populated when you instantiate a character.

manwha.story_chapters

Dictionary of all chapters: {chapter_num: {"title": title, "lines": [story_elements]}}.

manwha.current_chapter

Currently active chapter number. Set via chapter() function.


License & Credits

Built for text-based manhwa enthusiasts. Have fun creating!

Metadata

Release files for manwha 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for manwha 0.0.6
File Size Uploaded Provenance Actions
manwha-0.0.6.tar.gz 12.3 kB Without provenance Details for manwha-0.0.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for manwha 0.0.6
File Interpreter ABI Platform Actions
manwha-0.0.6-py3-none-any.whl Python 3 none any Details for manwha-0.0.6-py3-none-any.whl

Total release size: 21.9 kB

Release files / manwha-0.0.6.tar.gz

Download URL manwha-0.0.6.tar.gz
Size 12.3 kB
Tags Source
SHA-256 checksum
How to use checksums
82afc782b839dde1be27e214b6db82ed7e25ce9fac9762270695888d9f4786fa
BLAKE2b-256 checksum
How to use checksums
ae7cd3185c9c1c9fbf73c606f729993a43e57208e594d63a01b718f17a4f4d7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / manwha-0.0.6-py3-none-any.whl

Download URL manwha-0.0.6-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9c7a2d62135c1231b60edacc7c81fabe5fd4671f7992893e9ff54ce517233834
BLAKE2b-256 checksum
How to use checksums
c79e106e9367d230b81342bc7bc04e51926e252beb5768685ff356306d218013
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Security for manwha 0.0.6

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page