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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8ec05d3e5df74aad9550abcbd034ec4672989c849fe874c83415c02be8c925f
|
|
| MD5 |
50fab1000229b24f6b12ded87c2d8808
|
|
| BLAKE2b-256 |
1d167d64de2d8e6fe969c5283560c26d67a9efdb859314877ec6210e3f163718
|
File details
Details for the file snt_malaria_budgeting-0.1.2-py3-none-any.whl.
File metadata
- Download URL: snt_malaria_budgeting-0.1.2-py3-none-any.whl
- Upload date:
- Size: 22.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
307686980db54c78cefa23b3b9c38d3481315a18a9a552bfa30b7249ed2077bf
|
|
| MD5 |
61f12c9937d3ccd2b8cb0118bbdb1799
|
|
| BLAKE2b-256 |
7d9ed6c8ee6a56a7f22fab62afa73adad6ab25e6bdd239942e1a9b8159ed373d
|