TsukiNi22/ai-utils / skills/python/python-project
python-project
UnverifiedSet up a new Python project in Tsukini's way - a script, an application in the layout of his MAGIC project (src/main.py + app.py + const.py, Class/, tool/, data/, requirements.txt) or an installable package (src layout, __init__.py with the version and the public API, __main__.py, const.py with frozen dataclasses, exception.py with error codes, main() returning the exit code, pyproject.toml with a console command, pytest tests) - generated by scripts/new_project.py with the Xartania headers, then README / license / CI / git with the other skills. Use whenever the user wants to create, bootstrap or scaffold a Python project, package, tool or script project.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 5.1 KB |
| requires.txt | markdown | 71 B |
| scripts/new_project.pyexecutable | script | 5.7 KB |
| templates/app/app.py | script | 478 B |
| templates/app/main.py | script | 661 B |
| templates/common/const.py | script | 1.6 KB |
| templates/common/gitignore | other | 184 B |
| templates/common/script.py | script | 712 B |
| templates/package/__init__.py | script | 365 B |
| templates/package/__main__.py | script | 192 B |
| templates/package/exception.py | script | 836 B |
| templates/package/main.py | script | 1.1 KB |
| templates/package/pyproject.toml | manifest | 560 B |
| templates/package/test_main.py | script | 680 B |
templates/common/script.py
View on GitHub{{HEADER:{{NAME}}.py:{{DESC}}}}
##### Import #####
# Import that can't be in the try
from const import RETURN, ERROR
from sys import argv, exit, stderr
# Import that can be checked
try:
from pathlib import Path # Used to read / write the files
import argparse # Used for the arguments
except ImportError as e:
stderr.write(f"Import Error ({__file__}): {e}\n")
exit(255)
# Check if the program is call and not imported
if __name__ != "__main__":
stderr.write(f"The {__file__} can only be executed and not imported!\n")
exit(ERROR.FATAL)
##### Tools #####
##### Program #####
parser = argparse.ArgumentParser(description="{{DESC}}")
args = parser.parse_args(argv[1:])
exit(RETURN.OK)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |