manwha 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
manwha-0.0.1/LICENSE ADDED
File without changes
manwha-0.0.1/PKG-INFO ADDED
@@ -0,0 +1,429 @@
1
+ Metadata-Version: 2.4
2
+ Name: manwha
3
+ Version: 0.0.1
4
+ Summary: Create magnificient text-based manwhas via Python
5
+ Author-email: Gurumyaum Bryan Sharma <mewannacode@gmail.com>
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: License :: OSI Approved :: MIT License
8
+ Classifier: Operating System :: OS Independent
9
+ Requires-Python: >=3.7
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ Dynamic: license-file
13
+
14
+ # Manwha Module Documentation
15
+
16
+ A lightweight Python module for writing **text-based manhwas** with structured dialogue, narration, and character management. Output is rendered as clean, readable Markdown.
17
+
18
+ ---
19
+
20
+ ## Table of Contents
21
+ 1. [Installation & Setup](#installation--setup)
22
+ 2. [Core Concepts](#core-concepts)
23
+ 3. [API Reference](#api-reference)
24
+ 4. [Examples](#examples)
25
+ 5. [Output Format](#output-format)
26
+
27
+ ---
28
+
29
+ ## Installation & Setup
30
+
31
+ ```bash
32
+ pip install manwha
33
+ ```
34
+
35
+ and
36
+
37
+ ```python
38
+ import manwha
39
+ ```
40
+
41
+ That's it! Import the module and start building your story.
42
+
43
+ ---
44
+
45
+ ## Core Concepts
46
+
47
+ ### Characters
48
+ Every story needs a cast. Define characters once, use them throughout.
49
+
50
+ ```python
51
+ hero = manwha.Character(
52
+ role="Protagonist",
53
+ name="Kaelen",
54
+ age=19,
55
+ power="Spatial Manipulation",
56
+ powername="Void Step"
57
+ )
58
+ ```
59
+
60
+ Characters are automatically registered in `manwha.charList` and appear in your final markdown output.
61
+
62
+ ### Chapters
63
+ Stories are organized into chapters. Set the active chapter before adding any content.
64
+
65
+ ```python
66
+ manwha.chapter(1, "The Awakening")
67
+ ```
68
+
69
+ All subsequent narration, dialogue, and thoughts are added to this chapter until you call `chapter()` again.
70
+
71
+ ### Story Elements
72
+ Four main ways to add content to a chapter:
73
+ - **Narration** — Scene description (with emphasis)
74
+ - **Silent Narration** — Scene description (plain text)
75
+ - **Dialogue** — Character speech
76
+ - **Thoughts** — Internal monologue
77
+
78
+ ---
79
+
80
+ ## API Reference
81
+
82
+ ### `Character(role, name, age, power, powername="power", story=None)`
83
+
84
+ Creates a character for your story.
85
+
86
+ **Parameters:**
87
+ - `role` (str) — Character's role (e.g., "Protagonist", "Antagonist", "Ally")
88
+ - `name` (str) — Character's name
89
+ - `age` (int) — Character's age
90
+ - `power` (str) — Description of their power
91
+ - `powername` (str, optional) — Name of their power ability (default: `"power"`)
92
+ - `story` (str, optional) — Brief character backstory/description
93
+
94
+ **Returns:** Character object
95
+
96
+ **Example:**
97
+ ```python
98
+ vesper = manwha.Character(
99
+ role="Antagonist",
100
+ name="Vesper",
101
+ age=22,
102
+ power="Chronos Anchor",
103
+ powername="Frozen Second",
104
+ story="A rogue time manipulator seeking to rewrite the past"
105
+ )
106
+ ```
107
+
108
+ ---
109
+
110
+ ### `chapter(number, title)`
111
+
112
+ Sets the active chapter for incoming content.
113
+
114
+ **Parameters:**
115
+ - `number` (int) — Chapter number
116
+ - `title` (str) — Chapter title
117
+
118
+ **Returns:** None
119
+
120
+ **Example:**
121
+ ```python
122
+ manwha.chapter(1, "The Fracture")
123
+ manwha.chapter(2, "Rising Shadows")
124
+ ```
125
+
126
+ ---
127
+
128
+ ### `narrate(text)`
129
+
130
+ Adds a narrator description block with asterisk emphasis (rendered as italicized text).
131
+
132
+ **Parameters:**
133
+ - `text` (str) — The narrative description
134
+
135
+ **Returns:** Formatted line string
136
+
137
+ **Example:**
138
+ ```python
139
+ manwha.narrate("The sky tears open like wet paper.")
140
+ ```
141
+
142
+ **Output:**
143
+ ```
144
+ * The sky tears open like wet paper. *
145
+ ```
146
+
147
+ ---
148
+
149
+ ### `narrateSilent(text)`
150
+
151
+ Adds a narrator description block **without** asterisks (plain text).
152
+
153
+ **Parameters:**
154
+ - `text` (str) — The narrative description
155
+
156
+ **Returns:** Formatted line string
157
+
158
+ **Example:**
159
+ ```python
160
+ manwha.narrateSilent("Three hours later...")
161
+ ```
162
+
163
+ **Output:**
164
+ ```
165
+ Three hours later...
166
+ ```
167
+
168
+ ---
169
+
170
+ ### `sceneBreak()`
171
+
172
+ Adds a visual scene break separator (`---`).
173
+
174
+ **Parameters:** None
175
+
176
+ **Returns:** Separator string
177
+
178
+ **Example:**
179
+ ```python
180
+ manwha.sceneBreak()
181
+ ```
182
+
183
+ **Output:**
184
+ ```
185
+ ---
186
+ ```
187
+
188
+ ---
189
+
190
+ ### `character.Dialogue(text, target=None)`
191
+
192
+ Character speaks. Creates a dialogue line.
193
+
194
+ **Parameters:**
195
+ - `text` (str) — What the character says
196
+ - `target` (Character, optional) — If dialogue is directed at another character, include them here
197
+
198
+ **Returns:** Formatted dialogue string
199
+
200
+ **Example:**
201
+ ```python
202
+ kaelen.Dialogue("Where am I?")
203
+ vesper.Dialogue("You're in my domain now.", target=kaelen)
204
+ ```
205
+
206
+ **Output:**
207
+ ```
208
+ **Kaelen**: "Where am I?"
209
+ **Vesper** (to Kaelen): "You're in my domain now."
210
+ ```
211
+
212
+ ---
213
+
214
+ ### `character.Thought(text)`
215
+
216
+ Character has an internal thought. Formats as thought (in parentheses).
217
+
218
+ **Parameters:**
219
+ - `text` (str) — The internal monologue
220
+
221
+ **Returns:** Formatted thought string
222
+
223
+ **Example:**
224
+ ```python
225
+ kaelen.Thought("His power... it's evolved.")
226
+ ```
227
+
228
+ **Output:**
229
+ ```
230
+ **Kaelen**: (His power... it's evolved.)
231
+ ```
232
+
233
+ ---
234
+
235
+ ### `writeMain(title, saveFile="manwha.md")`
236
+
237
+ Exports your entire story to a Markdown file.
238
+
239
+ **Parameters:**
240
+ - `title` (str) — Story title (appears as H1 header)
241
+ - `saveFile` (str, optional) — Output filename (default: `"manwha.md"`)
242
+
243
+ **Returns:** None (prints confirmation message)
244
+
245
+ **Example:**
246
+ ```python
247
+ manwha.writeMain("Echoes of the Aether", saveFile="my_story.md")
248
+ ```
249
+
250
+ ---
251
+
252
+ ## Examples
253
+
254
+ ### Simple Scene
255
+ ```python
256
+ import manwha
257
+
258
+ # Define character
259
+ hero = manwha.Character(
260
+ role="Protagonist",
261
+ name="Kaelen",
262
+ age=19,
263
+ power="Spatial Manipulation",
264
+ powername="Void Step"
265
+ )
266
+
267
+ # Set chapter
268
+ manwha.chapter(1, "First Light")
269
+
270
+ # Add content
271
+ manwha.narrate("The morning sun breaks through the clouds.")
272
+ hero.Thought("Another day. Another battle.")
273
+ hero.Dialogue("Time to train.")
274
+
275
+ # Export
276
+ manwha.writeMain("My Story")
277
+ ```
278
+
279
+ ---
280
+
281
+ ### Multi-Character Scene with Scene Break
282
+ ```python
283
+ import manwha
284
+
285
+ # Characters
286
+ hero = manwha.Character("Protagonist", "Kaelen", 19, "Spatial Manipulation", "Void Step")
287
+ rival = manwha.Character("Antagonist", "Vesper", 22, "Chronos Anchor", "Frozen Second")
288
+
289
+ # Story
290
+ manwha.chapter(1, "The Confrontation")
291
+
292
+ manwha.narrate("They stand face to face in the ruins of the tower.")
293
+
294
+ hero.Dialogue("Vesper! Why have you done this?")
295
+ rival.Thought("Naive. He still doesn't understand.")
296
+ rival.Dialogue("Because the old world must fall.", target=hero)
297
+
298
+ manwha.sceneBreak()
299
+
300
+ manwha.narrateSilent("Hours later, the battle concluded...")
301
+
302
+ hero.Thought("I'm alive. But at what cost?")
303
+
304
+ manwha.writeMain("Clash of Titans")
305
+ ```
306
+
307
+ ---
308
+
309
+ ### Using Markdown Formatting in Text
310
+ You can use **Markdown syntax** directly in your text for emphasis:
311
+
312
+ ```python
313
+ manwha.narrate("Reality *bends* at the seams as **ancient power** awakens.")
314
+ hero.Dialogue("This is ***impossible***!")
315
+ ```
316
+
317
+ ---
318
+
319
+ ## Output Format
320
+
321
+ ### File Structure
322
+ The exported Markdown file has the following structure:
323
+
324
+ ```
325
+ # Story Title
326
+
327
+ ## Characters
328
+ - **Name** the Role (Age: XX, PowerName: Power Description)
329
+ - **Name** the Role (Age: XX, PowerName: Power Description)
330
+
331
+ ---
332
+
333
+ ## Story Script
334
+
335
+ ### Chapter 1: Chapter Title
336
+
337
+ * Narrated scene description. *
338
+
339
+ **Character**: "Dialogue"
340
+
341
+ **Character**: (Internal thought)
342
+
343
+ ---
344
+
345
+ ### Chapter 2: Next Chapter Title
346
+
347
+ ...
348
+ ```
349
+
350
+ ### Character List
351
+ - Auto-generated from all `Character()` instances
352
+ - Shows: Name, Role, Age, Power Name, Power Description
353
+ - Appears at the top of the file for easy reference
354
+
355
+ ### Story Script
356
+ - Organized by chapter number (in order)
357
+ - Narration appears in `* asterisks *`
358
+ - Silent narration appears as plain text
359
+ - Dialogue and thoughts are clearly attributed to characters
360
+ - Scene breaks appear as `---`
361
+
362
+ ---
363
+
364
+ ## Tips & Tricks
365
+
366
+ ### 1. Use `narrateSilent()` for Smooth Transitions
367
+ ```python
368
+ manwha.narrate("The battle raged for hours.")
369
+ manwha.sceneBreak()
370
+ manwha.narrateSilent("By dawn, the dust had settled.")
371
+ ```
372
+
373
+ ### 2. Markdown Emphasis Works Everywhere
374
+ ```python
375
+ hero.Dialogue("I won't let this ***happen*** again!")
376
+ manwha.narrate("The sky **burns** with **crimson** light.")
377
+ ```
378
+
379
+ ### 3. Direct Dialogue to Specific Characters
380
+ ```python
381
+ hero.Dialogue("Why did you betray us?", target=villain)
382
+ # Output: **Hero** (to Villain): "Why did you betray us?"
383
+ ```
384
+
385
+ ### 4. Use Story Parameter for Character Bio
386
+ ```python
387
+ mage = manwha.Character(
388
+ role="Ally",
389
+ name="Mira",
390
+ age=18,
391
+ power="Aether Sense",
392
+ powername="Echo Sight",
393
+ story="A gifted mage haunted by her past"
394
+ )
395
+ ```
396
+
397
+ ### 5. Multiple Chapters in One Script
398
+ ```python
399
+ manwha.chapter(1, "The Beginning")
400
+ # ... add content ...
401
+
402
+ manwha.chapter(2, "The Storm")
403
+ # ... add more content ...
404
+
405
+ manwha.chapter(3, "The Truth")
406
+ # ... add even more ...
407
+
408
+ manwha.writeMain("Epic Story")
409
+ # All chapters exported in order!
410
+ ```
411
+
412
+ ---
413
+
414
+ ## Global Variables
415
+
416
+ ### `manwha.charList`
417
+ List of all `Character` objects created. Auto-populated when you instantiate a character.
418
+
419
+ ### `manwha.story_chapters`
420
+ Dictionary of all chapters: `{chapter_num: {"title": title, "lines": [story_elements]}}`.
421
+
422
+ ### `manwha.current_chapter`
423
+ Currently active chapter number. Set via `chapter()` function.
424
+
425
+ ---
426
+
427
+ ## License & Credits
428
+
429
+ Built for text-based manhwa enthusiasts. Have fun creating!
manwha-0.0.1/README.md ADDED
@@ -0,0 +1,416 @@
1
+ # Manwha Module Documentation
2
+
3
+ A lightweight Python module for writing **text-based manhwas** with structured dialogue, narration, and character management. Output is rendered as clean, readable Markdown.
4
+
5
+ ---
6
+
7
+ ## Table of Contents
8
+ 1. [Installation & Setup](#installation--setup)
9
+ 2. [Core Concepts](#core-concepts)
10
+ 3. [API Reference](#api-reference)
11
+ 4. [Examples](#examples)
12
+ 5. [Output Format](#output-format)
13
+
14
+ ---
15
+
16
+ ## Installation & Setup
17
+
18
+ ```bash
19
+ pip install manwha
20
+ ```
21
+
22
+ and
23
+
24
+ ```python
25
+ import manwha
26
+ ```
27
+
28
+ That's it! Import the module and start building your story.
29
+
30
+ ---
31
+
32
+ ## Core Concepts
33
+
34
+ ### Characters
35
+ Every story needs a cast. Define characters once, use them throughout.
36
+
37
+ ```python
38
+ hero = manwha.Character(
39
+ role="Protagonist",
40
+ name="Kaelen",
41
+ age=19,
42
+ power="Spatial Manipulation",
43
+ powername="Void Step"
44
+ )
45
+ ```
46
+
47
+ Characters are automatically registered in `manwha.charList` and appear in your final markdown output.
48
+
49
+ ### Chapters
50
+ Stories are organized into chapters. Set the active chapter before adding any content.
51
+
52
+ ```python
53
+ manwha.chapter(1, "The Awakening")
54
+ ```
55
+
56
+ All subsequent narration, dialogue, and thoughts are added to this chapter until you call `chapter()` again.
57
+
58
+ ### Story Elements
59
+ Four main ways to add content to a chapter:
60
+ - **Narration** — Scene description (with emphasis)
61
+ - **Silent Narration** — Scene description (plain text)
62
+ - **Dialogue** — Character speech
63
+ - **Thoughts** — Internal monologue
64
+
65
+ ---
66
+
67
+ ## API Reference
68
+
69
+ ### `Character(role, name, age, power, powername="power", story=None)`
70
+
71
+ Creates a character for your story.
72
+
73
+ **Parameters:**
74
+ - `role` (str) — Character's role (e.g., "Protagonist", "Antagonist", "Ally")
75
+ - `name` (str) — Character's name
76
+ - `age` (int) — Character's age
77
+ - `power` (str) — Description of their power
78
+ - `powername` (str, optional) — Name of their power ability (default: `"power"`)
79
+ - `story` (str, optional) — Brief character backstory/description
80
+
81
+ **Returns:** Character object
82
+
83
+ **Example:**
84
+ ```python
85
+ vesper = manwha.Character(
86
+ role="Antagonist",
87
+ name="Vesper",
88
+ age=22,
89
+ power="Chronos Anchor",
90
+ powername="Frozen Second",
91
+ story="A rogue time manipulator seeking to rewrite the past"
92
+ )
93
+ ```
94
+
95
+ ---
96
+
97
+ ### `chapter(number, title)`
98
+
99
+ Sets the active chapter for incoming content.
100
+
101
+ **Parameters:**
102
+ - `number` (int) — Chapter number
103
+ - `title` (str) — Chapter title
104
+
105
+ **Returns:** None
106
+
107
+ **Example:**
108
+ ```python
109
+ manwha.chapter(1, "The Fracture")
110
+ manwha.chapter(2, "Rising Shadows")
111
+ ```
112
+
113
+ ---
114
+
115
+ ### `narrate(text)`
116
+
117
+ Adds a narrator description block with asterisk emphasis (rendered as italicized text).
118
+
119
+ **Parameters:**
120
+ - `text` (str) — The narrative description
121
+
122
+ **Returns:** Formatted line string
123
+
124
+ **Example:**
125
+ ```python
126
+ manwha.narrate("The sky tears open like wet paper.")
127
+ ```
128
+
129
+ **Output:**
130
+ ```
131
+ * The sky tears open like wet paper. *
132
+ ```
133
+
134
+ ---
135
+
136
+ ### `narrateSilent(text)`
137
+
138
+ Adds a narrator description block **without** asterisks (plain text).
139
+
140
+ **Parameters:**
141
+ - `text` (str) — The narrative description
142
+
143
+ **Returns:** Formatted line string
144
+
145
+ **Example:**
146
+ ```python
147
+ manwha.narrateSilent("Three hours later...")
148
+ ```
149
+
150
+ **Output:**
151
+ ```
152
+ Three hours later...
153
+ ```
154
+
155
+ ---
156
+
157
+ ### `sceneBreak()`
158
+
159
+ Adds a visual scene break separator (`---`).
160
+
161
+ **Parameters:** None
162
+
163
+ **Returns:** Separator string
164
+
165
+ **Example:**
166
+ ```python
167
+ manwha.sceneBreak()
168
+ ```
169
+
170
+ **Output:**
171
+ ```
172
+ ---
173
+ ```
174
+
175
+ ---
176
+
177
+ ### `character.Dialogue(text, target=None)`
178
+
179
+ Character speaks. Creates a dialogue line.
180
+
181
+ **Parameters:**
182
+ - `text` (str) — What the character says
183
+ - `target` (Character, optional) — If dialogue is directed at another character, include them here
184
+
185
+ **Returns:** Formatted dialogue string
186
+
187
+ **Example:**
188
+ ```python
189
+ kaelen.Dialogue("Where am I?")
190
+ vesper.Dialogue("You're in my domain now.", target=kaelen)
191
+ ```
192
+
193
+ **Output:**
194
+ ```
195
+ **Kaelen**: "Where am I?"
196
+ **Vesper** (to Kaelen): "You're in my domain now."
197
+ ```
198
+
199
+ ---
200
+
201
+ ### `character.Thought(text)`
202
+
203
+ Character has an internal thought. Formats as thought (in parentheses).
204
+
205
+ **Parameters:**
206
+ - `text` (str) — The internal monologue
207
+
208
+ **Returns:** Formatted thought string
209
+
210
+ **Example:**
211
+ ```python
212
+ kaelen.Thought("His power... it's evolved.")
213
+ ```
214
+
215
+ **Output:**
216
+ ```
217
+ **Kaelen**: (His power... it's evolved.)
218
+ ```
219
+
220
+ ---
221
+
222
+ ### `writeMain(title, saveFile="manwha.md")`
223
+
224
+ Exports your entire story to a Markdown file.
225
+
226
+ **Parameters:**
227
+ - `title` (str) — Story title (appears as H1 header)
228
+ - `saveFile` (str, optional) — Output filename (default: `"manwha.md"`)
229
+
230
+ **Returns:** None (prints confirmation message)
231
+
232
+ **Example:**
233
+ ```python
234
+ manwha.writeMain("Echoes of the Aether", saveFile="my_story.md")
235
+ ```
236
+
237
+ ---
238
+
239
+ ## Examples
240
+
241
+ ### Simple Scene
242
+ ```python
243
+ import manwha
244
+
245
+ # Define character
246
+ hero = manwha.Character(
247
+ role="Protagonist",
248
+ name="Kaelen",
249
+ age=19,
250
+ power="Spatial Manipulation",
251
+ powername="Void Step"
252
+ )
253
+
254
+ # Set chapter
255
+ manwha.chapter(1, "First Light")
256
+
257
+ # Add content
258
+ manwha.narrate("The morning sun breaks through the clouds.")
259
+ hero.Thought("Another day. Another battle.")
260
+ hero.Dialogue("Time to train.")
261
+
262
+ # Export
263
+ manwha.writeMain("My Story")
264
+ ```
265
+
266
+ ---
267
+
268
+ ### Multi-Character Scene with Scene Break
269
+ ```python
270
+ import manwha
271
+
272
+ # Characters
273
+ hero = manwha.Character("Protagonist", "Kaelen", 19, "Spatial Manipulation", "Void Step")
274
+ rival = manwha.Character("Antagonist", "Vesper", 22, "Chronos Anchor", "Frozen Second")
275
+
276
+ # Story
277
+ manwha.chapter(1, "The Confrontation")
278
+
279
+ manwha.narrate("They stand face to face in the ruins of the tower.")
280
+
281
+ hero.Dialogue("Vesper! Why have you done this?")
282
+ rival.Thought("Naive. He still doesn't understand.")
283
+ rival.Dialogue("Because the old world must fall.", target=hero)
284
+
285
+ manwha.sceneBreak()
286
+
287
+ manwha.narrateSilent("Hours later, the battle concluded...")
288
+
289
+ hero.Thought("I'm alive. But at what cost?")
290
+
291
+ manwha.writeMain("Clash of Titans")
292
+ ```
293
+
294
+ ---
295
+
296
+ ### Using Markdown Formatting in Text
297
+ You can use **Markdown syntax** directly in your text for emphasis:
298
+
299
+ ```python
300
+ manwha.narrate("Reality *bends* at the seams as **ancient power** awakens.")
301
+ hero.Dialogue("This is ***impossible***!")
302
+ ```
303
+
304
+ ---
305
+
306
+ ## Output Format
307
+
308
+ ### File Structure
309
+ The exported Markdown file has the following structure:
310
+
311
+ ```
312
+ # Story Title
313
+
314
+ ## Characters
315
+ - **Name** the Role (Age: XX, PowerName: Power Description)
316
+ - **Name** the Role (Age: XX, PowerName: Power Description)
317
+
318
+ ---
319
+
320
+ ## Story Script
321
+
322
+ ### Chapter 1: Chapter Title
323
+
324
+ * Narrated scene description. *
325
+
326
+ **Character**: "Dialogue"
327
+
328
+ **Character**: (Internal thought)
329
+
330
+ ---
331
+
332
+ ### Chapter 2: Next Chapter Title
333
+
334
+ ...
335
+ ```
336
+
337
+ ### Character List
338
+ - Auto-generated from all `Character()` instances
339
+ - Shows: Name, Role, Age, Power Name, Power Description
340
+ - Appears at the top of the file for easy reference
341
+
342
+ ### Story Script
343
+ - Organized by chapter number (in order)
344
+ - Narration appears in `* asterisks *`
345
+ - Silent narration appears as plain text
346
+ - Dialogue and thoughts are clearly attributed to characters
347
+ - Scene breaks appear as `---`
348
+
349
+ ---
350
+
351
+ ## Tips & Tricks
352
+
353
+ ### 1. Use `narrateSilent()` for Smooth Transitions
354
+ ```python
355
+ manwha.narrate("The battle raged for hours.")
356
+ manwha.sceneBreak()
357
+ manwha.narrateSilent("By dawn, the dust had settled.")
358
+ ```
359
+
360
+ ### 2. Markdown Emphasis Works Everywhere
361
+ ```python
362
+ hero.Dialogue("I won't let this ***happen*** again!")
363
+ manwha.narrate("The sky **burns** with **crimson** light.")
364
+ ```
365
+
366
+ ### 3. Direct Dialogue to Specific Characters
367
+ ```python
368
+ hero.Dialogue("Why did you betray us?", target=villain)
369
+ # Output: **Hero** (to Villain): "Why did you betray us?"
370
+ ```
371
+
372
+ ### 4. Use Story Parameter for Character Bio
373
+ ```python
374
+ mage = manwha.Character(
375
+ role="Ally",
376
+ name="Mira",
377
+ age=18,
378
+ power="Aether Sense",
379
+ powername="Echo Sight",
380
+ story="A gifted mage haunted by her past"
381
+ )
382
+ ```
383
+
384
+ ### 5. Multiple Chapters in One Script
385
+ ```python
386
+ manwha.chapter(1, "The Beginning")
387
+ # ... add content ...
388
+
389
+ manwha.chapter(2, "The Storm")
390
+ # ... add more content ...
391
+
392
+ manwha.chapter(3, "The Truth")
393
+ # ... add even more ...
394
+
395
+ manwha.writeMain("Epic Story")
396
+ # All chapters exported in order!
397
+ ```
398
+
399
+ ---
400
+
401
+ ## Global Variables
402
+
403
+ ### `manwha.charList`
404
+ List of all `Character` objects created. Auto-populated when you instantiate a character.
405
+
406
+ ### `manwha.story_chapters`
407
+ Dictionary of all chapters: `{chapter_num: {"title": title, "lines": [story_elements]}}`.
408
+
409
+ ### `manwha.current_chapter`
410
+ Currently active chapter number. Set via `chapter()` function.
411
+
412
+ ---
413
+
414
+ ## License & Credits
415
+
416
+ Built for text-based manhwa enthusiasts. Have fun creating!
@@ -0,0 +1,18 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "manwha"
7
+ version = "0.0.1"
8
+ authors = [
9
+ { name="Gurumyaum Bryan Sharma", email="mewannacode@gmail.com" },
10
+ ]
11
+ description = "Create magnificient text-based manwhas via Python"
12
+ readme = "README.md"
13
+ requires-python = ">=3.7"
14
+ classifiers = [
15
+ "Programming Language :: Python :: 3",
16
+ "License :: OSI Approved :: MIT License",
17
+ "Operating System :: OS Independent",
18
+ ]
manwha-0.0.1/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
File without changes
@@ -0,0 +1,108 @@
1
+ charList = []
2
+ # Global tracking for chapters: {chapter_num: {"title": title, "lines": [story_elements]}}
3
+ story_chapters = {}
4
+ current_chapter = None
5
+
6
+ def chapter(number: int, title: str):
7
+ """Sets the current active chapter for incoming dialogue, thoughts, and narration."""
8
+ global current_chapter
9
+ current_chapter = number
10
+ if number not in story_chapters:
11
+ story_chapters[number] = {"title": title, "lines": []}
12
+
13
+ def narrate(text: str):
14
+ """Adds a standard narrator description block to the current chapter."""
15
+ line = f"\n* {text} *\n" # Italicized standalone text block for scene setting
16
+ if current_chapter is not None:
17
+ story_chapters[current_chapter]["lines"].append(line)
18
+ return line
19
+
20
+ def narrateSilent(text: str):
21
+ """Adds a narrator description block WITHOUT asterisks (raw text)."""
22
+ line = f"\n{text}\n"
23
+ if current_chapter is not None:
24
+ story_chapters[current_chapter]["lines"].append(line)
25
+ return line
26
+
27
+ def sceneBreak():
28
+ """Adds a visual scene break (--- separator)."""
29
+ line = "\n---\n"
30
+ if current_chapter is not None:
31
+ story_chapters[current_chapter]["lines"].append(line)
32
+ return line
33
+
34
+ class Dialogue:
35
+ def __init__(self, character):
36
+ self.character = character
37
+
38
+ def __call__(self, text, target=None):
39
+ # Check if a target character object was provided
40
+ if target:
41
+ line = f"**{self.character.name}** (to {target.name}): \"{text}\""
42
+ else:
43
+ line = f"**{self.character.name}**: \"{text}\""
44
+
45
+ if current_chapter is not None:
46
+ story_chapters[current_chapter]["lines"].append(line)
47
+ return line
48
+
49
+
50
+ class Thought:
51
+ def __init__(self, character):
52
+ self.character = character
53
+
54
+ def __call__(self, text):
55
+ # Format thought as italicized text inside brackets
56
+ line = f"**{self.character.name}**: ({text})"
57
+ if current_chapter is not None:
58
+ story_chapters[current_chapter]["lines"].append(line)
59
+ return line
60
+
61
+ class Character:
62
+ def __init__(self, role, name, age, power, powername="power", story=None):
63
+ self.role = role
64
+ self.name = name
65
+ self.age = age
66
+ self.power = power
67
+ self.powername = powername
68
+ self.story = story
69
+ charList.append(self)
70
+
71
+ # Link both Dialogue and Thought to the character
72
+ self.Dialogue = Dialogue(self)
73
+ self.Thought = Thought(self)
74
+
75
+ def __str__(self):
76
+ info = f"- **{self.name}** the {self.role} (Age: {self.age}, {self.powername}: {self.power})"
77
+ if self.story:
78
+ info += f" *-> {self.story}*"
79
+ return info
80
+
81
+ def writeMain(title, saveFile="manwha.md"):
82
+ with open(saveFile, "w", encoding="utf-8") as f:
83
+ # Title
84
+ f.write(f"# {title}\n\n")
85
+
86
+ # Character Profiles
87
+ f.write(f"## Characters\n")
88
+ for character in charList:
89
+ f.write(f"{character}\n")
90
+ f.write("\n---\n\n") # Visual line break
91
+
92
+ # Chapters and Script layout
93
+ f.write(f"## Story Script\n\n")
94
+ for num in sorted(story_chapters.keys()):
95
+ ch_title = story_chapters[num]["title"]
96
+ f.write(f"### Chapter {num}: {ch_title}\n\n")
97
+
98
+ for line in story_chapters[num]["lines"]:
99
+ # Narration lines don't need double spaces at the end, dialogue does
100
+ if line.startswith("\n*"):
101
+ f.write(f"{line}\n")
102
+ else:
103
+ f.write(f"{line} \n")
104
+ f.write("\n")
105
+
106
+ print(f"Story has been written to '{saveFile}'")
107
+
108
+ print("Incase you didnt read README.md, use writeMain(title, saveFile) to write the manwha.")
@@ -0,0 +1,429 @@
1
+ Metadata-Version: 2.4
2
+ Name: manwha
3
+ Version: 0.0.1
4
+ Summary: Create magnificient text-based manwhas via Python
5
+ Author-email: Gurumyaum Bryan Sharma <mewannacode@gmail.com>
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: License :: OSI Approved :: MIT License
8
+ Classifier: Operating System :: OS Independent
9
+ Requires-Python: >=3.7
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ Dynamic: license-file
13
+
14
+ # Manwha Module Documentation
15
+
16
+ A lightweight Python module for writing **text-based manhwas** with structured dialogue, narration, and character management. Output is rendered as clean, readable Markdown.
17
+
18
+ ---
19
+
20
+ ## Table of Contents
21
+ 1. [Installation & Setup](#installation--setup)
22
+ 2. [Core Concepts](#core-concepts)
23
+ 3. [API Reference](#api-reference)
24
+ 4. [Examples](#examples)
25
+ 5. [Output Format](#output-format)
26
+
27
+ ---
28
+
29
+ ## Installation & Setup
30
+
31
+ ```bash
32
+ pip install manwha
33
+ ```
34
+
35
+ and
36
+
37
+ ```python
38
+ import manwha
39
+ ```
40
+
41
+ That's it! Import the module and start building your story.
42
+
43
+ ---
44
+
45
+ ## Core Concepts
46
+
47
+ ### Characters
48
+ Every story needs a cast. Define characters once, use them throughout.
49
+
50
+ ```python
51
+ hero = manwha.Character(
52
+ role="Protagonist",
53
+ name="Kaelen",
54
+ age=19,
55
+ power="Spatial Manipulation",
56
+ powername="Void Step"
57
+ )
58
+ ```
59
+
60
+ Characters are automatically registered in `manwha.charList` and appear in your final markdown output.
61
+
62
+ ### Chapters
63
+ Stories are organized into chapters. Set the active chapter before adding any content.
64
+
65
+ ```python
66
+ manwha.chapter(1, "The Awakening")
67
+ ```
68
+
69
+ All subsequent narration, dialogue, and thoughts are added to this chapter until you call `chapter()` again.
70
+
71
+ ### Story Elements
72
+ Four main ways to add content to a chapter:
73
+ - **Narration** — Scene description (with emphasis)
74
+ - **Silent Narration** — Scene description (plain text)
75
+ - **Dialogue** — Character speech
76
+ - **Thoughts** — Internal monologue
77
+
78
+ ---
79
+
80
+ ## API Reference
81
+
82
+ ### `Character(role, name, age, power, powername="power", story=None)`
83
+
84
+ Creates a character for your story.
85
+
86
+ **Parameters:**
87
+ - `role` (str) — Character's role (e.g., "Protagonist", "Antagonist", "Ally")
88
+ - `name` (str) — Character's name
89
+ - `age` (int) — Character's age
90
+ - `power` (str) — Description of their power
91
+ - `powername` (str, optional) — Name of their power ability (default: `"power"`)
92
+ - `story` (str, optional) — Brief character backstory/description
93
+
94
+ **Returns:** Character object
95
+
96
+ **Example:**
97
+ ```python
98
+ vesper = manwha.Character(
99
+ role="Antagonist",
100
+ name="Vesper",
101
+ age=22,
102
+ power="Chronos Anchor",
103
+ powername="Frozen Second",
104
+ story="A rogue time manipulator seeking to rewrite the past"
105
+ )
106
+ ```
107
+
108
+ ---
109
+
110
+ ### `chapter(number, title)`
111
+
112
+ Sets the active chapter for incoming content.
113
+
114
+ **Parameters:**
115
+ - `number` (int) — Chapter number
116
+ - `title` (str) — Chapter title
117
+
118
+ **Returns:** None
119
+
120
+ **Example:**
121
+ ```python
122
+ manwha.chapter(1, "The Fracture")
123
+ manwha.chapter(2, "Rising Shadows")
124
+ ```
125
+
126
+ ---
127
+
128
+ ### `narrate(text)`
129
+
130
+ Adds a narrator description block with asterisk emphasis (rendered as italicized text).
131
+
132
+ **Parameters:**
133
+ - `text` (str) — The narrative description
134
+
135
+ **Returns:** Formatted line string
136
+
137
+ **Example:**
138
+ ```python
139
+ manwha.narrate("The sky tears open like wet paper.")
140
+ ```
141
+
142
+ **Output:**
143
+ ```
144
+ * The sky tears open like wet paper. *
145
+ ```
146
+
147
+ ---
148
+
149
+ ### `narrateSilent(text)`
150
+
151
+ Adds a narrator description block **without** asterisks (plain text).
152
+
153
+ **Parameters:**
154
+ - `text` (str) — The narrative description
155
+
156
+ **Returns:** Formatted line string
157
+
158
+ **Example:**
159
+ ```python
160
+ manwha.narrateSilent("Three hours later...")
161
+ ```
162
+
163
+ **Output:**
164
+ ```
165
+ Three hours later...
166
+ ```
167
+
168
+ ---
169
+
170
+ ### `sceneBreak()`
171
+
172
+ Adds a visual scene break separator (`---`).
173
+
174
+ **Parameters:** None
175
+
176
+ **Returns:** Separator string
177
+
178
+ **Example:**
179
+ ```python
180
+ manwha.sceneBreak()
181
+ ```
182
+
183
+ **Output:**
184
+ ```
185
+ ---
186
+ ```
187
+
188
+ ---
189
+
190
+ ### `character.Dialogue(text, target=None)`
191
+
192
+ Character speaks. Creates a dialogue line.
193
+
194
+ **Parameters:**
195
+ - `text` (str) — What the character says
196
+ - `target` (Character, optional) — If dialogue is directed at another character, include them here
197
+
198
+ **Returns:** Formatted dialogue string
199
+
200
+ **Example:**
201
+ ```python
202
+ kaelen.Dialogue("Where am I?")
203
+ vesper.Dialogue("You're in my domain now.", target=kaelen)
204
+ ```
205
+
206
+ **Output:**
207
+ ```
208
+ **Kaelen**: "Where am I?"
209
+ **Vesper** (to Kaelen): "You're in my domain now."
210
+ ```
211
+
212
+ ---
213
+
214
+ ### `character.Thought(text)`
215
+
216
+ Character has an internal thought. Formats as thought (in parentheses).
217
+
218
+ **Parameters:**
219
+ - `text` (str) — The internal monologue
220
+
221
+ **Returns:** Formatted thought string
222
+
223
+ **Example:**
224
+ ```python
225
+ kaelen.Thought("His power... it's evolved.")
226
+ ```
227
+
228
+ **Output:**
229
+ ```
230
+ **Kaelen**: (His power... it's evolved.)
231
+ ```
232
+
233
+ ---
234
+
235
+ ### `writeMain(title, saveFile="manwha.md")`
236
+
237
+ Exports your entire story to a Markdown file.
238
+
239
+ **Parameters:**
240
+ - `title` (str) — Story title (appears as H1 header)
241
+ - `saveFile` (str, optional) — Output filename (default: `"manwha.md"`)
242
+
243
+ **Returns:** None (prints confirmation message)
244
+
245
+ **Example:**
246
+ ```python
247
+ manwha.writeMain("Echoes of the Aether", saveFile="my_story.md")
248
+ ```
249
+
250
+ ---
251
+
252
+ ## Examples
253
+
254
+ ### Simple Scene
255
+ ```python
256
+ import manwha
257
+
258
+ # Define character
259
+ hero = manwha.Character(
260
+ role="Protagonist",
261
+ name="Kaelen",
262
+ age=19,
263
+ power="Spatial Manipulation",
264
+ powername="Void Step"
265
+ )
266
+
267
+ # Set chapter
268
+ manwha.chapter(1, "First Light")
269
+
270
+ # Add content
271
+ manwha.narrate("The morning sun breaks through the clouds.")
272
+ hero.Thought("Another day. Another battle.")
273
+ hero.Dialogue("Time to train.")
274
+
275
+ # Export
276
+ manwha.writeMain("My Story")
277
+ ```
278
+
279
+ ---
280
+
281
+ ### Multi-Character Scene with Scene Break
282
+ ```python
283
+ import manwha
284
+
285
+ # Characters
286
+ hero = manwha.Character("Protagonist", "Kaelen", 19, "Spatial Manipulation", "Void Step")
287
+ rival = manwha.Character("Antagonist", "Vesper", 22, "Chronos Anchor", "Frozen Second")
288
+
289
+ # Story
290
+ manwha.chapter(1, "The Confrontation")
291
+
292
+ manwha.narrate("They stand face to face in the ruins of the tower.")
293
+
294
+ hero.Dialogue("Vesper! Why have you done this?")
295
+ rival.Thought("Naive. He still doesn't understand.")
296
+ rival.Dialogue("Because the old world must fall.", target=hero)
297
+
298
+ manwha.sceneBreak()
299
+
300
+ manwha.narrateSilent("Hours later, the battle concluded...")
301
+
302
+ hero.Thought("I'm alive. But at what cost?")
303
+
304
+ manwha.writeMain("Clash of Titans")
305
+ ```
306
+
307
+ ---
308
+
309
+ ### Using Markdown Formatting in Text
310
+ You can use **Markdown syntax** directly in your text for emphasis:
311
+
312
+ ```python
313
+ manwha.narrate("Reality *bends* at the seams as **ancient power** awakens.")
314
+ hero.Dialogue("This is ***impossible***!")
315
+ ```
316
+
317
+ ---
318
+
319
+ ## Output Format
320
+
321
+ ### File Structure
322
+ The exported Markdown file has the following structure:
323
+
324
+ ```
325
+ # Story Title
326
+
327
+ ## Characters
328
+ - **Name** the Role (Age: XX, PowerName: Power Description)
329
+ - **Name** the Role (Age: XX, PowerName: Power Description)
330
+
331
+ ---
332
+
333
+ ## Story Script
334
+
335
+ ### Chapter 1: Chapter Title
336
+
337
+ * Narrated scene description. *
338
+
339
+ **Character**: "Dialogue"
340
+
341
+ **Character**: (Internal thought)
342
+
343
+ ---
344
+
345
+ ### Chapter 2: Next Chapter Title
346
+
347
+ ...
348
+ ```
349
+
350
+ ### Character List
351
+ - Auto-generated from all `Character()` instances
352
+ - Shows: Name, Role, Age, Power Name, Power Description
353
+ - Appears at the top of the file for easy reference
354
+
355
+ ### Story Script
356
+ - Organized by chapter number (in order)
357
+ - Narration appears in `* asterisks *`
358
+ - Silent narration appears as plain text
359
+ - Dialogue and thoughts are clearly attributed to characters
360
+ - Scene breaks appear as `---`
361
+
362
+ ---
363
+
364
+ ## Tips & Tricks
365
+
366
+ ### 1. Use `narrateSilent()` for Smooth Transitions
367
+ ```python
368
+ manwha.narrate("The battle raged for hours.")
369
+ manwha.sceneBreak()
370
+ manwha.narrateSilent("By dawn, the dust had settled.")
371
+ ```
372
+
373
+ ### 2. Markdown Emphasis Works Everywhere
374
+ ```python
375
+ hero.Dialogue("I won't let this ***happen*** again!")
376
+ manwha.narrate("The sky **burns** with **crimson** light.")
377
+ ```
378
+
379
+ ### 3. Direct Dialogue to Specific Characters
380
+ ```python
381
+ hero.Dialogue("Why did you betray us?", target=villain)
382
+ # Output: **Hero** (to Villain): "Why did you betray us?"
383
+ ```
384
+
385
+ ### 4. Use Story Parameter for Character Bio
386
+ ```python
387
+ mage = manwha.Character(
388
+ role="Ally",
389
+ name="Mira",
390
+ age=18,
391
+ power="Aether Sense",
392
+ powername="Echo Sight",
393
+ story="A gifted mage haunted by her past"
394
+ )
395
+ ```
396
+
397
+ ### 5. Multiple Chapters in One Script
398
+ ```python
399
+ manwha.chapter(1, "The Beginning")
400
+ # ... add content ...
401
+
402
+ manwha.chapter(2, "The Storm")
403
+ # ... add more content ...
404
+
405
+ manwha.chapter(3, "The Truth")
406
+ # ... add even more ...
407
+
408
+ manwha.writeMain("Epic Story")
409
+ # All chapters exported in order!
410
+ ```
411
+
412
+ ---
413
+
414
+ ## Global Variables
415
+
416
+ ### `manwha.charList`
417
+ List of all `Character` objects created. Auto-populated when you instantiate a character.
418
+
419
+ ### `manwha.story_chapters`
420
+ Dictionary of all chapters: `{chapter_num: {"title": title, "lines": [story_elements]}}`.
421
+
422
+ ### `manwha.current_chapter`
423
+ Currently active chapter number. Set via `chapter()` function.
424
+
425
+ ---
426
+
427
+ ## License & Credits
428
+
429
+ Built for text-based manhwa enthusiasts. Have fun creating!
@@ -0,0 +1,9 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/manwha/__init__.py
5
+ src/manwha/manwha.py
6
+ src/manwha.egg-info/PKG-INFO
7
+ src/manwha.egg-info/SOURCES.txt
8
+ src/manwha.egg-info/dependency_links.txt
9
+ src/manwha.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ manwha