hazelaura 0.1.0__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.
@@ -0,0 +1,7 @@
1
+ Metadata-Version: 2.4
2
+ Name: hazelaura
3
+ Version: 0.1.0
4
+ Summary: HazelAura CLI for Discord bot scaffolding
5
+ Author: HazelTech
6
+ Requires-Python: >=3.8
7
+ Description-Content-Type: text/markdown
File without changes
File without changes
@@ -0,0 +1,231 @@
1
+ import os
2
+ import sys
3
+ import subprocess
4
+ from pathlib import Path
5
+
6
+ # -------------------------
7
+ # Colors
8
+ # -------------------------
9
+
10
+ class C:
11
+ PURPLE = "\033[95m"
12
+ CYAN = "\033[96m"
13
+ GREEN = "\033[92m"
14
+ YELLOW = "\033[93m"
15
+ RED = "\033[91m"
16
+ RESET = "\033[0m"
17
+
18
+
19
+ # -------------------------
20
+ # Branding
21
+ # -------------------------
22
+
23
+ BANNER = f"""{C.PURPLE}
24
+ ██╗ ██╗ █████╗ ███████╗███████╗██╗
25
+ ██║ ██║██╔══██╗╚══███╔╝██╔════╝██║
26
+ ███████║███████║ ███╔╝ █████╗ ██║
27
+ ██╔══██║██╔══██║ ███╔╝ ██╔══╝ ██║
28
+ ██║ ██║██║ ██║███████╗███████╗███████╗
29
+ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝
30
+ {C.RESET}"""
31
+
32
+ WELCOME = f"""{C.CYAN}
33
+ Welcome 👋
34
+ This framework was built using HazelTech — clean, scalable, and made for powerful Discord experiences.
35
+
36
+ Get started by exploring the available commands and features.
37
+ Need help? Use the help command anytime.
38
+
39
+ — HazelTech
40
+ {C.RESET}
41
+ """
42
+
43
+ # -------------------------
44
+ # File Templates
45
+ # -------------------------
46
+
47
+ MAIN_PY = """import discord
48
+ from discord.ext import commands
49
+ import os
50
+
51
+ intents = discord.Intents.default()
52
+ intents.message_content = True
53
+
54
+ bot = commands.Bot(command_prefix="!", intents=intents)
55
+
56
+
57
+ @bot.event
58
+ async def on_ready():
59
+ print("\\n✨ HazelAura Bot Online — Powered by HazelTech")
60
+ print(f"Logged in as {bot.user}")
61
+ print("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\\n")
62
+
63
+
64
+ async def load_cogs():
65
+ for folder in os.listdir("./cogs"):
66
+ path = f"./cogs/{folder}"
67
+ if os.path.isdir(path):
68
+ for file in os.listdir(path):
69
+ if file.endswith(".py") and file != "__init__.py":
70
+ await bot.load_extension(f"cogs.{folder}.{file[:-3]}")
71
+
72
+
73
+ async def main():
74
+ async with bot:
75
+ await load_cogs()
76
+ await bot.start("YOUR_TOKEN_HERE")
77
+
78
+
79
+ if __name__ == "__main__":
80
+ import asyncio
81
+ asyncio.run(main())
82
+ """
83
+
84
+ CONFIG_PY = """import os
85
+
86
+ TOKEN = os.getenv("DISCORD_TOKEN", "YOUR_TOKEN_HERE")
87
+ """
88
+
89
+ DATABASE_PY = """def connect():
90
+ print("Database connected (placeholder)")
91
+ """
92
+
93
+ HELPERS_PY = """def ping():
94
+ return "pong"
95
+ """
96
+
97
+ REQUIREMENTS = """discord.py
98
+ python-dotenv
99
+ """
100
+
101
+ COG_TEMPLATE = """from discord.ext import commands
102
+
103
+ class {class_name}(commands.Cog):
104
+ def __init__(self, bot):
105
+ self.bot = bot
106
+
107
+ # your content here
108
+
109
+
110
+ async def setup(bot):
111
+ await bot.add_cog({class_name}(bot))
112
+ """
113
+
114
+
115
+ # -------------------------
116
+ # Core Functions
117
+ # -------------------------
118
+
119
+ def create_project(name):
120
+ base = Path(name)
121
+
122
+ folders = [
123
+ base,
124
+ base / "cogs",
125
+ base / "data",
126
+ base / "core",
127
+ base / "utils",
128
+ base / "components",
129
+ ]
130
+
131
+ for folder in folders:
132
+ folder.mkdir(parents=True, exist_ok=True)
133
+ (folder / "__init__.py").touch()
134
+
135
+ (base / "main.py").write_text(MAIN_PY)
136
+ (base / "requirements.txt").write_text(REQUIREMENTS)
137
+
138
+ (base / "core" / "config.py").write_text(CONFIG_PY)
139
+ (base / "core" / "database.py").write_text(DATABASE_PY)
140
+
141
+ (base / "utils" / "helpers.py").write_text(HELPERS_PY)
142
+
143
+ print(f"{C.GREEN}✅ Project '{name}' created successfully!{C.RESET}")
144
+
145
+
146
+ def create_cog(name):
147
+ cwd = Path.cwd()
148
+
149
+ if cwd.name != "cogs":
150
+ print(f"{C.RED}❌ Run this inside the 'cogs/' folder{C.RESET}")
151
+ return
152
+
153
+ folder = cwd / name
154
+ folder.mkdir(exist_ok=True)
155
+
156
+ (folder / "__init__.py").touch()
157
+
158
+ class_name = name.capitalize()
159
+ cog_file = folder / f"{name}.py"
160
+ cog_file.write_text(COG_TEMPLATE.format(class_name=class_name))
161
+
162
+ print(f"{C.GREEN}✅ Cog '{name}' created!{C.RESET}")
163
+
164
+
165
+ def run_dev():
166
+ if not Path("main.py").exists():
167
+ print(f"{C.RED}❌ Run this inside your project root{C.RESET}")
168
+ return
169
+
170
+ print(BANNER)
171
+ print(f"{C.CYAN}🚀 Starting HazelAura Dev Mode...{C.RESET}\n")
172
+
173
+ subprocess.run([sys.executable, "main.py"])
174
+
175
+
176
+ def show_help():
177
+ print(BANNER)
178
+ print(WELCOME)
179
+
180
+ print(f"""{C.YELLOW}Commands:{C.RESET}
181
+
182
+ aura create --project <name> Create new bot project
183
+ aura create --cog <name> Create cog (inside /cogs)
184
+ aura run dev Run the bot
185
+ aura help Show this menu
186
+ """)
187
+
188
+
189
+ # -------------------------
190
+ # CLI Handler
191
+ # -------------------------
192
+
193
+ def main():
194
+ args = sys.argv
195
+
196
+ if len(args) < 2:
197
+ show_help()
198
+ return
199
+
200
+ cmd = args[1]
201
+
202
+ if cmd == "create":
203
+ if "--project" in args:
204
+ idx = args.index("--project")
205
+ try:
206
+ name = args[idx + 1]
207
+ create_project(name)
208
+ except IndexError:
209
+ print(f"{C.RED}❌ Missing project name{C.RESET}")
210
+
211
+ elif "--cog" in args:
212
+ idx = args.index("--cog")
213
+ try:
214
+ name = args[idx + 1]
215
+ create_cog(name)
216
+ except IndexError:
217
+ print(f"{C.RED}❌ Missing cog name{C.RESET}")
218
+
219
+ elif cmd == "run" and len(args) > 2 and args[2] == "dev":
220
+ run_dev()
221
+
222
+ elif cmd == "help":
223
+ show_help()
224
+
225
+ else:
226
+ print(f"{C.RED}Unknown command{C.RESET}")
227
+ show_help()
228
+
229
+
230
+ def run():
231
+ main()
@@ -0,0 +1,7 @@
1
+ Metadata-Version: 2.4
2
+ Name: hazelaura
3
+ Version: 0.1.0
4
+ Summary: HazelAura CLI for Discord bot scaffolding
5
+ Author: HazelTech
6
+ Requires-Python: >=3.8
7
+ Description-Content-Type: text/markdown
@@ -0,0 +1,9 @@
1
+ README.md
2
+ pyproject.toml
3
+ hazelaura/__init__.py
4
+ hazelaura/cli.py
5
+ hazelaura.egg-info/PKG-INFO
6
+ hazelaura.egg-info/SOURCES.txt
7
+ hazelaura.egg-info/dependency_links.txt
8
+ hazelaura.egg-info/entry_points.txt
9
+ hazelaura.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ aura = hazelaura.cli:run
@@ -0,0 +1 @@
1
+ hazelaura
@@ -0,0 +1,12 @@
1
+ [project]
2
+ name = "hazelaura"
3
+ version = "0.1.0"
4
+ description = "HazelAura CLI for Discord bot scaffolding"
5
+ authors = [{name = "HazelTech"}]
6
+ readme = "README.md"
7
+ requires-python = ">=3.8"
8
+
9
+ dependencies = []
10
+
11
+ [project.scripts]
12
+ aura = "hazelaura.cli:run"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+