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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c774e025d6e878747b16b1a92d8b677c9acbdcea40683811082211c2a7d0ece
|
|
| MD5 |
5ece006c1e4b053b730bd57866be4c47
|
|
| BLAKE2b-256 |
0f830bdf0bb04d6747559377d997cdb130f05450f756743e1c2373114ec6bbf6
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e62346ae932041765a488e35ebfa4fc5c57271f32c28632336cd3be8705598d
|
|
| MD5 |
4bc1d5816ec0714fe1a385c83cc3c3c8
|
|
| BLAKE2b-256 |
0d132f1a5630bd4ee5fd4e8870b8fd0d713dc31f3164be6c6f6dd8cdf4285fa2
|