Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/grillazz/fastapi-faust
Simple integration of FastAPI with Faust Python Stream Processing Fork
https://github.com/grillazz/fastapi-faust
asyncio fastapi faust faust-streaming kafka python3 streaming
Last synced: about 5 hours ago
JSON representation
Simple integration of FastAPI with Faust Python Stream Processing Fork
- Host: GitHub
- URL: https://github.com/grillazz/fastapi-faust
- Owner: grillazz
- License: mit
- Created: 2023-01-23T20:05:16.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-15T18:53:14.000Z (almost 2 years ago)
- Last Synced: 2023-03-05T23:24:54.860Z (over 1 year ago)
- Topics: asyncio, fastapi, faust, faust-streaming, kafka, python3, streaming
- Language: Python
- Homepage:
- Size: 72.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fastapi-faust
Example of [FastAPI](https://fastapi.tiangolo.com/) integration with [Faust - Python Stream Processing Fork](https://github.com/faust-streaming/faust)
This is a very opinionated example repository for a python backend API.
It is not a template as it contains a few things already as an example for how to build something from here.[This project](https://github.com/toh995/fastapi-faust-example) was originally created by [toh995](https://github.com/toh995/), this is a hard fork as I intend to deviate from the upstream -
adding more opinion and changing a few things i.e. switch from [Faust](https://github.com/robinhood/faust) to [Faust - Python Stream Processing Fork](https://github.com/faust-streaming/faust)### How to Setup
To build , run and test and more ... use magic of make help to play with this project.
```shell
make help
```### Test with cURL
```shell
curl -X 'POST' \
'http://0.0.0.0:8080/greeting?from_name=Faust&to_name=World' \
-H 'accept: application/json' \
-d ''
```
and you get response
```shell
fastapi-faust-api-1 | INFO: 172.24.0.1:65078 - "POST /greeting?from_name=Faust&to_name=World HTTP/1.1" 200 OK
fastapi-faust-worker-1 | [2023-01-26 19:39:59,701] [1] [WARNING] Saluti veloci da Faust a World
fastapi-faust-api-1 | INFO: 172.24.0.1:62310 - "POST /greeting?from_name=Faust&to_name=World HTTP/1.1" 200 OK
fastapi-faust-worker-1 | [2023-01-26 19:40:34,334] [1] [WARNING] Saluti veloci da Faust a World
fastapi-faust-api-1 | INFO: 172.24.0.1:64476 - "POST /greeting?from_name=Faust&to_name=World HTTP/1.1" 200 OK
fastapi-faust-worker-1 | [2023-01-26 19:40:37,264] [1] [WARNING] Saluti veloci da Faust a World
fastapi-faust-api-1 | INFO: 172.24.0.1:64478 - "POST /greeting?from_name=Faust&to_name=World HTTP/1.1" 200 OK
fastapi-faust-worker-1 | [2023-01-26 19:40:38,026] [1] [WARNING] Saluti veloci da Faust a World```
FastAPI + Faust = :heart:
### Development
- install pre-commit
- install poetry