Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9ed41ad

Browse files
committed
Add core project generator functionality and utility operations
- Integrated tool handling for project generation and feature addition processes.
0 parents  commit9ed41ad

File tree

13 files changed

+1954
-0
lines changed

13 files changed

+1954
-0
lines changed

‎.gitignore

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# UV
98+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
#uv.lock
102+
103+
# poetry
104+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105+
# This is especially recommended for binary packages to ensure reproducibility, and is more
106+
# commonly ignored for libraries.
107+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108+
#poetry.lock
109+
110+
# pdm
111+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112+
#pdm.lock
113+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114+
# in version control.
115+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116+
.pdm.toml
117+
.pdm-python
118+
.pdm-build/
119+
120+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121+
__pypackages__/
122+
123+
# Celery stuff
124+
celerybeat-schedule
125+
celerybeat.pid
126+
127+
# SageMath parsed files
128+
*.sage.py
129+
130+
# Environments
131+
.env
132+
.venv
133+
env/
134+
venv/
135+
ENV/
136+
env.bak/
137+
venv.bak/
138+
139+
# Spyder project settings
140+
.spyderproject
141+
.spyproject
142+
143+
# Rope project settings
144+
.ropeproject
145+
146+
# mkdocs documentation
147+
/site
148+
149+
# mypy
150+
.mypy_cache/
151+
.dmypy.json
152+
dmypy.json
153+
154+
# Pyre type checker
155+
.pyre/
156+
157+
# pytype static type analyzer
158+
.pytype/
159+
160+
# Cython debug symbols
161+
cython_debug/
162+
163+
# PyCharm
164+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166+
# and can be added to the global gitignore or merged into this file. For a more nuclear
167+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
168+
#.idea/
169+
170+
# Ruff stuff:
171+
.ruff_cache/
172+
173+
# PyPI configuration file
174+
.pypirc

‎README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#Code Project Generator
2+
3+
A Python tool that uses OpenAI's GPT-4o to generate complete project structures based on user specifications.
4+
5+
##Project Structure
6+
7+
The project has been organized with a proper folder structure:
8+
9+
```
10+
code-project-generator/
11+
├── .env # Environment variables (contains OpenAI API key)
12+
├── main.py # Entry point for the application
13+
├── requirements.txt # Project dependencies
14+
├── src/ # Main source code directory
15+
│ ├── __init__.py # Package initialization
16+
│ ├── cli/ # Command-line interface
17+
│ │ ├── __init__.py
18+
│ │ └── main.py # CLI implementation
19+
│ ├── core/ # Core functionality
20+
│ │ ├── __init__.py
21+
│ │ └── project_generator.py # ProjectGenerator class
22+
│ └── utils/ # Utility functions
23+
│ ├── __init__.py
24+
│ ├── command_operations.py # Command execution functions
25+
│ └── file_operations.py # File and directory management functions
26+
```
27+
28+
##Features
29+
30+
- Generate complete project structures for various types of projects (MERN, Django+React, etc.)
31+
- Create appropriate directory structures and files with proper content
32+
- Generate README.md files for projects
33+
- Track and summarize project generation process
34+
35+
##Installation
36+
37+
1. Clone the repository:
38+
```
39+
git clone <repository-url>
40+
cd code-project-generator
41+
```
42+
43+
2. Install dependencies:
44+
```
45+
pip install -r requirements.txt
46+
```
47+
48+
3. Create a`.env` file with your OpenAI API key:
49+
```
50+
OPENAI_API_KEY=your_api_key_here
51+
```
52+
53+
##Usage
54+
55+
Run the project generator:
56+
57+
```
58+
python main.py
59+
```
60+
61+
Follow the prompts to specify:
62+
- Project type (e.g., MERN Stack, Django+React)
63+
- Project name
64+
- Project description
65+
66+
The tool will generate a complete project structure based on your specifications.
67+
68+
##Dependencies
69+
70+
- openai: For GPT-4o API access
71+
- python-dotenv: For loading environment variables
72+
- Other supporting libraries (see requirements.txt)
73+
74+
##License
75+
76+
[Specify license information here]

‎main.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
"""Entry point for the Code Project Generator.
2+
3+
NOTE: This application requires a virtual environment.
4+
Before running, make sure to activate the virtual environment:
5+
6+
source .venv/bin/activate # On Unix/Mac
7+
.venv/Scripts/activate # On Windows
8+
9+
Then run the application with:
10+
python main.py
11+
"""
12+
importos
13+
importsys
14+
fromdotenvimportload_dotenv
15+
16+
# Load environment variables from .env file
17+
load_dotenv()
18+
19+
# Check if running in virtual environment
20+
defis_venv():
21+
returnhasattr(sys,'real_prefix')or \
22+
(hasattr(sys,'base_prefix')andsys.base_prefix!=sys.prefix)
23+
24+
# Import the main CLI function
25+
fromsrc.cli.mainimportmain
26+
27+
if__name__=="__main__":
28+
ifnotis_venv():
29+
print("\033[93mWarning: It's recommended to run this application in the virtual environment.\033[0m")
30+
print("To activate the virtual environment:")
31+
print(" source .venv/bin/activate # On Unix/Mac")
32+
print(" .venv/Scripts/activate # On Windows")
33+
print("\nContinuing without virtual environment...\n")
34+
35+
main()

‎projects/.gitignore

Whitespace-only changes.

‎requirements.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
annotated-types>=0.7.0
2+
anyio>=4.9.0
3+
certifi>=2025.1.31
4+
distro>=1.9.0
5+
h11>=0.14.0
6+
httpcore>=1.0.8
7+
httpx>=0.28.1
8+
idna>=3.10
9+
jiter>=0.9.0
10+
markdown-it-py>=3.0.0
11+
mdurl>=0.1.2
12+
openai>=1.73.0
13+
pydantic>=2.11.3
14+
pydantic_core>=2.33.1
15+
Pygments>=2.19.1
16+
python-dotenv>=1.1.0
17+
rich>=14.0.0
18+
sniffio>=1.3.1
19+
tqdm>=4.67.1
20+
typing-inspection>=0.4.0
21+
typing_extensions>=4.13.2

‎src/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""
2+
Code Project Generator package.
3+
"""

‎src/cli/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""
2+
Command-line interface for the project generator.
3+
"""

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp