Skip to content

Commit 339e7b9

Browse files
committed
review 패키지 + 구조화된 기업 분석 시스템
- review 패키지: 블록 사전(16개) + 템플릿(수익구조/자금조달) + 자유 조립 - analysis/strategy: calc-only 패턴 전환 (dict/숫자 반환, 블록 생성 분리) - reviewer: LLM 종합의견 레이어 (guide 파라미터로 분석 관점 지정) - 4가지 렌더링: rich(터미널), html, markdown, json - README Review 섹션 추가 (EN/KR) - sampleReview 노트북, 블로그 124호, sections 개선
1 parent ccdb507 commit 339e7b9

60 files changed

Lines changed: 5068 additions & 276 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,74 @@ Accepts both Korean names (`매출액`) and English snakeIds (`sales`) — same
349349
> dartlab.downloadAll("docs") # ~8 GB (digest/signal — large)
350350
> ```
351351
352+
## Review — Structured Company Analysis
353+
354+
DartLab's review system assembles financial data into structured, readable reports.
355+
356+
### Templates
357+
358+
Pre-built block combinations that cover key analysis areas:
359+
360+
```python
361+
c = dartlab.Company("005930")
362+
363+
c.review("수익구조") # revenue structure — segments, growth, concentration
364+
c.review("자금조달") # capital structure — debt, liquidity, interest burden
365+
c.review() # all templates
366+
```
367+
368+
### Block Assembly
369+
370+
Every review is built from reusable blocks. Get the full block dictionary and assemble your own:
371+
372+
```python
373+
from dartlab.review import blocks, Review
374+
375+
b = blocks(c) # dict of 16 pre-built blocks
376+
list(b.keys()) # → ["profile", "segmentComposition", "growth", ...]
377+
378+
# pick what you need
379+
Review([
380+
b["segmentComposition"],
381+
b["growth"],
382+
c.select("IS", ["매출액"]), # mix with raw data
383+
])
384+
```
385+
386+
### Reviewer — AI Layer
387+
388+
Add LLM-powered opinions on top of data blocks. Works with any provider:
389+
390+
```python
391+
c.reviewer() # all sections + AI opinion
392+
c.reviewer("수익구조") # single section + AI
393+
c.reviewer(guide="Evaluate from semiconductor cycle perspective") # custom guide
394+
```
395+
396+
**Free AI providers** — no paid API key required:
397+
398+
| Provider | Setup |
399+
|----------|-------|
400+
| Gemini | `dartlab setup gemini` |
401+
| Groq | `dartlab setup groq` |
402+
| Cerebras | `dartlab setup cerebras` |
403+
| Mistral | `dartlab setup mistral` |
404+
405+
Or use any OpenAI-compatible endpoint:
406+
```bash
407+
dartlab setup custom --base-url http://localhost:11434/v1 # Ollama local
408+
```
409+
410+
### Customization
411+
412+
- **Templates**: Pre-defined block combinations (`수익구조`, `자금조달`)
413+
- **Free assembly**: Mix any blocks + raw DataFrames in `Review([...])`
414+
- **Guide**: Pass `guide="..."` to `c.reviewer()` for domain-specific AI analysis
415+
- **Layout**: `ReviewLayout(indentH1=2, gapAfterH1=1, ...)` for rendering control
416+
- **Render formats**: `review.render("rich" | "html" | "markdown" | "json")`
417+
418+
See [notebooks/marimo/sampleReview.py](notebooks/marimo/sampleReview.py) for interactive examples.
419+
352420
## Additional Features
353421

354422
> Features below are **beta** or **experimental** — APIs may change. See [stability](docs/stability.md).

README_KR.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,74 @@ dartlab.scanRatioList()
349349
> dartlab.downloadAll("docs") # ~8 GB (공시 변화 감지/시그널 — 대용량)
350350
> ```
351351
352+
## 리뷰 — 구조화된 기업 분석
353+
354+
DartLab의 리뷰 시스템은 재무 데이터를 구조화된 보고서로 조립한다.
355+
356+
### 템플릿
357+
358+
미리 정의된 블록 조합으로 핵심 분석 영역을 커버한다:
359+
360+
```python
361+
c = dartlab.Company("005930")
362+
363+
c.review("수익구조") # 부문별 매출, 성장성, 집중도
364+
c.review("자금조달") # 부채구조, 유동성, 이자 부담
365+
c.review() # 전체 템플릿
366+
```
367+
368+
### 블록 자유 조립
369+
370+
모든 리뷰는 재사용 가능한 블록으로 구성된다. 블록 사전을 가져와 직접 조합한다:
371+
372+
```python
373+
from dartlab.review import blocks, Review
374+
375+
b = blocks(c) # 16개 블록 사전
376+
list(b.keys()) # → ["profile", "segmentComposition", "growth", ...]
377+
378+
# 필요한 것만 골라 조립
379+
Review([
380+
b["segmentComposition"],
381+
b["growth"],
382+
c.select("IS", ["매출액"]), # 원시 데이터와 혼합
383+
])
384+
```
385+
386+
### 리뷰어 — AI 레이어
387+
388+
데이터 블록 위에 AI 종합의견을 추가한다. 모든 LLM 프로바이더와 호환:
389+
390+
```python
391+
c.reviewer() # 전체 섹션 + AI 의견
392+
c.reviewer("수익구조") # 단일 섹션 + AI
393+
c.reviewer(guide="반도체 사이클 관점에서 평가해줘") # 사용자 분석 관점 지정
394+
```
395+
396+
**무료 AI 프로바이더** — 유료 API 키 없이 사용 가능:
397+
398+
| 프로바이더 | 설정 |
399+
|-----------|------|
400+
| Gemini | `dartlab setup gemini` |
401+
| Groq | `dartlab setup groq` |
402+
| Cerebras | `dartlab setup cerebras` |
403+
| Mistral | `dartlab setup mistral` |
404+
405+
또는 OpenAI 호환 엔드포인트 사용:
406+
```bash
407+
dartlab setup custom --base-url http://localhost:11434/v1 # Ollama 로컬
408+
```
409+
410+
### 커스터마이징
411+
412+
- **템플릿**: 미리 정의된 블록 조합 (`수익구조`, `자금조달`)
413+
- **자유 조립**: 블록 + 원시 DataFrame을 `Review([...])`로 혼합
414+
- **가이드**: `c.reviewer(guide="...")`로 도메인 특화 AI 분석
415+
- **레이아웃**: `ReviewLayout(indentH1=2, gapAfterH1=1, ...)`로 출력 제어
416+
- **렌더링 형식**: `review.render("rich" | "html" | "markdown" | "json")`
417+
418+
인터랙티브 예제는 [notebooks/marimo/sampleReview.py](notebooks/marimo/sampleReview.py) 참고.
419+
352420
## 부가 기능
353421

354422
> 아래 기능은 **beta** 또는 **experimental**이다 — API가 변경될 수 있다. [stability](docs/stability.md) 참고.
Lines changed: 75 additions & 0 deletions
Loading
Lines changed: 78 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)