Skip to main content

Download and parse Weekly Epidemiological Reports (WER) from the Epidemiology Unit, Ministry of Health, Sri Lanka

Project description

srilanka-epi

Python library to download and parse Weekly Epidemiological Reports (WER) from the Epidemiology Unit, Ministry of Health, Sri Lanka.

Built as part of DengueSense LK — Final Year Development Project, ICBT Campus / Cardiff Metropolitan University (2026).


Installation

pip install srilanka-epi

Or from source:

git clone https://github.com/chathurakavinduweerakoon/srilanka-epi
cd srilanka-epi
pip install -e .

Quick Start

from srilanka_epi.wer import download_range, build_dengue_timeseries
from srilanka_epi.dengue import top_districts, add_province

# Download WER Vol 53 (2026) issues 1-18 and extract dengue data
results = download_range(volume=53, start_no=1, end_no=18, save_dir="./wer_pdfs")
dengue_df = build_dengue_timeseries(results)

# Add province column
dengue_df = add_province(dengue_df)

# Top 5 districts for week 17, 2026
top5 = top_districts(dengue_df, week_no=17, year=2026, n=5)
print(top5)

# Export to CSV
dengue_df.to_csv("dengue_srilanka_2026.csv", index=False)

Parse a Single PDF

from srilanka_epi.wer import parse_wer_pdf

# From file path
result = parse_wer_pdf("WER_Vol53_No18.pdf", volume=53, number=18)

# From URL
result = parse_wer_pdf("https://www.epid.gov.lk/.../en_53_18.pdf", volume=53, number=18)

# From bytes
with open("WER.pdf", "rb") as f:
    result = parse_wer_pdf(f.read(), volume=53, number=18)

print(result['metadata'])
print(result['dengue'])

DengueSense LK — LSTM Feature Matrix with BSDS

from srilanka_epi.dengue import merge_bsds_with_dengue

# citizen_reports_df: DataFrame from DengueSense LK Spring Boot API
# columns: [district, week_no, year, risk_label]
lstm_features = merge_bsds_with_dengue(dengue_df, citizen_reports_df)
lstm_features.to_csv("lstm_input_features.csv", index=False)

Modules

Module Purpose
srilanka_epi.wer Download & parse WER PDFs
srilanka_epi.dengue Dengue-specific helpers, BSDS computation

Data Source

All data is sourced from the Epidemiology Unit, Ministry of Health & Indigenous Medicine, Sri Lanka.

Please acknowledge the Epidemiology Unit as the primary data source in any publications.


Citation

Weerakoon, R.B.H.G.C.K.B. (2026). srilanka-epi: Python library for Sri Lanka
Weekly Epidemiological Report data extraction. ICBT Campus / Cardiff Metropolitan University.
https://github.com/chathurakavinduweerakoon/srilanka-epi

License

MIT License


What's New in v1.1.0

Manual PDF Parsing

from srilanka_epi.wer import parse_wer_pdf

# Parse a manually downloaded WER PDF
result = parse_wer_pdf("WER_Vol53_No18.pdf")
print(result['dengue'])

HTML Source URL Scraping

from srilanka_epi.wer import scrape_wer_urls_from_html

# 1. Open epid.gov.lk/weekly-epidemiological-report in browser
# 2. Ctrl+U → Ctrl+A → Ctrl+C → save as wer_page_source.html
with open("wer_page_source.html") as f:
    html = f.read()

urls = scrape_wer_urls_from_html(html)
# Automatically registers all discovered URLs

Register New URLs

from srilanka_epi.wer import register_url

register_url(53, 19, "https://www.epid.gov.lk/storage/post/pdfs/en_XXXX_Vol_53_no_19-english.pdf")

Known URLs (Vol 53 — 2026)

Issue URL
Vol 53 No 17 en_6a21b6d0a75dd_Vol_53_no_17-english.pdf
Vol 53 No 18 en_6a224842b5f47_Vol_53_no_18-english.pdf

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

srilanka_epi-1.1.0.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

srilanka_epi-1.1.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file srilanka_epi-1.1.0.tar.gz.

File metadata

  • Download URL: srilanka_epi-1.1.0.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.8

File hashes

Hashes for srilanka_epi-1.1.0.tar.gz
Algorithm Hash digest
SHA256 2053468b3ba7859ae554893ba057e8ad6ec9aaccc32f1e39d0d81bfb3cc46c09
MD5 3f9a0ca5ed46b88c8d616b2e4a7cd6f3
BLAKE2b-256 bb11a663d938e817547e75c21ebd093bd97a94a1d5027bd3a3f72f557a7d91df

See more details on using hashes here.

File details

Details for the file srilanka_epi-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: srilanka_epi-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.8

File hashes

Hashes for srilanka_epi-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b66b8379a8550c4a27ee43b315598a91d69730af51a4d5c8e21ebee1adc34917
MD5 e23ff1ff21bb6ae850c8733663bb2e81
BLAKE2b-256 3ab285f5a604d0e8a8208380bc1bc8ddab6f9599c108e7962c0b2f766bed77b1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page