keith-django-app-creator 0.2.0__py3-none-any.whl → 0.3.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.
app_creator/cli.py CHANGED
@@ -1,15 +1,16 @@
1
1
  import os
2
2
  import sys
3
3
 
4
+ def to_camel_case(snake_str):
5
+ return ''.join(word.capitalize() for word in snake_str.split('_'))
6
+
4
7
  def create_app(app_name):
5
8
  os.makedirs(app_name, exist_ok=True)
6
9
  os.makedirs(f"{app_name}/models", exist_ok=True)
7
10
  os.makedirs(f"{app_name}/views", exist_ok=True)
8
11
  os.makedirs(f"{app_name}/migrations", exist_ok=True)
9
12
 
10
- # Fichiers de base
11
13
  with open(f"{app_name}/__init__.py", "w"): pass
12
-
13
14
  with open(f"{app_name}/models/__init__.py", "w") as f:
14
15
  f.write("# models here\n")
15
16
 
@@ -17,7 +18,7 @@ def create_app(app_name):
17
18
  f.write("# views here\n")
18
19
 
19
20
  with open(f"{app_name}/migrations/__init__.py", "w") as f:
20
- pass # Fichier vide requis pour marquer le dossier comme un package Python
21
+ pass
21
22
 
22
23
  with open(f"{app_name}/urls.py", "w") as f:
23
24
  f.write(
@@ -31,7 +32,7 @@ def create_app(app_name):
31
32
  f.write("from django.contrib import admin\n\n# Register your models here.\n")
32
33
 
33
34
  with open(f"{app_name}/apps.py", "w") as f:
34
- class_name = app_name.capitalize() + "Config"
35
+ class_name = to_camel_case(app_name) + "Config"
35
36
  f.write(
36
37
  "from django.apps import AppConfig\n\n"
37
38
  f"class {class_name}(AppConfig):\n"
@@ -40,10 +41,7 @@ def create_app(app_name):
40
41
  )
41
42
 
42
43
  with open(f"{app_name}/tests.py", "w") as f:
43
- f.write(
44
- "from django.test import TestCase\n\n"
45
- "# Create your tests here.\n"
46
- )
44
+ f.write("from django.test import TestCase\n\n# Create your tests here.\n")
47
45
 
48
46
  print(f"App Django '{app_name}' créée avec succès !")
49
47
 
@@ -52,3 +50,6 @@ def main():
52
50
  print("Usage : django-create-app <nom_app>")
53
51
  else:
54
52
  create_app(sys.argv[1])
53
+
54
+ if __name__ == "__main__":
55
+ main()
@@ -1,5 +1,5 @@
1
1
  from django.apps import AppConfig
2
2
 
3
- class ParfaiteConfig(AppConfig):
3
+ class KeitaConfig(AppConfig):
4
4
  default_auto_field = 'django.db.models.BigAutoField'
5
- name = 'parfaite'
5
+ name = 'keita'
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: keith-django-app-creator
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: Générateur de structure d'app Django personnalisée
5
- Author: keith44
6
- Author-email: kidisco1432@gmail.com
5
+ Author: Keith44
6
+ Author-email: keitamohamed1432@gmail.com
7
7
  License: MIT
8
8
  Classifier: Programming Language :: Python :: 3
9
9
  Classifier: Framework :: Django
@@ -19,7 +19,7 @@ Dynamic: summary
19
19
 
20
20
  # django-app-creator
21
21
 
22
- `keith-django-app-creator` est un outil en ligne de commande qui permet de générer rapidement une appliaction django de base avec un fichier urls.py
22
+ `django-app-creator` est un outil en ligne de commande qui permet de générer rapidement la structure d'une application Django avec une organisation de fichiers personnalisée.
23
23
 
24
24
  ## Fonctionnalités
25
25
 
@@ -35,7 +35,7 @@ Dynamic: summary
35
35
  Assurez-vous d’avoir Python 3 et `pip` installés, puis exécutez :
36
36
 
37
37
  ```bash
38
- pip install keith-django-app-creator
39
38
 
39
+ pip install keith-django-app-creator
40
40
  ## Utilisation
41
41
  newapp <nom_de_l_app>
@@ -0,0 +1,18 @@
1
+ app_creator/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ app_creator/cli.py,sha256=ks6Ui1VbGmwM9vjAOR1sV8GGNv-PNLrf5j0d1Nkis5E,1753
3
+ keita/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ keita/admin.py,sha256=suMo4x8I3JBxAFBVIdE-5qnqZ6JAZV0FESABHOSc-vg,63
5
+ keita/apps.py,sha256=9IvzXtmMUbnCJiQ7FqWh0D2ccMoRBtZQyOyDQBOSTpQ,141
6
+ keita/tests.py,sha256=mrbGGRNg5jwbTJtWWa7zSKdDyeB4vmgZCRc2nk6VY-g,60
7
+ keita/urls.py,sha256=-3_l2Z6oNkP1iaZf5exoCSDxlOh3BAlBoAg9wSLELW8,91
8
+ keita/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
+ keita/models/__init__.py,sha256=0rPVvb48SPpEsn5t9bT3ziS2jeZ31VZ8jhM9I2vI5ws,14
10
+ keita/views/__init__.py,sha256=3IylRHwsJ1fBLYV0JXkaa8Ai4nAyRGfsFPFBodaHxes,13
11
+ migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
+ models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
+ views/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
+ keith_django_app_creator-0.3.0.dist-info/METADATA,sha256=czBsKlnhV7sf98Nmzm4FGfl1QvgBRl6q0zFYQ1KD2dM,1296
15
+ keith_django_app_creator-0.3.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
+ keith_django_app_creator-0.3.0.dist-info/entry_points.txt,sha256=-jAIpobaRuBFWCeOJweNVHeiodad73Ry9EJ-TkEp8Pg,51
17
+ keith_django_app_creator-0.3.0.dist-info/top_level.txt,sha256=fqkyUMAoXs-vdWHGewTkwBaCWwkn-eqmiwQZrpyty08,42
18
+ keith_django_app_creator-0.3.0.dist-info/RECORD,,
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ createapp = app_creator.cli:main
@@ -1,5 +1,5 @@
1
1
  app_creator
2
+ keita
2
3
  migrations
3
4
  models
4
- parfaite
5
5
  views
@@ -1,18 +0,0 @@
1
- app_creator/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- app_creator/cli.py,sha256=whvGKPq_SaMIwjULfwgOSe9SRwFKr2dV0Y-vEuDksxg,1742
3
- migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- parfaite/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- parfaite/admin.py,sha256=suMo4x8I3JBxAFBVIdE-5qnqZ6JAZV0FESABHOSc-vg,63
7
- parfaite/apps.py,sha256=GSW-CyPntzjy9_mSwO3TdQWEeOHcF17l9MFRVlJTA5A,147
8
- parfaite/tests.py,sha256=mrbGGRNg5jwbTJtWWa7zSKdDyeB4vmgZCRc2nk6VY-g,60
9
- parfaite/urls.py,sha256=-3_l2Z6oNkP1iaZf5exoCSDxlOh3BAlBoAg9wSLELW8,91
10
- parfaite/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
- parfaite/models/__init__.py,sha256=0rPVvb48SPpEsn5t9bT3ziS2jeZ31VZ8jhM9I2vI5ws,14
12
- parfaite/views/__init__.py,sha256=3IylRHwsJ1fBLYV0JXkaa8Ai4nAyRGfsFPFBodaHxes,13
13
- views/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
- keith_django_app_creator-0.2.0.dist-info/METADATA,sha256=sVfQGBnbYY0T_vpzHK9Pwb0HnbEHjUUJNpkJ9l9RHeE,1264
15
- keith_django_app_creator-0.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
- keith_django_app_creator-0.2.0.dist-info/entry_points.txt,sha256=dK2S_U_9kTbZWt-m1qw3JCdZrcsJbblg1krP8Ju5fRA,48
17
- keith_django_app_creator-0.2.0.dist-info/top_level.txt,sha256=aa3_dy_AaRixnHSLGIPbnlnZ7xGzihS9k-GdkDENKUw,45
18
- keith_django_app_creator-0.2.0.dist-info/RECORD,,
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- newapp = app_creator.cli:main
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes