30 lines
567 B
Markdown
30 lines
567 B
Markdown
**1. Voraussetzungen installieren**
|
|
|
|
```
|
|
pip install requests mariadb python-dotenv
|
|
```
|
|
|
|
**2. Datenbank Vorbereiten**
|
|
|
|
```
|
|
CREATE DATABASE weather_db;
|
|
|
|
USE weather_db;
|
|
|
|
CREATE TABLE weather_data (
|
|
id INT AUTO_INCREMENT PRIMARY KEY,
|
|
city VARCHAR(100) NOT NULL,
|
|
country VARCHAR(10),
|
|
temperature FLOAT,
|
|
feels_like FLOAT,
|
|
humidity INT,
|
|
pressure INT,
|
|
wind_speed FLOAT,
|
|
description VARCHAR(255),
|
|
recorded_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
|
);
|
|
|
|
```
|
|
|
|
**3. Script und .env Datei ablegen und bearbeiten**
|