A web application that scrapes and displays grant opportunities for African NGOs
# African NGO Grant Scraper
A web application that scrapes, aggregates, and displays grant opportunities for African NGOs and civil society organizations.
## Features
- π **Web Scraping** - Automatically collects grant opportunities from multiple sources
- π **Multi-Source** - Modular architecture to easily add new grant sources
- π
**Smart Filtering** - Automatically filters active and upcoming grant deadlines
- π¨ **Web Interface** - Flask-based web app for browsing and searching grants
- π **Data Export** - Download grants in CSV and JSON formats
- π **Search Logging** - Tracks search history and user activity
## Project Structure
See PROJECT_STRUCTURE.md for detailed architecture and component information.
## Requirements
- Python 3.8+
- Flask
- Requests
- BeautifulSoup4
- Pandas
- python-docx
## Installation
1. Clone the repository:
```bash
git clone
cd grant_scraper
```
2. Create a virtual environment:
```bash
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
```
3. Install dependencies:
```bash
pip install -r requirements.txt
```
## Usage
### Run the Web Application
```bash
python app.py
```
Then open `
localhost` in your browser.
### Run CLI Scraper
```bash
python main.py
```
Outputs results to `output/grants.csv` and `output/grants.json`
## Adding New Grant Sources
1. Create a new file in `sources/` directory (e.g., `new_source.py`)
2. Implement a `fetch_grants()` function that returns a list of grant dictionaries:
```python
def fetch_grants():
return [
{
"title": "Grant Title",
"deadline": "2026-12-31",
"link": "
example.com"
}
]
```
3. Add to `sources/__init__.py`:
```python
from .new_source import fetch_grants as fetch_new_source
all_sources = [fetch_afri_grants, fetch_new_source]
```
## Configuration
Update `app.py` to change:
- Flask secret key (use environment variable in production)
- Results file path
- Search log location
## Output Files
- `output/grants.csv` - All scraped g β¦