KadiPy
Le "pandas" de l'agriculture africaine.
KadiPy est une bibliothèque Python conçue pour les agronomes, chercheurs et développeurs travaillant sur les données agricoles au Bénin et en Afrique de l'Ouest. Elle fournit une interface unifiée pour traiter les données météorologiques, les prix de marché et les données de récoltes, avec une approche hors ligne en premier (offline-first).
Installation
# Depuis PyPI
pip install kadipy
# Ou en mode développement local depuis les sources
pip install -e ".[dev]"
Nécessite Python 3.9 ou supérieur.
Modules disponibles
kadi.market : analyse économique des marchés agricoles béninois.
- Récupération des prix via l'API WFP DataBridges.
- Prévisions de prix par régression linéaire saisonnière.
- Calcul des coûts de transport avec données routières réelles (OSRM).
- Aide à la décision : arbitrage spatial, stockage stratégique, score de confiance.
- Backtesting des prévisions (MAE, RMSE, MAPE, précision directionnelle).
kadi.weather : données météorologiques et indicateurs agronomiques.
- Prévisions et historiques via Open-Meteo. Données de précipitation haute résolution via CHIRPS (Climate Hazards Group, UC Santa Barbara) en mode hybride automatique : CHIRPS pour l'historique long terme, Open-Meteo pour les données récentes. Repli automatique sur Open-Meteo si CHIRPS est inaccessible (mode hors ligne ou serveur indisponible).
- Phénologie : détection de la saison des pluies (Sivakumar, Walter-Anyadike), GDD.
- Hydrologie : évapotranspiration ET0 (Hargreaves-Samani), bilan hydrique FAO-56.
- Risques climatiques : indice de sécheresse (SPI), probabilité de pluie.
kadi.kidas : pipeline de traitement des données agricoles.
- Nettoyage : valeurs manquantes, doublons, valeurs aberrantes.
- Validation : types, plages de valeurs, rapport d'erreurs.
- Normalisation : noms de cultures, marchés, unités et coordonnées GPS.
Démarrage rapide
from kadi.weather import WeatherSession
from kadi.market import Market
# Données météo pour Parakou
session = WeatherSession(latitude=9.33, longitude=2.63, name="Parakou")
previsions = session.forecast(days=3)
print(previsions["data"])
# Analyse de marché
marche = Market(latitude=9.30, longitude=2.08, location="Parakou",
weather_session=session)
# Recommandation d'arbitrage
resultat = marche.decision_support.arbitrage_decision(
crop="maize",
origine="Parakou",
destination="Cotonou",
qty_tons=10.0,
)
print(resultat["recommandation"])
print(f"Score de confiance : {resultat['confidence_score']:.0%}")
Documentation
La documentation complète est disponible sur : https://delsDin.github.io/kadipy/
Contribution et support
- Dépôt GitHub : https://github.com/delsDin/kadipy
- Licence : MIT
- Python : >= 3.9
Metadata
Release files for kadipy 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| kadipy-1.1.0.tar.gz | 145.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kadipy-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 307.9 kB
Release files / kadipy-1.1.0.tar.gz
| Download URL | kadipy-1.1.0.tar.gz |
|---|---|
| Size | 145.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1520493043c2ec3f13420798534ae7d18c0c5aff9496fcae6c415acb010579eb
|
|
BLAKE2b-256 checksum How to use checksums |
c2ec5c295fbcb5da44f3193cbebe9b8d12951543695b7a5253a64668e927b261
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 7, 2026.
Transparency logRelease files / kadipy-1.1.0-py3-none-any.whl
| Download URL | kadipy-1.1.0-py3-none-any.whl |
|---|---|
| Size | 162.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e318c3157b493790e806ba59c3792273de6afb85832139b3ecb45903ef1306d8
|
|
BLAKE2b-256 checksum How to use checksums |
3b55ae6b2ace7c23d3e7fb6aeb6da1efb318a1e7e09f36cfbe06efc92522376b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 7, 2026.
Transparency log