Compare commits
8 Commits
490cb0c523
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 767ce79b22 | |||
| 8260413c1a | |||
| 5aaabd81fc | |||
| d907770fd6 | |||
| 93cf68d63e | |||
| 2ede2e5397 | |||
| d65cfc12dc | |||
| 0a257b8be8 |
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
*.csv
|
||||
*.json
|
||||
55
README.md
55
README.md
@@ -1,25 +1,56 @@
|
||||
# Résumé
|
||||
|
||||
Ce dossier contient un script Python pour calculer automatiquement le poids des projets en octets ainsi que le nombre de fichiers qu'ils contiennent. Ces informations correspondent aux statistiques données par Windows lorsque l'on fait clique droit > Propriété.
|
||||
Ce dossier contient un script Python pour calculer automatiquement le poids des projets en octets ainsi que le nombre de fichiers qu'ils contiennent. Ces informations correspondent aux statistiques données par Windows lorsque l'on fait **Clic droit > Propriété**.
|
||||
|
||||
# Installation (Windows)
|
||||
|
||||
- Installez git pour Windows ([lien](https://git-scm.com/downloads/win))
|
||||
- Installez Python ([lien](https://www.python.org/downloads/windows/))
|
||||
- Installez et ouvrez VSCodium ([lien](https://vscodium.com/))
|
||||
- Créez un nouveau projet en cliquant sur **File > Open Folder...** et créez un dossier **projects_stats**
|
||||
- Cliquez sur **Terminal > New Terminal**
|
||||
- Clonez le repository à l'aide du terminal :
|
||||
```bash
|
||||
git clone http://192.168.1.125:30008/Florian/projects_stats.git .
|
||||
```
|
||||
- Créez un environnement virtuel :
|
||||
```bash
|
||||
py -m venv venv
|
||||
```
|
||||
- Installez les dépendances :
|
||||
```bash
|
||||
.\venv\Scripts\pip.exe install -r .\requirements.txt
|
||||
```
|
||||
|
||||
# Instructions
|
||||
|
||||
Pour commencer, il est nécessaire de données une liste de dossiers à parcourir. Lancer la commande suivante :
|
||||
|
||||
```.\venv\Scripts\python.exe init_args.py```
|
||||
|
||||
Un nouveau fichier est créé : `args.json` dans le dossier courant. Ce fichier contient la structure à suivre pour y mettre la liste des dossiers projet à parcourir:
|
||||
|
||||
Pour commencer, il est nécessaire de donner la liste de dossiers projet à parcourir. Éxecutez la commande suivante :
|
||||
```bash
|
||||
.\venv\Scripts\python.exe init_args.py
|
||||
```
|
||||
|
||||
Un nouveau fichier est créé : **args.json**. Ce fichier contient la structure à suivre pour y mettre la liste des dossiers projet à parcourir:
|
||||
```json
|
||||
{
|
||||
"folder_paths": [
|
||||
"path\\to\\your\\folder_1",
|
||||
"path\\to\\your\\folder_2",
|
||||
"...",
|
||||
"path\\to\\your\\folder_n"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Vous pouvez le remplir manuellement ou choisir une approche automatique en éxecutant la commande suivante :
|
||||
Vous pouvez de remplir manuellement les champs (si vous avez peu de dossiers à parcourir) ou choisir une approche automatique en éxecutant la commande suivante :
|
||||
|
||||
```.\venv\Scripts\python.exe populate_args_with_all_project_folders.py```
|
||||
```bash
|
||||
.\venv\Scripts\python.exe populate_args_with_all_project_folders.py
|
||||
```
|
||||
|
||||
Ensuite, lancez la commande suivante :
|
||||
Enfin, éxecutez la commande suivante :
|
||||
|
||||
```.\venv\Scripts\python.exe main.py```
|
||||
```bash
|
||||
.\venv\Scripts\python.exe main.py
|
||||
```
|
||||
|
||||
À la fin du script, un CSV `output.csv` est créé contenant la liste des projets, leur poids et leur nombre de fichiers.
|
||||
À la fin du script, un CSV **output.csv** est créé contenant la liste des projets, leur poids et leur nombre de fichiers.
|
||||
@@ -5,40 +5,45 @@ import json
|
||||
folders_list = []
|
||||
|
||||
### CLIPS
|
||||
root_path = os.path.join("G:\\_PRO\\CLIPS")
|
||||
folders_list += [ f.path for f in os.scandir(root_path) if f.is_dir() and not f.name.startswith('_')]
|
||||
folders_list += [ f.path for f in os.scandir(
|
||||
os.path.join(root_path, "_ARCHIVES (EXPORTS SEULS)")
|
||||
) if f.is_dir()]
|
||||
if True:
|
||||
root_path = os.path.join("G:\\_PRO\\CLIPS")
|
||||
folders_list += [ f.path for f in os.scandir(root_path) if f.is_dir() and not f.name.startswith('_')]
|
||||
folders_list += [ f.path for f in os.scandir(
|
||||
os.path.join(root_path, "_ARCHIVES (EXPORTS SEULS)")
|
||||
) if f.is_dir()]
|
||||
|
||||
|
||||
### COMMERCIAL
|
||||
root_path = os.path.join("G:\\_PRO\\COMMERCIAL")
|
||||
prods = [ f.name for f in os.scandir(root_path) if f.is_dir() and not f.name.startswith('_')]
|
||||
if True:
|
||||
root_path = os.path.join("G:\\_PRO\\COMMERCIAL")
|
||||
prods = [ f.name for f in os.scandir(root_path) if f.is_dir() and not f.name.startswith('_')]
|
||||
|
||||
for prod_name in prods:
|
||||
folders_list += [f.path for f in os.scandir(os.path.join(root_path, prod_name)) if f.is_dir()]
|
||||
for prod_name in prods:
|
||||
folders_list += [f.path for f in os.scandir(os.path.join(root_path, prod_name)) if f.is_dir()]
|
||||
|
||||
|
||||
### DOCU
|
||||
root_path = os.path.join("G:\\_PRO\\DOCU")
|
||||
prods = [ f.name for f in os.scandir(root_path) if f.is_dir() and not f.name.startswith('_')]
|
||||
if True:
|
||||
root_path = os.path.join("G:\\_PRO\\DOCU")
|
||||
prods = [ f.name for f in os.scandir(root_path) if f.is_dir() and not f.name.startswith('_')]
|
||||
|
||||
for prod_name in prods:
|
||||
folders_list += [f.path for f in os.scandir(os.path.join(root_path, prod_name)) if f.is_dir()]
|
||||
for prod_name in prods:
|
||||
folders_list += [f.path for f in os.scandir(os.path.join(root_path, prod_name)) if f.is_dir()]
|
||||
|
||||
|
||||
### FICTIONS
|
||||
root_path = os.path.join("G:\\_PRO\\FICTIONS")
|
||||
prods = [ f.name for f in os.scandir(root_path) if f.is_dir() and not f.name.startswith('_')]
|
||||
if True:
|
||||
root_path = os.path.join("G:\\_PRO\\FICTIONS")
|
||||
prods = [ f.name for f in os.scandir(root_path) if f.is_dir() and not f.name.startswith('_')]
|
||||
|
||||
for prod_name in prods:
|
||||
folders_list += [f.path for f in os.scandir(os.path.join(root_path, prod_name)) if f.is_dir()]
|
||||
for prod_name in prods:
|
||||
folders_list += [f.path for f in os.scandir(os.path.join(root_path, prod_name)) if f.is_dir()]
|
||||
|
||||
|
||||
### WEB
|
||||
root_path = os.path.join("G:\\_PRO\\WEB")
|
||||
folders_list += [ f.path for f in os.scandir(root_path) if f.is_dir() and not f.name.startswith('_')]
|
||||
if True:
|
||||
root_path = os.path.join("G:\\_PRO\\WEB")
|
||||
folders_list += [ f.path for f in os.scandir(root_path) if f.is_dir() and not f.name.startswith('_')]
|
||||
|
||||
|
||||
# Write args.json
|
||||
|
||||
BIN
requirements.txt
Normal file
BIN
requirements.txt
Normal file
Binary file not shown.
Reference in New Issue
Block a user