darkcat 1.0.0__py3-none-any.whl

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.
darkcat/__init__.py ADDED
File without changes
darkcat/cli.py ADDED
@@ -0,0 +1,20 @@
1
+ import click
2
+ from darkcat.version import __version__
3
+ from darkcat.commands.init import init
4
+ from darkcat.commands.add import add
5
+ from darkcat.commands.doctor import doctor
6
+ from darkcat.commands.wizard import wizard
7
+
8
+ @click.group()
9
+ @click.version_option(__version__, prog_name="DarkCat")
10
+ def cli():
11
+ """πŸˆβ€β¬› DarkCat β€” Developer Automation Tool"""
12
+ pass
13
+
14
+ cli.add_command(init)
15
+ cli.add_command(add)
16
+ cli.add_command(doctor)
17
+ cli.add_command(wizard)
18
+
19
+ if __name__ == "__main__":
20
+ cli()
File without changes
@@ -0,0 +1,59 @@
1
+ import click
2
+ import os
3
+
4
+ @click.group()
5
+ def add():
6
+ """Add features to an existing project"""
7
+ pass
8
+
9
+ @add.command()
10
+ def docker():
11
+ """Add Docker support interactively"""
12
+ # Ask for project folder
13
+ project_folder = click.prompt("Enter your project folder", default=os.getcwd())
14
+ project_folder = os.path.abspath(project_folder)
15
+
16
+ # Ask for service name
17
+ service_name = click.prompt("Service name", default="app")
18
+
19
+ # Ask for exposed port
20
+ port = click.prompt("Port to expose", default="8000")
21
+
22
+ # Dockerfile content
23
+ dockerfile = f"""FROM python:3.11-slim
24
+ WORKDIR /app
25
+ COPY . .
26
+ RUN pip install -r requirements.txt
27
+ CMD ["python", "app.py"]
28
+ """
29
+
30
+ # docker-compose content
31
+ compose = f"""version: '3'
32
+ services:
33
+ {service_name}:
34
+ build: .
35
+ ports:
36
+ - "{port}:{port}"
37
+ """
38
+
39
+ with open(os.path.join(project_folder, "Dockerfile"), "w") as f:
40
+ f.write(dockerfile)
41
+
42
+ with open(os.path.join(project_folder, "docker-compose.yml"), "w") as f:
43
+ f.write(compose)
44
+
45
+ click.echo(f"🐳 Docker support added to {project_folder} (service: {service_name}, port: {port})")
46
+
47
+
48
+ @add.command()
49
+ def env():
50
+ """Add environment template interactively"""
51
+ project_folder = click.prompt("Enter your project folder", default=os.getcwd())
52
+ project_folder = os.path.abspath(project_folder)
53
+
54
+ env_name = click.prompt("Environment variable template name", default=".env.example")
55
+
56
+ with open(os.path.join(project_folder, env_name), "w") as f:
57
+ f.write("ENV=development\nDEBUG=True\n")
58
+
59
+ click.echo(f"πŸ” Environment template '{env_name}' created in {project_folder}")
@@ -0,0 +1,38 @@
1
+ import click
2
+ import shutil
3
+ from rich.console import Console
4
+ from rich.table import Table
5
+
6
+ console = Console()
7
+
8
+ AVAILABLE_TOOLS = ["git", "docker", "python", "node", "pip"]
9
+
10
+ @click.command()
11
+ def doctor():
12
+ """Interactive system check for required tools"""
13
+ console.print("🩺 [bold cyan]DarkCat Doctor[/bold cyan] running...\n")
14
+
15
+ # Ask which tools to check
16
+ choices = click.prompt(
17
+ "Which tools do you want to check? (comma separated, or 'all')",
18
+ default="all"
19
+ )
20
+
21
+ if choices.lower() == "all":
22
+ tools_to_check = AVAILABLE_TOOLS
23
+ else:
24
+ tools_to_check = [tool.strip() for tool in choices.split(",")]
25
+
26
+ # Prepare Rich table
27
+ table = Table(title="System Check", show_header=True, header_style="bold magenta")
28
+ table.add_column("Tool", justify="left")
29
+ table.add_column("Status", justify="center")
30
+
31
+ for tool in tools_to_check:
32
+ if shutil.which(tool):
33
+ table.add_row(tool, "[green]βœ… Found[/green]")
34
+ else:
35
+ table.add_row(tool, "[red]❌ Missing[/red]")
36
+
37
+ console.print(table)
38
+ console.print("\nβœ”οΈ [bold green]System check complete![/bold green]")
@@ -0,0 +1,49 @@
1
+ import click
2
+ import os
3
+ import shutil
4
+
5
+ TEMPLATES_PATH = os.path.join(os.path.dirname(__file__), "..", "..", "templates")
6
+
7
+ def create_project(project_type, template_name, project_name, folder=None):
8
+ """Core logic to copy template files and replace placeholders"""
9
+ if folder is None:
10
+ folder = os.getcwd()
11
+
12
+ src_path = os.path.join(TEMPLATES_PATH, project_type, template_name)
13
+ dest_path = os.path.join(folder, project_name)
14
+
15
+ if not os.path.exists(src_path):
16
+ click.secho(f"❌ Template '{template_name}' not found for {project_type}", fg="red")
17
+ return
18
+
19
+ shutil.copytree(src_path, dest_path, dirs_exist_ok=True)
20
+
21
+ # Replace {{ project_name }} in all files
22
+ for root, _, files in os.walk(dest_path):
23
+ for f in files:
24
+ fp = os.path.join(root, f)
25
+ with open(fp, "r") as file:
26
+ content = file.read()
27
+ content = content.replace("{{ project_name }}", project_name)
28
+ with open(fp, "w") as file:
29
+ file.write(content)
30
+
31
+ click.secho(f"🌐 Project '{project_name}' created using '{template_name}' template!", fg="green")
32
+
33
+
34
+ @click.group()
35
+ def init():
36
+ """Initialize new projects"""
37
+ pass
38
+
39
+ @init.command()
40
+ @click.option("--name", prompt="Project name")
41
+ @click.option("--template", type=click.Choice(["default","minimal"]), default="default")
42
+ def web(name, template):
43
+ create_project("web", template, name)
44
+
45
+ @init.command()
46
+ @click.option("--name", prompt="Project name")
47
+ @click.option("--template", type=click.Choice(["default","minimal"]), default="default")
48
+ def api(name, template):
49
+ create_project("api", template, name)
@@ -0,0 +1,30 @@
1
+ # darkcat/commands/wizard.py
2
+ import click
3
+ from darkcat.commands.init import create_project
4
+
5
+ @click.command()
6
+ def wizard():
7
+ """Run interactive project setup wizard"""
8
+ click.echo("πŸͺ„ Welcome to DarkCat Wizard Mode!\n")
9
+
10
+ project_type = click.prompt(
11
+ "Choose project type (web/api)",
12
+ type=click.Choice(["web","api"]),
13
+ default="web"
14
+ )
15
+
16
+ project_name = click.prompt("Enter project name", default="MyProject")
17
+ template = click.prompt("Choose template (default/minimal)", type=click.Choice(["default","minimal"]), default="default")
18
+
19
+ # Call the shared function
20
+ create_project(project_type, template, project_name)
21
+
22
+ if click.confirm("Do you want to add Docker support?"):
23
+ from darkcat.commands.add import docker as add_docker
24
+ add_docker()
25
+
26
+ if click.confirm("Do you want to add environment template?"):
27
+ from darkcat.commands.add import env as add_env
28
+ add_env()
29
+
30
+ click.echo("\nπŸŽ‰ Project setup complete! You’re ready to code!")
File without changes
darkcat/version.py ADDED
@@ -0,0 +1 @@
1
+ __version__ = "1.0.0"
@@ -0,0 +1,8 @@
1
+ Metadata-Version: 2.4
2
+ Name: darkcat
3
+ Version: 1.0.0
4
+ License-File: LICENSE
5
+ Requires-Dist: click
6
+ Requires-Dist: rich
7
+ Dynamic: license-file
8
+ Dynamic: requires-dist
@@ -0,0 +1,15 @@
1
+ darkcat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ darkcat/cli.py,sha256=1uwIuKRkKjsqCp3HBmKPpBXqRQBvrRU0HfLdnzmKreg,496
3
+ darkcat/version.py,sha256=J-j-u0itpEFT6irdmWmixQqYMadNl1X91TxUmoiLHMI,22
4
+ darkcat/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ darkcat/commands/add.py,sha256=re2LJWya7130AA8P_D5VbFyveoTY3a8bLzuowDy_H6I,1632
6
+ darkcat/commands/doctor.py,sha256=6yoaWzcNwOCmqII4gc4cgi-uN3uMzkKwsl6dhZh7X_A,1159
7
+ darkcat/commands/init.py,sha256=2S4XcrVKHT9BJtKT74YpYnjXJQkM_ZqZBL4L3NFpjQE,1661
8
+ darkcat/commands/wizard.py,sha256=a6ppzbuByxzMVPnyPt_le6tM7NUlScuhbkr5G12m1A4,1022
9
+ darkcat/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ darkcat-1.0.0.dist-info/licenses/LICENSE,sha256=P9b05wmc58sBPWfT10F845Vfg5buGiWyr12uj1xzFtY,96
11
+ darkcat-1.0.0.dist-info/METADATA,sha256=vMqqb9RHvC00Wa_fqyKbxIXnUuhpAQwbT1ZpFt2Qa-M,159
12
+ darkcat-1.0.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
13
+ darkcat-1.0.0.dist-info/entry_points.txt,sha256=IDvdgPfZ-rKpHoNfdFPQ5TLb2m19hK4cJEWOi2y8tVQ,44
14
+ darkcat-1.0.0.dist-info/top_level.txt,sha256=YF4RZEnhr0g4oI8m9BEUrQA_J1VM7FijKmd-bjUxDCE,8
15
+ darkcat-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.10.2)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ darkcat = darkcat.cli:cli
@@ -0,0 +1,5 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 OEDX DIGITAL
4
+
5
+ Permission is hereby granted, free of charge, ...
@@ -0,0 +1 @@
1
+ darkcat