- 개발/테스트 스크립트를 dev_scripts/ 폴더로 이동 - 스크린샷을 screenshots/ 폴더로 이동 - 백업 파일 보존 (.backup) - 처방 관련 추가 스크립트 포함 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
45 lines
1.3 KiB
Python
45 lines
1.3 KiB
Python
#!/usr/bin/env python3
|
|
"""약재 데이터 확인"""
|
|
|
|
import sqlite3
|
|
|
|
conn = sqlite3.connect('kdrug.db')
|
|
cur = conn.cursor()
|
|
|
|
# 확장 정보가 있는 약재 확인
|
|
cur.execute("""
|
|
SELECT COUNT(*) FROM herb_master_extended
|
|
WHERE nature IS NOT NULL OR taste IS NOT NULL
|
|
""")
|
|
extended_count = cur.fetchone()[0]
|
|
print(f"확장 정보가 있는 약재: {extended_count}개")
|
|
|
|
# 효능 태그가 있는 약재 확인
|
|
cur.execute("SELECT COUNT(DISTINCT ingredient_code) FROM herb_item_tags")
|
|
tagged_count = cur.fetchone()[0]
|
|
print(f"효능 태그가 있는 약재: {tagged_count}개")
|
|
|
|
# 구체적인 데이터 확인
|
|
cur.execute("""
|
|
SELECT hme.ingredient_code, hme.herb_name, hme.nature, hme.taste
|
|
FROM herb_master_extended hme
|
|
WHERE hme.nature IS NOT NULL OR hme.taste IS NOT NULL
|
|
LIMIT 5
|
|
""")
|
|
print("\n확장 정보 샘플:")
|
|
for row in cur.fetchall():
|
|
print(f" - {row[1]} ({row[0]}): {row[2]}/{row[3]}")
|
|
|
|
# herb_item_tags 데이터 확인
|
|
cur.execute("""
|
|
SELECT hit.ingredient_code, het.name, COUNT(*) as count
|
|
FROM herb_item_tags hit
|
|
JOIN herb_efficacy_tags het ON hit.tag_id = het.tag_id
|
|
GROUP BY hit.ingredient_code
|
|
LIMIT 5
|
|
""")
|
|
print("\n효능 태그 샘플:")
|
|
for row in cur.fetchall():
|
|
print(f" - {row[0]}: {row[2]}개 태그")
|
|
|
|
conn.close() |