This repository contains code and documentation for automating data extraction, transformation, and version-controlled storage using Apache Airflow. The project focuses on extracting data from two sources, dawn.com and BBC.com, transforming it, and storing it in a version-controlled manner.
- data_extraction.py: Python script for extracting links from dawn.com and BBC.com and saving them in CSV files (
dawn_links.csvandbbc_links.csv). - data_transformation.py: Python script for extracting titles and descriptions from links, applying retry strategies, and saving transformed data in new CSV files (
dawn_links_transformed.csvandbbc_links_transformed.csv). - data_extraction_transformation_dag.py: Apache Airflow DAG for automating data extraction and transformation tasks, ensuring task dependencies and error handling.
-
Clone the repository to your local machine:
git clone https://github.com/username/data-extraction-transformation.git
-
Install the required Python packages:
pip install -r requirements.txt
-
Run the data extraction and transformation scripts:
python data_extraction.py python data_transformation.py
-
Start Apache Airflow webserver:
airflow webserver
-
Access the Airflow UI in your browser (
http://localhost:8080) to view and trigger the DAG (data_extraction_transformation_dag).
- Python 3.x
- Apache Airflow
- requests
- BeautifulSoup
- Ensure proper configuration of Apache Airflow, including database setup and DAG configuration.
- Customize retry strategies, timeouts, and error handling as per project requirements.
- Update paths and filenames in scripts and DAG according to your environment.