Logo Lanfrica
  • Home
  • Atlas
  • Insights
  • Docs
  • Sign in

© 2026 Lanfrica. All rights reserved. All copyrights of the resources shown on the Lanfrica website belong to the original copyright holders, unless explicitly stated otherwise.

ThembaGqaza/stats-sa-crawler

Domain:

socioeconomic

Record type:

software
Creator:
The
Host:
A Python-based web crawler to extract and collect data from the Stats SA (Statistics South Africa) website using web scraping techniques. # Stats SA Data Extraction Script This repository contains a Python-based script designed to extract and collect census data from the Stats SA (Statistics South Africa) API. The script efficiently loops through all provinces, districts, and municipalities, pulling data across multiple tables and saving the results to CSV files. ## Features - **API Integration**: Extracts data directly from the Stats SA API using `requests` for seamless data access. - **Multiple Report Types**: Collects data across various demographic categories such as age groups, population groups, sexes, languages, education levels, and more. - **Scalable and Efficient**: Uses progress bars (`tqdm`) to provide feedback on the status of data extraction at the provincial and table levels, allowing for large-scale data collection. - **Filtered Data**: Automatically filters out unnecessary columns (e.g., columns ending with 'String') to ensure clean and relevant datasets. - **Data Output**: Saves extracted data in CSV format, organizing it by report type for each combination of province, district, and municipality. - **Error Handling**: Built-in `try` and `except` blocks handle errors gracefully during API requests and file operations. ## Requirements All dependencies are installed via the `requirements.txt` file located in the repository. To install them, simply run: `pip install -r requirements.txt ` ## How It Works 1. **Fetches Data**: The script connects to the Stats SA API to retrieve data for each combination of province, district, and municipality. 2. **Extracts Multiple Reports**: It pulls data for various tables including age groups, population groups, education levels, and more. 3. **Processes and Saves Data**: After filtering the relevant columns, the data is saved to CSV files, one for each report type, in a designated `data/` folder. ## Usage Simply run the script from the terminal as follows: ` python extractor.py ` You can monitor progress in the terminal with the displaye …

Visit

github.com

Licenses

MIT

Similar

nicc777/lotto-sa-statsAdrianoPereira/sasscalweathernet-crawlerRestioson/isixhosa-crawlerttomsin/grio-crawlerchrisndana/stats-ipDave-stats/nigeria_inflation_regime_var

nicc777/lotto-sa-stats

A project I am using to learn more Python and stats analysis, based on data from the Lottery in Sout

AdrianoPereira/sasscalweathernet-crawler

Bot for download data meteorological data from West Coast of the African Continent powered by SASSCA

Restioson/isixhosa-crawler

(Undergrad independent study project) Focused web crawler aiming to discover documents written in is

ttomsin/grio-crawler

The africa data ingestion engine # grio-crawler The data ingestion engine for **Grio** — Nigeria's

chrisndana/stats-ip

In the East African Countries (Kenya,Uganda and tanzania),those people who have acces to bank accoun

Dave-stats/nigeria_inflation_regime_var

Monthly VAR analysis of energy cost transmission to inflation in Nigeria (2016-2024) # nigeria_infl