pd-quality 0.1.0__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.
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2026 [Thomas Lefebvre]
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
@@ -0,0 +1,29 @@
1
+ Metadata-Version: 2.4
2
+ Name: pd_quality
3
+ Version: 0.1.0
4
+ Summary: Une extension Pandas pour générer un rapport rapide sur la qualité des données de votre dataframe, j'en avais marre de tout réecris à la main à chaque nouveau projet.
5
+ Author-email: Thomas Lefebvre <thomas.lfbv@icloud.com>
6
+ Project-URL: Homepage, https://github.com/thomaslfbv/pd_quality
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Intended Audience :: Science/Research
11
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
12
+ Requires-Python: >=3.8
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE
15
+ Requires-Dist: pandas>=1.5.0
16
+ Requires-Dist: numpy>=1.20.0
17
+ Dynamic: license-file
18
+
19
+ # pd_quality
20
+
21
+ `pd_quality` est une librairie légère qui s'intègre directement à Pandas pour auditer rapidement la santé de vos DataFrames.
22
+ Elle est utilisée pour générer un court rapport sur la qualité de votre dataframe.
23
+ Cela évite de taper manuellement certaines fonctions de pandas.
24
+
25
+
26
+ ## Installation
27
+
28
+ ```bash
29
+ pip install pd_quality
@@ -0,0 +1,11 @@
1
+ # pd_quality
2
+
3
+ `pd_quality` est une librairie légère qui s'intègre directement à Pandas pour auditer rapidement la santé de vos DataFrames.
4
+ Elle est utilisée pour générer un court rapport sur la qualité de votre dataframe.
5
+ Cela évite de taper manuellement certaines fonctions de pandas.
6
+
7
+
8
+ ## Installation
9
+
10
+ ```bash
11
+ pip install pd_quality
@@ -0,0 +1 @@
1
+ from .core import QualityAnalyzer
@@ -0,0 +1,45 @@
1
+ import pandas as pd
2
+ import numpy as np
3
+
4
+ @pd.api.extensions.register_dataframe_accessor("quality")
5
+ class QualityAnalyzer:
6
+ def __init__(self, pandas_obj):
7
+ self._obj = pandas_obj
8
+
9
+ def check_missing(self):
10
+ """Calcule le taux de valeurs manquantes par colonne."""
11
+ missing = self._obj.isnull().sum()
12
+ percent = (missing / len(self._obj)) * 100
13
+ return pd.DataFrame({'Missing': missing, 'Percentage (%)': percent.round(2)})
14
+
15
+ def check_duplicates(self):
16
+ """Compte les lignes totalement dupliquées."""
17
+ return self._obj.duplicated().sum()
18
+
19
+ def check_types(self):
20
+ """Analyse la cohérence des types de données."""
21
+ return self._obj.dtypes
22
+
23
+ def report(self):
24
+ """Génère un mini-rapport textuel et statistique."""
25
+ missing_df = self.check_missing()
26
+ dupes = self.check_duplicates()
27
+ mem = self._obj.memory_usage(deep=True).sum() / (1024**2) # MB
28
+
29
+ print("--- RAPPORT DE QUALITÉ DES DONNÉES ---")
30
+ print(f"Format : {self._obj.shape[0]} lignes | {self._obj.shape[1]} colonnes")
31
+ print(f"Utilisation Mémoire : {mem:.2f} MB")
32
+ print(f"Lignes dupliquées : {dupes}")
33
+ print("\n--- Analyse des valeurs manquantes ---")
34
+ print(missing_df[missing_df['Missing'] > 0] if missing_df['Missing'].any() else "Aucune valeur manquante.")
35
+ print("\n--- Aperçu des types ---")
36
+ print(self.check_types().value_counts())
37
+ print("--------------------------------------")
38
+
39
+ # Retourne un dictionnaire pour exploitation programmatique
40
+ return {
41
+ "shape": self._obj.shape,
42
+ "missing_total": missing_df['Missing'].sum(),
43
+ "duplicates": dupes,
44
+ "memory_mb": mem
45
+ }
@@ -0,0 +1,29 @@
1
+ Metadata-Version: 2.4
2
+ Name: pd_quality
3
+ Version: 0.1.0
4
+ Summary: Une extension Pandas pour générer un rapport rapide sur la qualité des données de votre dataframe, j'en avais marre de tout réecris à la main à chaque nouveau projet.
5
+ Author-email: Thomas Lefebvre <thomas.lfbv@icloud.com>
6
+ Project-URL: Homepage, https://github.com/thomaslfbv/pd_quality
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Intended Audience :: Science/Research
11
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
12
+ Requires-Python: >=3.8
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE
15
+ Requires-Dist: pandas>=1.5.0
16
+ Requires-Dist: numpy>=1.20.0
17
+ Dynamic: license-file
18
+
19
+ # pd_quality
20
+
21
+ `pd_quality` est une librairie légère qui s'intègre directement à Pandas pour auditer rapidement la santé de vos DataFrames.
22
+ Elle est utilisée pour générer un court rapport sur la qualité de votre dataframe.
23
+ Cela évite de taper manuellement certaines fonctions de pandas.
24
+
25
+
26
+ ## Installation
27
+
28
+ ```bash
29
+ pip install pd_quality
@@ -0,0 +1,11 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ pd_quality/__init__.py
5
+ pd_quality/core.py
6
+ pd_quality.egg-info/PKG-INFO
7
+ pd_quality.egg-info/SOURCES.txt
8
+ pd_quality.egg-info/dependency_links.txt
9
+ pd_quality.egg-info/requires.txt
10
+ pd_quality.egg-info/top_level.txt
11
+ tests/test_core.py
@@ -0,0 +1,2 @@
1
+ pandas>=1.5.0
2
+ numpy>=1.20.0
@@ -0,0 +1 @@
1
+ pd_quality
@@ -0,0 +1,27 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "pd_quality"
7
+ version = "0.1.0"
8
+ authors = [
9
+ { name="Thomas Lefebvre", email="thomas.lfbv@icloud.com" },
10
+ ]
11
+ description = "Une extension Pandas pour générer un rapport rapide sur la qualité des données de votre dataframe, j'en avais marre de tout réecris à la main à chaque nouveau projet."
12
+ readme = "README.md"
13
+ requires-python = ">=3.8"
14
+ dependencies = [
15
+ "pandas>=1.5.0",
16
+ "numpy>=1.20.0",
17
+ ]
18
+ classifiers = [
19
+ "Programming Language :: Python :: 3",
20
+ "License :: OSI Approved :: MIT License",
21
+ "Operating System :: OS Independent",
22
+ "Intended Audience :: Science/Research",
23
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
24
+ ]
25
+
26
+ [project.urls]
27
+ "Homepage" = "https://github.com/thomaslfbv/pd_quality"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,20 @@
1
+ import pandas as pd
2
+ import numpy as np
3
+ import pytest
4
+ import pd_quality # Importe ta librairie
5
+
6
+ def test_report_structure():
7
+ # 1. Création d'un DF de test
8
+ df = pd.DataFrame({
9
+ 'A': [1, 2, np.nan],
10
+ 'B': [1, 2, 1]
11
+ })
12
+
13
+ # 2. Exécution du rapport
14
+ report = df.quality.report()
15
+
16
+ # 3. Vérifications (Assertions)
17
+ assert report['shape'] == (3, 2)
18
+ assert report['missing_total'] == 1
19
+ assert report['duplicates'] == 0
20
+ assert 'memory_mb' in report