structure-aram 0.1.4__tar.gz → 0.1.6__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.
Files changed (20) hide show
  1. {structure_aram-0.1.4 → structure_aram-0.1.6}/PKG-INFO +19 -1
  2. structure_aram-0.1.6/README.md +16 -0
  3. {structure_aram-0.1.4 → structure_aram-0.1.6}/setup.py +8 -7
  4. structure_aram-0.1.6/structure_aram/cli.py +89 -0
  5. {structure_aram-0.1.4 → structure_aram-0.1.6}/structure_aram.egg-info/PKG-INFO +19 -1
  6. {structure_aram-0.1.4 → structure_aram-0.1.6}/structure_aram.egg-info/SOURCES.txt +1 -0
  7. structure_aram-0.1.4/README.md +0 -0
  8. {structure_aram-0.1.4 → structure_aram-0.1.6}/MANIFEST.in +0 -0
  9. {structure_aram-0.1.4 → structure_aram-0.1.6}/setup.cfg +0 -0
  10. {structure_aram-0.1.4 → structure_aram-0.1.6}/structure_aram/__init__.py +0 -0
  11. {structure_aram-0.1.4 → structure_aram-0.1.6}/structure_aram/admin.py +0 -0
  12. {structure_aram-0.1.4 → structure_aram-0.1.6}/structure_aram/apps.py +0 -0
  13. {structure_aram-0.1.4 → structure_aram-0.1.6}/structure_aram/migrations/__init__.py +0 -0
  14. {structure_aram-0.1.4 → structure_aram-0.1.6}/structure_aram/models.py +0 -0
  15. {structure_aram-0.1.4 → structure_aram-0.1.6}/structure_aram/tests.py +0 -0
  16. {structure_aram-0.1.4 → structure_aram-0.1.6}/structure_aram/views.py +0 -0
  17. {structure_aram-0.1.4 → structure_aram-0.1.6}/structure_aram.egg-info/dependency_links.txt +0 -0
  18. {structure_aram-0.1.4 → structure_aram-0.1.6}/structure_aram.egg-info/entry_points.txt +0 -0
  19. {structure_aram-0.1.4 → structure_aram-0.1.6}/structure_aram.egg-info/requires.txt +0 -0
  20. {structure_aram-0.1.4 → structure_aram-0.1.6}/structure_aram.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: structure_aram
3
- Version: 0.1.4
3
+ Version: 0.1.6
4
4
  Summary: Un petit package Django qui cree des app
5
5
  Author: ynaffit_aes
6
6
  Author-email: aramsamb02@gmail.com
@@ -19,7 +19,25 @@ Requires-Dist: django>=4.0
19
19
  Dynamic: author
20
20
  Dynamic: author-email
21
21
  Dynamic: classifier
22
+ Dynamic: description
22
23
  Dynamic: description-content-type
23
24
  Dynamic: license
24
25
  Dynamic: requires-dist
25
26
  Dynamic: summary
27
+
28
+ DESCRIPTION structure_ara
29
+
30
+ `structure_aram` est un package Python qui inclut une commande en ligne `generate-app` pour faciliter la génération d’applications .
31
+
32
+ ---
33
+
34
+ INSTALLATION
35
+
36
+ - Créez un environnement virtuel (optionnel mais recommandé) :
37
+
38
+ ```bash
39
+ python3 -m venv venv
40
+ source venv/bin/activate
41
+
42
+ - installe le package avec pip install structure-aram
43
+ - genere ton application avec < generate-app "nom_app">
@@ -0,0 +1,16 @@
1
+ DESCRIPTION structure_ara
2
+
3
+ `structure_aram` est un package Python qui inclut une commande en ligne `generate-app` pour faciliter la génération d’applications .
4
+
5
+ ---
6
+
7
+ INSTALLATION
8
+
9
+ - Créez un environnement virtuel (optionnel mais recommandé) :
10
+
11
+ ```bash
12
+ python3 -m venv venv
13
+ source venv/bin/activate
14
+
15
+ - installe le package avec pip install structure-aram
16
+ - genere ton application avec < generate-app "nom_app">
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='structure_aram',
5
- version='0.1.4',
5
+ version='0.1.6',
6
6
  packages=find_packages(),
7
7
  include_package_data=True,
8
8
  license='MIT',
@@ -11,6 +11,11 @@ setup(
11
11
  long_description_content_type='text/markdown',
12
12
  author='ynaffit_aes',
13
13
  author_email='aramsamb02@gmail.com',
14
+ entry_points={
15
+ 'console_scripts':[
16
+ 'generate-app = structure_aram.cli:main',
17
+ ]
18
+ },
14
19
  classifiers=[
15
20
  'Environment :: Web Environment',
16
21
  'Framework :: Django',
@@ -24,12 +29,8 @@ setup(
24
29
  ],
25
30
  install_requires=[
26
31
  'django>=4.0',
27
- ],
32
+ ]
28
33
 
29
- entry_points={
30
- 'console_scripts':[
31
- 'generate-app = structure_aram.cli:main',
32
- ]
33
- }
34
+
34
35
 
35
36
  )
@@ -0,0 +1,89 @@
1
+ import os
2
+ import sys
3
+ import re
4
+
5
+ def to_camel_case(name):
6
+ """Convertit 'ma-super app' en 'MaSuperApp'"""
7
+ parts = re.split(r"[-_\s]+", name)
8
+ return ''.join(part.capitalize() for part in parts)
9
+
10
+ def to_snake_case(name):
11
+ """Convertit 'MaSuper App' ou 'maSuper-App' en 'ma_super_app'"""
12
+ name = name.strip().lower().replace("-", "_").replace(" ", "_")
13
+ name = re.sub(r'__+', '_', name) # Enlève doublons de '_'
14
+ return name
15
+
16
+ def create_app(raw_name):
17
+
18
+ app_name = to_snake_case(raw_name)
19
+ camel_case_name = to_camel_case(raw_name)
20
+
21
+ os.makedirs(app_name, exist_ok=True)
22
+ os.makedirs(f"{app_name}/models", exist_ok=True)
23
+ os.makedirs(f"{app_name}/views", exist_ok=True)
24
+ os.makedirs(f"{app_name}/migrations", exist_ok=True)
25
+ os.makedirs(f"{app_name}/templates/{app_name}", exist_ok=True)
26
+ os.makedirs(f"{app_name}/static/{app_name}", exist_ok=True)
27
+
28
+ # Fichiers init
29
+ open(f"{app_name}/__init__.py", "w").close()
30
+ open(f"{app_name}/models/__init__.py", "w").write("# models here\n")
31
+ open(f"{app_name}/views/__init__.py", "w").write("# views here\n")
32
+ open(f"{app_name}/migrations/__init__.py", "w").close()
33
+
34
+ # Fichier urls.py
35
+ with open(f"{app_name}/urls.py", "w") as f:
36
+ f.write(
37
+ "from django.urls import path\n"
38
+ "# from .views import ...\n\n"
39
+ "urlpatterns = [\n"
40
+ " # path('', views.index, name='index'),\n"
41
+ "]\n"
42
+ )
43
+
44
+ # Fichier admin.py
45
+ with open(f"{app_name}/admin.py", "w") as f:
46
+ f.write("from django.contrib import admin\n\n# Register your models here.\n")
47
+
48
+ # Fichier apps.py
49
+ with open(f"{app_name}/apps.py", "w") as f:
50
+ f.write(
51
+ "from django.apps import AppConfig\n\n"
52
+ f"class {camel_case_name}Config(AppConfig):\n"
53
+ f" default_auto_field = 'django.db.models.BigAutoField'\n"
54
+ f" name = '{app_name}'\n"
55
+ )
56
+
57
+ # Fichier tests.py
58
+ with open(f"{app_name}/tests.py", "w") as f:
59
+ f.write(
60
+ "from django.test import TestCase\n\n"
61
+ "# Create your tests here.\n"
62
+ )
63
+
64
+ # Template HTML
65
+ with open(f"{app_name}/templates/{app_name}/index.html", "w") as f:
66
+ f.write(
67
+ "<!DOCTYPE html>\n<html>\n<head>\n"
68
+ " <title>My Template</title>\n"
69
+ "</head>\n<body>\n"
70
+ " <h1>Hello from template!</h1>\n"
71
+ "</body>\n</html>\n"
72
+ )
73
+
74
+ # Fichier CSS
75
+ with open(f"{app_name}/static/{app_name}/style.css", "w") as f:
76
+ f.write("/* Style de l'application */\nbody {\n font-family: sans-serif;\n}\n")
77
+
78
+ print(f"Application Django '{app_name}' créée avec succès !")
79
+
80
+ def main():
81
+ if len(sys.argv) < 2:
82
+ print("Usage : generate-app <nom_app>")
83
+ sys.exit(1)
84
+ else:
85
+ raw_name = ' '.join(sys.argv[1:]) # Supporte les noms avec espaces
86
+ create_app(raw_name)
87
+
88
+ if __name__ == "__main__":
89
+ main()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: structure_aram
3
- Version: 0.1.4
3
+ Version: 0.1.6
4
4
  Summary: Un petit package Django qui cree des app
5
5
  Author: ynaffit_aes
6
6
  Author-email: aramsamb02@gmail.com
@@ -19,7 +19,25 @@ Requires-Dist: django>=4.0
19
19
  Dynamic: author
20
20
  Dynamic: author-email
21
21
  Dynamic: classifier
22
+ Dynamic: description
22
23
  Dynamic: description-content-type
23
24
  Dynamic: license
24
25
  Dynamic: requires-dist
25
26
  Dynamic: summary
27
+
28
+ DESCRIPTION structure_ara
29
+
30
+ `structure_aram` est un package Python qui inclut une commande en ligne `generate-app` pour faciliter la génération d’applications .
31
+
32
+ ---
33
+
34
+ INSTALLATION
35
+
36
+ - Créez un environnement virtuel (optionnel mais recommandé) :
37
+
38
+ ```bash
39
+ python3 -m venv venv
40
+ source venv/bin/activate
41
+
42
+ - installe le package avec pip install structure-aram
43
+ - genere ton application avec < generate-app "nom_app">
@@ -4,6 +4,7 @@ setup.py
4
4
  structure_aram/__init__.py
5
5
  structure_aram/admin.py
6
6
  structure_aram/apps.py
7
+ structure_aram/cli.py
7
8
  structure_aram/models.py
8
9
  structure_aram/tests.py
9
10
  structure_aram/views.py
File without changes
File without changes