Downloads daily French market bulletin PDFs (BCFR_YYYYMMDD.pdf) from BdC website over a date range via CLI or Python.
Activate the virtual environment
source .venv/bin/activateInstall dependencies
uv syncRun commands directly inside the virtual environment with uv run:
uv run main.py --help
Download bulletins for a date range (weekends are skipped by default):
uv run python main.py \
--start-date 2026-11-16 \
--end-date 2026-11-27 \
--output-dir ./bulletins \
--sleep 0.5
| Flag | Default | Description |
|---|---|---|
--start-date |
required | Start date (YYYY-MM-DD, inclusive) |
--end-date |
required | End date (YYYY-MM-DD, inclusive) |
--output-dir |
. |
Target folder for downloaded PDFs |
--sleep |
0.0 |
Seconds to pause between dates |
--include-weekends |
false |
Check Saturday and Sunday dates too |
--verify-ssl |
false |
Enable TLS certificate verification |
--overwrite |
false |
Re-download files that already exist |
--timeout |
30 |
Per-request timeout in seconds |
-v, --verbose |
false |
Show skipped weekends and missing dates (DEBUG logs) |
Import download_bulletins from main.py:
from datetime import date
from main import download_bulletins
files = download_bulletins(
start_date=date(2026, 11, 16),
end_date="2026-11-27",
output_dir="./bulletins",
sleep_seconds=0.5,
skip_weekends=True,
)Target pattern:
https://www.casablanca-bourse.com/sites/default/files/bulletins/{ingestion_year_month}/fr/BCFR_{YYYYMMDD}.pdf
- Before
2026-07-03: Uses2026-06. - On
2026-07-03: Uses09-2026. - After
2026-07-03: TriesYYYY-MMof the bulletin date first, then falls back to the previous month (YYYY-MM) on404. - Weekends: Saturday and Sunday are skipped by default (
skip_weekends=True). - TLS verification: Disabled by default (
verify_ssl=False) withInsecureRequestWarningsuppressed to work around the host's incomplete certificate chain.