This repo is an adaptation from this blog post.
The major changes are
- Instead of OpenWeatherMap API, we have chosen Taiwan's Central Weather Bureau's (abbr. CWB) API because in this case we do not need to register credit card information in order to use the API. For more info on CWB, cf.
- Python3 and
airflow==2.6.3
- Create a new virtual environment (or use an existing one). Activate it.
- If you use Miniconda, you can create and activate
one such virtual env by
The Python version could be anything from 3.7 to 3.11
$ conda create --name airflow_practice python=3.10 $ conda activate airflow_practice
- If you use Miniconda, you can create and activate
one such virtual env by
- Install Airflow by copying and pasting the commands below into a terminal
AIRFLOW_VERSION=2.6.3 PYTHON_VERSION="$(python --version | cut -d " " -f 2 | cut -d "." -f 1-2)" CONSTRAINT_URL="https://raw.githubusercontent.com/apache/airflow/constraints-${AIRFLOW_VERSION}/constraints-${PYTHON_VERSION}.txt" pip install "apache-airflow[postgres]==${AIRFLOW_VERSION}" --constraint "${CONSTRAINT_URL}"
- Install the remaining packages by
(airflow_practice) $ pip install -r requirements.txt