https://github.com/upa-io/fastapi-chassis-python
Repository for Microservice in Python 3.11 with FastAPI.
https://github.com/upa-io/fastapi-chassis-python
api fastapi python
Last synced: 5 months ago
JSON representation
Repository for Microservice in Python 3.11 with FastAPI.
- Host: GitHub
- URL: https://github.com/upa-io/fastapi-chassis-python
- Owner: upa-io
- License: apache-2.0
- Created: 2023-07-24T00:15:29.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-24T08:16:24.000Z (9 months ago)
- Last Synced: 2024-10-25T04:45:22.887Z (9 months ago)
- Topics: api, fastapi, python
- Language: Python
- Homepage:
- Size: 262 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PY-MICROSERVICE-POC
[](https://sonarcloud.io/summary/new_code?id=upa-io_py-microservice-poc) [](https://sonarcloud.io/summary/new_code?id=upa-io_py-microservice-poc) [](https://sonarcloud.io/summary/new_code?id=upa-io_py-microservice-poc)
# Requirements
- Python 3.11
- FastAPI 0.111.0# API Endpoints Documentation
This document provides an overview of the API endpoints available in the application. Each endpoint serves a specific function, as detailed below.
## Endpoints
### 1. Generate Current Datetime
- **Endpoint**: `/generate_current_datetime`
- **Method**: `GET`
- **Description**: Returns the current datetime.
- **Response**:
- `current_datetime`: The current datetime in ISO format.### 2. Days Between Dates
- **Endpoint**: `/days_between_dates`
- **Method**: `POST`
- **Description**: Calculates the number of days between two dates.
- **Request Body**:
- `date1`: The start date in ISO format.
- `date2`: The end date in ISO format.
- **Response**:
- `days_between`: The number of days between `date1` and `date2`.### 3. String to Datetime
- **Endpoint**: `/string_to_datetime`
- **Method**: `POST`
- **Description**: Converts a string representation of a date into a datetime object based on the provided format.
- **Request Body**:
- `date_string`: The date string to convert.
- `date_format`: The format of the date string (default is "%Y-%m-%d").
- **Response**:
- `result_date`: The converted datetime in ISO format.