Logo Lanfrica

SHAPAA07/GRANTS-SCRAPER-FOR-AFRICAN-NGO-S

Creator:
SHA
Host:
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 …