Skip to main content

A Python library for calculating malaria intervention budgets

Project description

SNT Malaria Budgeting

A Python library for calculating malaria intervention budgets across different countries and time periods.

Installation

Install the package and its dependencies:

pip install -r requirements.txt

Example usage

To fetch budgets for a given country and years:

from snt_malaria_budgeting import get_budget

country = "DRC"
start_year = 2025
end_year = 2027
interventions = [
    {"name": "smc", "type": "SP+AQ", "places": ["Tshopo:Opala"]},
    {"name": "vacc", "type": "R21", "places": ["Tshopo:Opala"]},
    {"name": "iptp", "type": "SP", "places": ["Tshopo:Opala"]},
]
settings = {
    "smc_buffer": 1.5,
    "vacc_doses_per_child": 4,
    "currency": "NGN",
}

budgets = []

for year in range(start_year, end_year + 1):
    print(f"Fetching budget for year: {year}")
    budgets.append(
        get_budget(
            country=country,
            year=year,
            interventions_input=interventions,
            settings=settings,
            cost_df=cost_df,
            population_df=population_df,
            cost_overrides=[], # optional
        )
    )

print(budgets)

Development

Running Tests

pip install pytest pytest-cov

Run the test suite:

pytest
pytest -v # verbose output
pytest --cov=snt_malaria_budgeting --cov-report=html # with coverage report

# specific test files or methods:
pytest tests/core/test_budget_calculator.py
pytest tests/core/test_budget_calculator.py::TestBudgetCalculator::test_iptp_quantification

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

snt_malaria_budgeting-0.1.2.tar.gz (22.4 kB view details)

Uploaded Source

Built Distribution

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

snt_malaria_budgeting-0.1.2-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file snt_malaria_budgeting-0.1.2.tar.gz.

File metadata

  • Download URL: snt_malaria_budgeting-0.1.2.tar.gz
  • Upload date:
  • Size: 22.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for snt_malaria_budgeting-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a8ec05d3e5df74aad9550abcbd034ec4672989c849fe874c83415c02be8c925f
MD5 50fab1000229b24f6b12ded87c2d8808
BLAKE2b-256 1d167d64de2d8e6fe969c5283560c26d67a9efdb859314877ec6210e3f163718

See more details on using hashes here.

File details

Details for the file snt_malaria_budgeting-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for snt_malaria_budgeting-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 307686980db54c78cefa23b3b9c38d3481315a18a9a552bfa30b7249ed2077bf
MD5 61f12c9937d3ccd2b8cb0118bbdb1799
BLAKE2b-256 7d9ed6c8ee6a56a7f22fab62afa73adad6ab25e6bdd239942e1a9b8159ed373d

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