Skip to main content

Create magnificient text-based manwhas via Python

Project description

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!

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

manwha-0.0.6.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

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

manwha-0.0.6-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file manwha-0.0.6.tar.gz.

File metadata

  • Download URL: manwha-0.0.6.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for manwha-0.0.6.tar.gz
Algorithm Hash digest
SHA256 82afc782b839dde1be27e214b6db82ed7e25ce9fac9762270695888d9f4786fa
MD5 c9805f3487301126b9abfcd6fd404d92
BLAKE2b-256 ae7cd3185c9c1c9fbf73c606f729993a43e57208e594d63a01b718f17a4f4d7a

See more details on using hashes here.

File details

Details for the file manwha-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: manwha-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for manwha-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 9c7a2d62135c1231b60edacc7c81fabe5fd4671f7992893e9ff54ce517233834
MD5 f85e91da937b5d824d6204ee46564932
BLAKE2b-256 c79e106e9367d230b81342bc7bc04e51926e252beb5768685ff356306d218013

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