Files
parsing-service/pyproject.toml
VinhNT c79ea9f05f Nhận PDF upload trực tiếp qua POST /parse
API trước đây chỉ nhận đường dẫn HDFS từ Airflow. Thêm endpoint
multipart/form-data nhận thẳng file PDF, vẫn chạy bất đồng bộ: trả 202 kèm
job_id và result_url, worker xử lý nền, client lấy dla-document-bundle ở
GET /jobs/{job_id}/result hoặc qua callback.

- File upload ghi xuống IDP_DATA_DIR/uploads theo sha256 nội dung nên gửi lại
  cùng request_id trả cùng job_id; file được xoá khi không còn job nào dùng.
- Thêm cột filename/source_kind để bundle giữ đúng tên file gốc thay vì tên
  đã băm.
- IDP_RUN_WORKER=1 chạy worker trong process API cho triển khai một host.
- IDP_OCR_BACKEND=pdf_text dựng bundle từ text layer của PDF để chạy thử toàn
  bộ luồng khi chưa serve được model.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-21 14:51:19 +00:00

26 lines
510 B
TOML

[project]
name = "idp-parsing-service"
version = "0.2.0"
requires-python = ">=3.11"
dependencies = [
"fastapi>=0.115,<1",
"uvicorn>=0.30,<1",
"python-multipart>=0.0.9,<1",
"pymupdf>=1.24,<2",
"pycryptodome>=3.20,<4",
]
[project.optional-dependencies]
test = ["pytest>=8,<10", "httpx>=0.27,<1"]
hdfs = ["hdfs>=2.7,<3"]
[build-system]
requires = ["setuptools>=75"]
build-backend = "setuptools.build_meta"
[tool.setuptools]
packages = ["idp_service"]
[tool.pytest.ini_options]
testpaths = ["tests"]