No description
  • Python 77%
  • HTML 15.8%
  • CSS 3.8%
  • JavaScript 3.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
joe 142eee8325 feat: group the gift list by suggested amount and add rank memos
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-04 14:35:07 +09:00
app feat: group the gift list by suggested amount and add rank memos 2026-10-04 14:35:07 +09:00
docs/superpowers docs: plan mobile-first UI redesign 2026-09-27 20:46:06 +09:00
tests feat: group the gift list by suggested amount and add rank memos 2026-10-04 14:35:07 +09:00
.gitignore feat: Flask app scaffold with app factory and dashboard placeholder 2026-09-27 18:50:18 +09:00
README.md chore: rename the app from 葬儀支援 to 喪主支援 2026-09-28 14:15:07 +09:00
requirements-dev.txt feat: Flask app scaffold with app factory and dashboard placeholder 2026-09-27 18:50:18 +09:00
requirements.txt feat: export all lists to a single formatted Excel workbook 2026-09-28 02:58:05 +09:00
run.py feat: Flask app scaffold with app factory and dashboard placeholder 2026-09-27 18:50:18 +09:00

sougi — 喪主支援ツール

喪主・遺族が1回の葬儀を管理するための個人用Webアプリ(Flask + SQLite)。

機能

  • 見積管理 — 葬儀社の見積を登録・明細管理・複数社を横並び比較。見積書の画像スキャン取り込み(OCR)対応
  • 弔問客管理 — 香典帳の電子化。氏名・続柄・住所・参列区分・供花弔電・香典額を記録。検索・ソート・返礼状況フィルタ
  • 香典返し — 香典額から返礼目安額を自動計算(帯テーブル優先、なければ返礼率。デフォルト半返し)。送付状況(未手配/手配済/送付済/不要)を管理
  • 経費管理 — 葬儀関連経費の記録。領収書のスマホカメラスキャン/写真アップロードからOCRで自動入力
  • 出力 — 弔問客一覧・香典返しチェックリストの印刷ビュー、CSVエクスポート(BOM付きUTF-8)

セットアップ

# Python 3.14+
uv venv .venv && uv pip install -r requirements.txt
# または: python3 -m venv .venv && .venv/bin/pip install -r requirements.txt

python run.py   # → http://localhost:5000

スマホなどLAN内の他端末から使う場合:

python -c "from app import create_app; create_app().run(host='0.0.0.0', port=5000, debug=True)"
# → http://<サーバのIP>:5000

データは instance/sougi.db(SQLite)、アップロード画像は instance/uploads/ に保存されます。

領収書・見積書OCR

スキャン画面(/expenses/scan, /estimates/scan)からカメラ撮影または保存済み写真をアップロードすると、AIが店名・日付・金額・明細を抽出してフォームに初期入力します。

プロバイダ設定

以下のいずれか/複数を .env に設定(設定済みのものから順にフェイルオーバー):

GEMINI_API_KEY=...      # gemini-2.5-flash-lite
OPENAI_API_KEY=...      # gpt-4o-mini
ANTHROPIC_API_KEY=...   # claude-haiku-4-5

ローカル・ゲートウェイ系(カスタムプロバイダ)

設定画面(/settings)の「OCRカスタムプロバイダ」で、OpenAI互換エンドポイントを登録できます:

サービス base_url例 備考
Ollama http://localhost:11434/v1 vision対応モデル必須(llava, gemma3, qwen-vl等)
LM Studio http://localhost:1234/v1 同上
llama.cpp http://localhost:8080/v1 同上
OmniRoute等 ゲートウェイのURL 同上

モード:

  • 画像直接(vision) — 画像をそのままモデルへ(vision対応必須)
  • テキストLLM(2段OCR) — tesseractで文字起こし→テキストのみLLMへ。テキスト専用モデル(qwen系35B等)が使える

LLM不使用のローカルOCRのみ

tesseract がインストールされていれば「ローカルOCRのみ(LLM不使用)」が自動で選択肢に現れます(APIキー不要):

sudo apt install tesseract-ocr tesseract-ocr-jpn

テスト

.venv/bin/pytest tests/

構成

app/
  routes/      # main, estimates, mourners, return_gifts, expenses, settings, print_views, export
  services/    # gift_calc(返礼額計算), receipt_ocr(OCRプロバイダ), storage(画像保存)
  templates/   # Jinja2テンプレート
tests/         # pytest