Skip to main content

Le "pandas" de l'agriculture africaine. Interface Python pour les données météo, de marché et de récoltes au Bénin.

Project description

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

pip install kadipy

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 et CHIRPS.
  • 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kadipy-1.0.0.tar.gz (116.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kadipy-1.0.0-py3-none-any.whl (138.5 kB view details)

Uploaded Python 3

File details

Details for the file kadipy-1.0.0.tar.gz.

File metadata

  • Download URL: kadipy-1.0.0.tar.gz
  • Upload date:
  • Size: 116.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kadipy-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e46a35d4e644183e465a1b12015877d747646872c1e22e3ef4ab9bd638708029
MD5 c1dfe589843c3ea479cd9179e92c5f77
BLAKE2b-256 e0b5314840039a089f065621deae23dfb2f022b4387180bdc234e47e27eac58b

See more details on using hashes here.

Provenance

The following attestation bundles were made for kadipy-1.0.0.tar.gz:

Publisher: publish.yml on delsDin/kadipy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kadipy-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: kadipy-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 138.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kadipy-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 406e29a8d7fc7a90354efd0556fea3598cfe608362430ad3b3d11958e7917942
MD5 233c6d9ea030953b2248a6558f3cc9cc
BLAKE2b-256 f23e1ebd23b510ab59d734deddbb3ab7f9ab72df950167d9d90ea3b723251a96

See more details on using hashes here.

Provenance

The following attestation bundles were made for kadipy-1.0.0-py3-none-any.whl:

Publisher: publish.yml on delsDin/kadipy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page