Skip to main content

Python client for BCEAO/UEMOA macroeconomic data

Project description

bceaoapi

Données macroéconomiques de la BCEAO/UEMOA en Python — accès direct, sans configuration.

pip install bceaoapi
from bceaoapi import BCEAO

b = BCEAO()  # se connecte automatiquement à l'API publique

# PIB du Sénégal en 2022
b.get_value("IMECO", "PIB nominal", "SENEGAL", 2022)
# → 17330.12

# Série temporelle complète
gdp = b.get_series_by("IMECO", "PIB nominal", "SENEGAL", start="2000")
gdp.plot(title="PIB Sénégal (Mds FCFA)")

# Les 8 pays en un appel
inflation = b.get_cross_country("IHPC", "Ensemble", start="2015")
inflation.plot(title="Inflation UEMOA")

Couverture

Datasets 39 (PIB, inflation, taux de change, banques, balance des paiements, dette publique…)
Séries 9 500+ — une par pays/indicateur
Observations 830 000+ — de 1960 à 2025
Pays BÉNIN · BURKINA FASO · CÔTE D'IVOIRE · GUINÉE BISSAU · MALI · NIGER · SÉNÉGAL · TOGO

Explorer les données disponibles

Pas besoin de connaître les codes de séries. On explore en 3 étapes :

# 1. Quels datasets existent ?
b.list_datasets()

# 2. Quels indicateurs dans un dataset ?
b.list_indicators("IHPC")
# ['Alimentation', 'Ameublement', 'Ensemble', 'Transport', ...]

# 3. Récupérer
b.get_series_by("IHPC", "Ensemble", "BURKINA FASO", start="2010")

Ou par recherche libre :

b.search("taux de change", frequency="MONTHLY")
b.search("PIB", country="MALI")

Toutes les méthodes

Méthode Retourne Description
list_datasets() DataFrame Tous les datasets disponibles
list_countries(dataset?) list Pays disponibles
list_indicators(dataset) list Indicateurs d'un dataset
get_series_by(dataset, indicator, country) Series Série temporelle par nom
get_value(dataset, indicator, country, year) float Une valeur précise
get_cross_country(dataset, indicator) DataFrame Les 8 pays côte à côte
get_dataset(dataset, country?) DataFrame Tous les indicateurs d'un dataset
get_series(code) Series Série par code (ex. KKKSR1012A0BP)
search(query) DataFrame Recherche libre

Tous les paramètres start / end acceptent une année ("2000") ou une date ISO ("2000-01-31").


Gestion des erreurs

from bceaoapi import AmbiguousQueryError, SeriesNotFoundError

try:
    b.get_series_by("PIBN", "PIB", "SENEGAL")
except AmbiguousQueryError as e:
    print(e)
    # 2 séries correspondent. Soyez plus précis.
    # Trouvé : [KKKSR1012A0BP] PIB marchand, [KKKSR1013A0BP] PIB non marchand

try:
    b.get_series_by("IHPC", "xxx", "MALI")
except SeriesNotFoundError as e:
    print(e)
    # Conseil : utilisez b.list_indicators('IHPC') pour voir les libellés exacts.

Source des données

Données publiées par la BCEAO sur edenpub.bceao.int. Ce package est indépendant de la BCEAO et n'est pas affilié à celle-ci.

Licence

MIT

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

bceaoapi-0.1.0.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

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

bceaoapi-0.1.0-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file bceaoapi-0.1.0.tar.gz.

File metadata

  • Download URL: bceaoapi-0.1.0.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for bceaoapi-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8c774e025d6e878747b16b1a92d8b677c9acbdcea40683811082211c2a7d0ece
MD5 5ece006c1e4b053b730bd57866be4c47
BLAKE2b-256 0f830bdf0bb04d6747559377d997cdb130f05450f756743e1c2373114ec6bbf6

See more details on using hashes here.

File details

Details for the file bceaoapi-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bceaoapi-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for bceaoapi-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7e62346ae932041765a488e35ebfa4fc5c57271f32c28632336cd3be8705598d
MD5 4bc1d5816ec0714fe1a385c83cc3c3c8
BLAKE2b-256 0d132f1a5630bd4ee5fd4e8870b8fd0d713dc31f3164be6c6f6dd8cdf4285fa2

See more details on using hashes here.

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