This project is a simple Airflow DAG that fetches the list of cities from Divar API and saves them as a CSV file.
🌐 API Source: Divar API
- PythonOperator is used to call the API and process the data.
- DAG has been tested on a Linux environment and confirmed to work correctly.
- CSV output is stored in
data/divar_cities.csv. - The
data/folder includes.gitkeepto maintain the folder structure in GitHub.
Note: This project is mainly educational and serves as a sample Airflow workflow, ready for further development or database integration.
divar-airflow-pipeline/
│
├── dags/
│ └── divar_city_list_pipeline.py
│
├── data/
│ └── .gitkeep
│
├── requirements.txt
└── README.md
| ID | Name | Slug | Radius | Latitude | Longitude |
|---|---|---|---|---|---|
| 1 | Tehran | tehran | 50000 | 35.6892 | 51.3890 |
| 2 | Mashhad | mashhad | 30000 | 36.2605 | 59.6168 |
| 3 | Isfahan | isfahan | 40000 | 32.6546 | 51.6680 |
- Python
- Apache Airflow
- Pandas
- Requests
apache-airflow==2.8.1
pandas==2.1.0
requests==2.31.0
pip install -r requirements.txt
- Install Airflow and activate your Python virtual environment.
- Place the DAG file in the
dags/folder. - Initialize the database and start scheduler & webserver:
airflow db init
airflow scheduler
airflow webserver
- Enable the DAG
Get_City_Listfrom the Airflow UI to fetch city data and save it todata/divar_cities.csv.
MIT License (optional)
Samira Siavash
🔗 GitHub: https://github.com/SamiraSiavash
🔗 LinkedIn: https://linkedin.com/in/samira-siavash