This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

Part IV complete, mypy-flake nil

Jay Krishnan (Jul 4, 2026, 2:59 PM +0200) 9e92581b 97511502

+154
+14
alchemy/grimoire/__init__.py
··· 1 + #!/usr/bin/env python3 2 + # ########################################################################### # 3 + # shebang: 1 # 4 + # ::: :::::::: # 5 + # __init__.py :+: :+: :+: # 6 + # +:+ +:+ +:+ # 7 + # By: jkrishna <jkrishna@student.42.fr> +#+ +:+ +#+ # 8 + # +#+#+#+#+#+ +#+ # 9 + # Created: 2026/07/04 13:41:58 by jkrishna #+# #+# # 10 + # Updated: 2026/07/04 14:49:07 by jkrishna ### ########.fr # 11 + # # 12 + # ########################################################################### # 13 + 14 + from .light_spellbook import light_spell_allowed_ingredients, light_spell_record
alchemy/grimoire/__pycache__/__init__.cpython-310.pyc

This is a binary file and will not be displayed.

alchemy/grimoire/__pycache__/dark_spellbook.cpython-310.pyc

This is a binary file and will not be displayed.

alchemy/grimoire/__pycache__/dark_validator.cpython-310.pyc

This is a binary file and will not be displayed.

alchemy/grimoire/__pycache__/light_spellbook.cpython-310.pyc

This is a binary file and will not be displayed.

alchemy/grimoire/__pycache__/light_validator.cpython-310.pyc

This is a binary file and will not be displayed.

+28
alchemy/grimoire/dark_spellbook.py
··· 1 + #!/usr/bin/env python3 2 + # ########################################################################### # 3 + # shebang: 1 # 4 + # ::: :::::::: # 5 + # dark_spellbook.py :+: :+: :+: # 6 + # +:+ +:+ +:+ # 7 + # By: jkrishna <jkrishna@student.42.fr> +#+ +:+ +#+ # 8 + # +#+#+#+#+#+ +#+ # 9 + # Created: 2026/07/04 14:31:50 by jkrishna #+# #+# # 10 + # Updated: 2026/07/04 14:35:21 by jkrishna ### ########.fr # 11 + # # 12 + # ########################################################################### # 13 + 14 + 15 + from .dark_validator import validate_ingredients 16 + 17 + 18 + def dark_spell_allowed_ingredients() -> list[str] : 19 + allowed_ingredients: list[str] = ["bats", "frogs", "arsenic", "eyeball"] 20 + return (allowed_ingredients) 21 + 22 + 23 + def dark_spell_record(spell_name: str, ingredients: str) -> str: 24 + result = validate_ingredients(ingredients) 25 + if "VALID" in result and "INVALID" not in result: 26 + return (f"Spell recorded: {spell_name} ({result})") 27 + else: 28 + return (f"Spell rejected: {spell_name} ({result})")
+23
alchemy/grimoire/dark_validator.py
··· 1 + #!/usr/bin/env python3 2 + # ########################################################################### # 3 + # shebang: 1 # 4 + # ::: :::::::: # 5 + # dark_validator.py :+: :+: :+: # 6 + # +:+ +:+ +:+ # 7 + # By: jkrishna <jkrishna@student.42.fr> +#+ +:+ +#+ # 8 + # +#+#+#+#+#+ +#+ # 9 + # Created: 2026/07/04 14:33:35 by jkrishna #+# #+# # 10 + # Updated: 2026/07/04 14:34:11 by jkrishna ### ########.fr # 11 + # # 12 + # ########################################################################### # 13 + 14 + from .dark_spellbook import dark_spell_allowed_ingredients 15 + 16 + 17 + def validate_ingredients(ingredients: str) -> str: 18 + allowed_ingredients = dark_spell_allowed_ingredients() 19 + lowered = ingredients.lower() 20 + if any(item in lowered for item in allowed_ingredients): 21 + return (f"{ingredients} - VALID") 22 + else: 23 + return (f"{ingredients} - INVALID")
+27
alchemy/grimoire/light_spellbook.py
··· 1 + #!/usr/bin/env python3 2 + # ########################################################################### # 3 + # shebang: 1 # 4 + # ::: :::::::: # 5 + # light_spellbook.py :+: :+: :+: # 6 + # +:+ +:+ +:+ # 7 + # By: jkrishna <jkrishna@student.42.fr> +#+ +:+ +#+ # 8 + # +#+#+#+#+#+ +#+ # 9 + # Created: 2026/07/04 13:42:09 by jkrishna #+# #+# # 10 + # Updated: 2026/07/04 14:47:50 by jkrishna ### ########.fr # 11 + # # 12 + # ########################################################################### # 13 + 14 + 15 + def light_spell_allowed_ingredients() -> list[str] : 16 + allowed_ingredients: list[str] = ["earth", "air", "fire", "water"] 17 + return (allowed_ingredients) 18 + 19 + 20 + def light_spell_record(spell_name: str, ingredients: str) -> str: 21 + from .light_validator import validate_ingredients 22 + 23 + result = validate_ingredients(ingredients) 24 + if "VALID" in result and "INVALID" not in result: 25 + return (f"Spell recorded: {spell_name} ({result})") 26 + else: 27 + return (f"Spell rejected: {spell_name} ({result})")
+23
alchemy/grimoire/light_validator.py
··· 1 + #!/usr/bin/env python3 2 + # ########################################################################### # 3 + # shebang: 1 # 4 + # ::: :::::::: # 5 + # light_validator.py :+: :+: :+: # 6 + # +:+ +:+ +:+ # 7 + # By: jkrishna <jkrishna@student.42.fr> +#+ +:+ +#+ # 8 + # +#+#+#+#+#+ +#+ # 9 + # Created: 2026/07/04 13:45:22 by jkrishna #+# #+# # 10 + # Updated: 2026/07/04 14:48:34 by jkrishna ### ########.fr # 11 + # # 12 + # ########################################################################### # 13 + 14 + 15 + def validate_ingredients(ingredients: str) -> str: 16 + from .light_spellbook import light_spell_allowed_ingredients 17 + 18 + allowed_ingredients = light_spell_allowed_ingredients() 19 + lowered = ingredients.lower() 20 + if any(item in lowered for item in allowed_ingredients): 21 + return (f"{ingredients} - VALID") 22 + else: 23 + return (f"{ingredients} - INVALID")
+19
ft_kaboom_0.py
··· 1 + #!/usr/bin/env python3 2 + # ########################################################################### # 3 + # shebang: 1 # 4 + # ::: :::::::: # 5 + # ft_kaboom_0.py :+: :+: :+: # 6 + # +:+ +:+ +:+ # 7 + # By: jkrishna <jkrishna@student.42.fr> +#+ +:+ +#+ # 8 + # +#+#+#+#+#+ +#+ # 9 + # Created: 2026/07/04 14:35:38 by jkrishna #+# #+# # 10 + # Updated: 2026/07/04 14:43:15 by jkrishna ### ########.fr # 11 + # # 12 + # ########################################################################### # 13 + 14 + import alchemy.grimoire 15 + 16 + if __name__ == "__main__": 17 + print("=== Kaboom 0 ===") 18 + print("Using grimoire module directly") 19 + print(f"Testing record light spell: {alchemy.grimoire.light_spell_record('Fantasy', 'Earth, wind and fire')}")
+20
ft_kaboom_1.py
··· 1 + #!/usr/bin/env python3 2 + # ########################################################################### # 3 + # shebang: 1 # 4 + # ::: :::::::: # 5 + # ft_kaboom_1.py :+: :+: :+: # 6 + # +:+ +:+ +:+ # 7 + # By: jkrishna <jkrishna@student.42.fr> +#+ +:+ +#+ # 8 + # +#+#+#+#+#+ +#+ # 9 + # Created: 2026/07/04 14:51:23 by jkrishna #+# #+# # 10 + # Updated: 2026/07/04 14:58:17 by jkrishna ### ########.fr # 11 + # # 12 + # ########################################################################### # 13 + 14 + 15 + if __name__ == "__main__": 16 + print("=== Kaboom 1 ===") 17 + print("Access to alchemy/grimoire/dark_spellbook.py directly") 18 + print("Test import now - THIS WILL RAISE AN UNCAUGHT EXCEPTION") 19 + from alchemy.grimoire.dark_spellbook import dark_spell_record 20 + print(f"{dark_spell_record('Fantasy', 'Earth, wind and fire')}")