Skip to main content

bceaoapi

BCEAO/UEMOA macroeconomic data in Python. No setup required.

pip install bceaoapi
from bceaoapi import BCEAO

b = BCEAO()  # connects to the public API automatically

# Senegal GDP in 2022
b.get_value("IMECO", "PIB nominal", "SENEGAL", 2022)
# → 17330.12

# Full time series
gdp = b.get_series_by("IMECO", "PIB nominal", "SENEGAL", start="2000")
gdp.plot(title="Senegal GDP (bn FCFA)")

# All 8 countries in one call
inflation = b.get_cross_country("IHPC", "Ensemble", start="2015")
inflation.plot(title="UEMOA Inflation")

Coverage

Datasets 39 (GDP, inflation, exchange rates, banking, balance of payments, public debt…)
Series 9 500+ — one per country/indicator combination
Observations 830 000+ — from 1960 to 2025
Countries BENIN · BURKINA FASO · CÔTE D'IVOIRE · GUINÉE BISSAU · MALI · NIGER · SÉNÉGAL · TOGO

Exploring available data

No series codes needed. Discover data in 3 steps:

# 1. What datasets are available?
b.list_datasets()

# 2. What indicators are in a dataset?
b.list_indicators("IHPC")
# ['Alimentation', 'Ameublement', 'Ensemble', 'Transport', ...]

# 3. Fetch
b.get_series_by("IHPC", "Ensemble", "BURKINA FASO", start="2010")

Or search by free text:

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

Methods

Method Returns Description
list_datasets() DataFrame All available datasets
list_countries(dataset?) list Available countries
list_indicators(dataset) list Indicators in a dataset
get_series_by(dataset, indicator, country) Series Time series by name
get_value(dataset, indicator, country, year) float Single data point
get_cross_country(dataset, indicator) DataFrame All 8 countries side by side
get_dataset(dataset, country?) DataFrame All indicators in a dataset
get_series(code) Series Series by code (e.g. KKKSR1012A0BP)
search(query) DataFrame Free-text search

start / end parameters accept a year ("2000") or an ISO date ("2000-01-31").


Error handling

from bceaoapi import AmbiguousQueryError, SeriesNotFoundError

try:
    b.get_series_by("PIBN", "PIB", "SENEGAL")
except AmbiguousQueryError as e:
    print(e)
    # 2 series match. Use a more specific label.
    # Found: [KKKSR1012A0BP] PIB marchand, [KKKSR1013A0BP] PIB non marchand

try:
    b.get_series_by("IHPC", "xxx", "MALI")
except SeriesNotFoundError as e:
    print(e)
    # Tip: use b.list_indicators('IHPC') to see available labels.

Data source

Data published by the BCEAO via edenpub.bceao.int. This package is independent and not affiliated with or endorsed by the BCEAO.

License

MIT

Metadata

Release files for bceaoapi 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bceaoapi 0.1.1
File Size Uploaded Provenance
bceaoapi-0.1.1.tar.gz 16.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bceaoapi 0.1.1
File Interpreter ABI Platform
bceaoapi-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 31.3 kB

Release files / bceaoapi-0.1.1.tar.gz

Download URL bceaoapi-0.1.1.tar.gz
Size 16.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2512771bba1064f102a0c6ba8de6205f2ee8d5331238c10dc9d59bbe9c4cb208
BLAKE2b-256 checksum
How to use checksums
9aecbc0e3d7e107f990db819793e348a486737cfe6a507e5907f3b49a7c0fa1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Release files / bceaoapi-0.1.1-py3-none-any.whl

Download URL bceaoapi-0.1.1-py3-none-any.whl
Size 15.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
143d271960e24c2cd23d19a545b131ff86a854ef0ed6afccb742589a00a6654a
BLAKE2b-256 checksum
How to use checksums
f2cf32c0f4aa8eb909a9d2d85cfc8158c9252517e13491c936bef9f49b4d4daa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Security for bceaoapi 0.1.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page