/
boris00043
/
semantic-papers
Обзор
Документация
Войти
/
boris00043
/
semantic-papers
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
angular
services/parser/main.py
22 строки
512 B
boris
parser service
13 окт 2025, 15:26
13 окт 2025, 15:26
4ad4e28
Код
Авторство
О чём код?
from typing import Annotated from fastapi import FastAPI, File import httpx from tei import tei_to_article, Article app = FastAPI(root_path="/parse") @app.post("/") async def process_article(file: Annotated[bytes, File()]) -> Article: response = httpx.post( "http://storage:8000/parse", files={"file": file}, timeout=None ) return tei_to_article(response.json()["tei"]) if __name__ == "__main__": import uvicorn uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True)