From 3c147149ab35b0da360911272fe458510302ccd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20L=C3=BCcke?= Date: Mon, 27 Oct 2025 16:26:42 +0100 Subject: [PATCH] Feature: Erstellung des Projektes --- .editorconfig | 17 +++++++++++++++++ .gitignore | 2 ++ README.md | 4 ++-- api/main.py | 20 ++++++++++++++++++++ api/models.py | 14 ++++++++++++++ requirements.txt | 12 ++++++++++++ 6 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 .editorconfig create mode 100644 .gitignore create mode 100644 api/main.py create mode 100644 api/models.py create mode 100644 requirements.txt diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..9cde608 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,17 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = false +max_line_length = 120 +tab_width = 4 +ij_continuation_indent_size = 8 +ij_formatter_off_tag = @formatter:off +ij_formatter_on_tag = @formatter:on +ij_formatter_tags_enabled = true +ij_smart_tabs = false +ij_visual_guides = +ij_wrap_on_typing = false diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..807849c --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.venv +/.idea/ diff --git a/README.md b/README.md index 31fa5bb..4a16f2e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ -# PythonAppFuelTable +# Python-App-FuelTable -Ausnahme und Anzeige vom Sprit-Verbrauch \ No newline at end of file +Aufnahme und Anzeige vom Sprit-Verbrauch einzelner Fahrzeuge. \ No newline at end of file diff --git a/api/main.py b/api/main.py new file mode 100644 index 0000000..3d4a147 --- /dev/null +++ b/api/main.py @@ -0,0 +1,20 @@ +import datetime + +from fastapi import FastAPI + +from api.models import Car, FuelItem + +app = FastAPI() + + +car = Car(id_string="Auto 1") +fill_item = FuelItem( + car=car, + date=datetime.date.today(), + odometer_reading=101005, + fuel_fill=52.26 + ) + +@app.get("/") +async def root(): + return fill_item \ No newline at end of file diff --git a/api/models.py b/api/models.py new file mode 100644 index 0000000..fb7e6a8 --- /dev/null +++ b/api/models.py @@ -0,0 +1,14 @@ +import datetime + +from pydantic import BaseModel, EmailStr + + +class Car(BaseModel): + id_string: str + + +class FuelItem(BaseModel): + car: Car + date: datetime.date + odometer_reading: float + fuel_fill: float \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..2084b60 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,12 @@ +annotated-doc==0.0.* +annotated-types==0.7.* +anyio==4.11.* +fastapi==0.120.* +uvicorn==0.38.0 +idna==3.11 +pydantic==2.12.* +pydantic_core==2.41.* +sniffio==1.3.* +starlette==0.48.* +typing-inspection==0.4.* +typing_extensions==4.15.*