Skip to main content

AfriMarkets

AfriMarkets

African Financial Markets Data for Python

Python License Status Market

Simple. Open source. Built for African financial markets.

Français · English · Yorùbá


🌍 About AfriMarkets

AfriMarkets is an open-source Python package designed to provide a simple and unified interface for accessing and working with African financial markets.

The project aims to make African financial-market data more accessible to:

  • 👨‍💻 Developers
  • 📊 Data scientists
  • 🎓 Researchers
  • 💼 Investors
  • 🏦 Financial institutions
  • 🚀 Fintechs

Current status: Alpha — v0.1.0 Current market: BRVM Python: >=3.12

The market registry and initial BRVM support are currently available.

Ticker and historical-price connectors are still under active development.


📈 Vision

AfriMarkets aims to become a unified Python ecosystem for African financial markets.

                    AfriMarkets
                         │
        ┌────────────────┼────────────────┐
        │                │                │
      Markets          Assets           Data
        │                │                │
   ┌────┼────┐      ┌────┼────┐      ┌────┼────┐
   │    │    │      │    │    │      │    │    │
 BRVM  NSE  JSE   Share Bond Index  Prices Tickers ...

The long-term objective is to support multiple African markets through a common and consistent API.


🇫🇷 Français

Installation

Python 3.12 ou une version plus récente est nécessaire.

git clone https://github.com/XGEOSOFT-CORPORATION/AfriMarkets-python.git

cd AfriMarkets-python

python -m venv .venv

source .venv/bin/activate

# Windows :
# .venv\Scripts\activate

python -m pip install -e .

🚀 Utilisation

Accéder à la BRVM

from afrimarkets import BRVM

market = BRVM()

data = market.get_data(
    ["BOAB"],
    start="2020-01-01",
    end="2026-01-31",
    structure="column",
)

print(data)

🔎 Récupérer les tickers

Lorsque la connexion Internet est disponible, BRVM() récupère automatiquement les tickers du marché lors de son initialisation.

Pour récupérer ou actualiser les tickers :

tickers = market.get_tickers()

print(tickers)
print(market.tickers)

Une connexion Internet stable est nécessaire pour récupérer les données en ligne.


🏦 Marchés disponibles

AfriMarkets possède une registry permettant de découvrir les marchés disponibles.

from afrimarkets.markets import available_markets, get_market

print(available_markets())
# ['BRVM']

market = get_market("BRVM")

print(market.code)
# BRVM

Cette architecture permet d'ajouter progressivement de nouveaux marchés sans modifier l'interface utilisateur.


📊 Créer un actif

Un actif peut être créé directement :

from afrimarkets.assets import Share

share = Share(
    symbol="BOAB",
    name="Entreprise exemple"
)

print(share.info())

🗺️ Marchés prévus

Marché Pays / Région Statut
🇨🇮 BRVM UEMOA 🟢 Initial
🇳🇬 NGX Nigeria 🔵 Planned
🇿🇦 JSE Afrique du Sud 🔵 Planned
🇰🇪 NSE Kenya 🔵 Planned
🇪🇬 EGX Égypte 🔵 Planned
🇲🇦 CSE Maroc 🔵 Planned

Cette liste représente la direction du projet et ne signifie pas que les connecteurs correspondants sont déjà disponibles.


🧱 Architecture

AfriMarkets est conçu autour de plusieurs composants :

afrimarkets/
│
├── assets/
│   ├── share.py
│   ├── bond.py
│   └── index.py
│
├── markets/
│   ├── registry.py
│   ├── brvm.py
│   └── ...
│
├── connectors/
│   ├── tickers/
│   └── prices/
│
├── utils/
│
└── __init__.py

L'objectif est de séparer :

Market → Asset → Connector → Data

afin de faciliter l'extension du package.


🛣️ Roadmap

v0.1.x

  • Market registry
  • BRVM initial support
  • Asset objects
  • Automatic ticker loading
  • Historical data interface
  • More robust BRVM connector
  • Extended tests

v0.2.x

  • Additional African markets
  • Improved historical-price connectors
  • Better error handling
  • Data validation
  • Caching
  • Documentation website

Future

  • Fundamental financial data
  • Market indices
  • Bonds
  • ETFs
  • Portfolio analysis
  • Financial indicators
  • Quantitative research tools

⚠️ Disclaimer

AfriMarkets is a software and data-access project.

It does not provide investment advice and does not guarantee the accuracy, completeness or availability of market data.

Users are responsible for validating data before using it for financial, research or investment purposes.


🤝 Contributing

Contributions are welcome!

You can contribute by:

  • adding a new African market;
  • improving a connector;
  • adding tests;
  • improving documentation;
  • reporting bugs;
  • proposing new features;
  • developing analysis tools.

Every contribution helps make African financial-market data more accessible.


🇬🇧 English

Installation

Python 3.12 or later is required.

git clone https://github.com/XGEOSOFT-CORPORATION/AfriMarkets-python.git

cd AfriMarkets-python

python -m venv .venv

source .venv/bin/activate

# Windows:
# .venv\Scripts\activate

python -m pip install -e .

Usage

Access BRVM

from afrimarkets import BRVM

market = BRVM()

data = market.get_data(
    ["BOAB"],
    start="2020-01-01",
    end="2026-01-31",
    structure="column",
)

print(data)

Retrieve tickers

tickers = market.get_tickers()

print(tickers)
print(market.tickers)

Available markets

from afrimarkets.markets import available_markets, get_market

print(available_markets())
# ['BRVM']

market = get_market("BRVM")

print(market.code)
# BRVM

Create an asset

from afrimarkets.assets import Share

share = Share(
    symbol="BOAB",
    name="Example company"
)

print(share.info())

Contributing

Contributions are welcome from developers, researchers, data scientists and financial professionals interested in African financial markets.

We welcome:

  • new market implementations;
  • data connectors;
  • tests;
  • documentation;
  • analysis tools;
  • bug fixes;
  • new features.

🇳🇬 Yorùbá

Nípa AfriMarkets

AfriMarkets jẹ́ package Python open source tí ó ń pèsè ọ̀nà rọrùn àti ìṣọ̀kan fún lílo data àwọn ọjà ìṣúná Áfíríkà.

Ó ń fẹ́ kí data ọjà ìṣúná Áfíríkà rọrùn fún:

  • 👨‍💻 Developers
  • 📊 Data scientists
  • 🎓 Researchers
  • 💼 Investors
  • 🏦 Financial institutions
  • 🚀 Fintechs

Ipò iṣẹ́: Alpha — v0.1.0

Ọjà tó wà báyìí: BRVM

Python: >=3.12


Fifi sori ẹrọ

git clone https://github.com/XGEOSOFT-CORPORATION/AfriMarkets-python.git

cd AfriMarkets-python

python -m venv .venv

source .venv/bin/activate

python -m pip install -e .

Lílò

from afrimarkets import BRVM

market = BRVM()

data = market.get_data(
    ["BOAB"],
    start="2020-01-01",
    end="2026-01-31",
    structure="column",
)

print(data)

Láti gba àwọn ticker:

tickers = market.get_tickers()

print(market.tickers)

Láti wo àwọn ọjà tó wà:

from afrimarkets.markets import available_markets, get_market

print(available_markets())

market = get_market("BRVM")

print(market.code)

👥 Authors

Name Role Contact
Olabiyi Aurel Géoffroy Odjo Creator & Maintainer odjoaurel@gmail.com
Koffi Frederic Sessie Author koffisessie@gmail.com
Abdoul Oudouss Diakité Author abdouloudoussdiakite@gmail.com
Steven P. Sanderson II, MPH Author spsanderson@gmail.com

📄 License

AfriMarkets is distributed under the MIT License.

See LICENSE for more information.


🔗 Links

Repository: https://github.com/XGEOSOFT-CORPORATION/AfriMarkets

Issues: https://github.com/XGEOSOFT-CORPORATION/AfriMarkets/issues


🌍 Built for African Financial Markets

AfriMarkets

Making African market data more accessible.

Metadata

Release files for afrimarkets 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 afrimarkets 0.1.1
File Size Uploaded Provenance Actions
afrimarkets-0.1.1.tar.gz 14.3 kB Without provenance Details for afrimarkets-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 28.1 kB

Release files / afrimarkets-0.1.1.tar.gz

Download URL afrimarkets-0.1.1.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ee37f367676d7ac733d3ac0e49727c6b45c4c5e2aa34923565b116fd571cecfc
BLAKE2b-256 checksum
How to use checksums
76869a83fd247f367e75cd8af8201c3b24a0f36fa2bf5934c9778e9fc0b4b60e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

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

Download URL afrimarkets-0.1.1-py3-none-any.whl
Size 13.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c5fa07c4c23580a8f62b2d4ed5b2df88a9919b844b31b0b7e08f57bf1990cdf
BLAKE2b-256 checksum
How to use checksums
e3fc706c72ac24d105def91583dda97930526c1c04c5fbec7053bfd8e998ae46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for afrimarkets 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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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