Metadata-Version: 2.4
Name: brvm-data
Version: 0.2.0
Summary: Python data access for BRVM market bulletins
Project-URL: Homepage, https://github.com/withlovekadjah/brvm-data
Project-URL: Repository, https://github.com/withlovekadjah/brvm-data
Project-URL: Issues, https://github.com/withlovekadjah/brvm-data/issues
Keywords: BRVM,West Africa,market data,stocks,bonds,funds
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: numpy>=1.23
Requires-Dist: pandas>=1.5
Requires-Dist: pdfplumber>=0.9
Requires-Dist: requests>=2.28

# BRVM Data

Python data access for the **Bourse Régionale des Valeurs Mobilières (BRVM)**,
built from the exchange's daily market bulletins.

The package downloads bulletin PDFs, stores the extracted source data in SQLite,
and exposes it as pandas DataFrames. It currently covers:

- listed equities and dividend observations;
- headline, compartment, total return, and sector index observations;
- bond, sukuk, securitized debt, and convertible instrument quote rows;
- OPCVM fund net asset value observations.

This is a BRVM package. Other African exchanges require their own data sources
and exchange-specific extractors.

## Install

Requires Python 3.10 or newer. Install the package from PyPI with:

```bash
python -m pip install brvm-data
```

To install from a downloaded or cloned source folder instead, run this from its root:

```bash
python -m pip install .
```

## Download and process bulletins

For an initial historical backfill:

```bash
brvm-update --start 2025-01-01
```

For a daily update, continue from the latest bulletin already stored:

```bash
brvm-update
```

To process PDFs already in `bulletins/` without downloading:

```bash
brvm-update --no-download
```

The default database is `brvm.db` in the current directory. The default PDF
folder is `bulletins/`. Use `--db` and `--folder` to change either location.
Bulletin downloads are limited to weekdays; days without a published file are
reported and skipped.

## Read the data

```python
import brvm

equities = brvm.load_equities("SNTS", start="2026-01-01")
prices = brvm.load_prices("SNTS", start="2026-01-01")
dividends = brvm.load_dividends("SNTS")

indices = brvm.load_indices("BRVM COMPOSITE", start="2025-01-01")
bonds = brvm.load_fixed_income("TPCI.O90", start="2025-01-01")
funds = brvm.load_funds(start="2025-01-01")
```

All loaders return pandas DataFrames. Prices and rates are parsed as numbers;
missing or non-quoted prices are null. The daily bulletin does not provide
equity high/low prices. The bulletin's sector indices use different base dates;
the loader preserves that distinction in names such as
`BRVM - SERVICES PUBLICS [base 1999]` and
`BRVM - SERVICES PUBLICS [base 2025]`.

## Data and limitations

- The bulletin is the source of record; this package is an extractor, not an
  official BRVM API.
- Suspended and non-quoted prices are not treated as traded prices.
- A computed equity return can differ from the printed variation. The pipeline
  reports these as data-quality warnings for review.
- Fixed-income instruments may have no trade on a given day. Coupon details
  are still reported separately from the daily trading price.
- The historical PDFs and generated SQLite database are local data and are not
  included in the source repository.

## Development

Run the automated tests with:

```bash
python -m unittest discover -s tests -v
```

The GitHub Actions workflow runs the same tests on pushes and pull requests.
The tests use synthetic table rows and do not require network access or the
historical bulletin PDFs.

