Skip to main content

ProgramGarden Core

ProgramGarden은 AI 시대에 맞춰 파이썬을 모르는 투자자도 개인화된 시스템 트레이딩을 자동으로 수행할 수 있게 돕는 오픈소스입니다. 본 저장소는 노드 기반 DSL의 핵심 타입, 베이스 클래스, 레지스트리, i18n을 정의하는 "코어" 모듈입니다.

주요 특징

  • 노드 기반 DSL: 68개 내장 노드를 조합하여 워크플로우를 정의하는 도메인 특화 언어
  • 타입 안전한 스키마: Pydantic 모델 기반의 FieldSchema, 입출력 포트 정의로 IDE 친화적이고 안전한 개발
  • 레지스트리 시스템: NodeTypeRegistry와 PluginRegistry로 노드/플러그인 메타데이터 관리
  • 다국어 지원(i18n): 한국어/영어 번역 파일을 통한 노드 설명, 필드명 자동 번역
  • 상품별 분리: 해외주식(overseas_stock)과 해외선물(overseas_futures)을 독립된 노드로 지원
  • 플러그인 확장: ConditionNode에 커뮤니티 전략 플러그인(RSI, MACD 등)을 연결하여 확장

설치

pip install programgarden-core

# Poetry 사용 시 (개발 환경)
poetry add programgarden-core

요구 사항: Python 3.12+

노드 카테고리 (11개, 68개 코어 노드)

카테고리 노드 수 대표 노드
infra 8 StartNode, BrokerNode, ThrottleNode, SplitNode, AggregateNode, IfNode, KoreaStockBrokerNode
account 12 AccountNode, OpenOrdersNode, RealAccountNode, RealOrderEventNode (해외주식/선물 + 국내주식)
market 20 MarketDataNode, HistoricalDataNode, RealMarketDataNode, WatchlistNode, ExclusionListNode, CurrencyRateNode, KoreaStock*
condition 2 ConditionNode, LogicNode
order 10 NewOrderNode, ModifyOrderNode, CancelOrderNode, PositionSizingNode (해외주식/선물 + 국내주식)
risk 1 PortfolioNode
schedule 2 ScheduleNode, TradingHoursFilterNode
data 3 SQLiteNode, HTTPRequestNode, FieldMappingNode
display 6 TableDisplayNode, LineChartNode, CandlestickChartNode, SummaryDisplayNode
analysis 2 BacktestEngineNode, BenchmarkCompareNode
ai 2 LLMModelNode, AIAgentNode

community 패키지에서 4개 노드 추가: TelegramNode(messaging), FearGreedIndexNode(market), FundamentalDataNode(market), FileReaderNode(data) → 전체 73개

사용 예시

from programgarden_core import (
    # 노드
    StartNode, ConditionNode, LogicNode,
    OverseasStockBrokerNode, OverseasStockAccountNode,

    # 모델
    Edge, WorkflowDefinition, WorkflowJob, JobState,

    # 레지스트리
    NodeTypeRegistry, PluginRegistry,
)

# 레지스트리에서 노드 스키마 조회
registry = NodeTypeRegistry()
schema = registry.get_schema("OverseasStockBrokerNode")
print(schema.config_schema)

패키지 구조

programgarden_core/
├── nodes/          # 69개 노드 정의 (base.py, infra.py, account.py, ...)
├── bases/          # Finance 베이스 클래스
├── models/         # Pydantic 모델 (FieldSchema, Edge, WorkflowDefinition 등)
├── registry/       # NodeTypeRegistry, PluginRegistry
├── i18n/locales/   # 번역 파일 (ko.json, en.json)
└── exceptions/     # DSL/Finance 예외 클래스

기여하기

이슈/토론/PR 환영합니다. 버그 리포트 시 재현 단계와 최소 예시를 함께 제공해 주시면 빠르게 대응할 수 있습니다.

변경 로그

자세한 변경 사항은 CHANGELOG.md를 참고하세요.

Workflow PnL event contract

Futures workflow PnL events preserve native gross estimates separately from accounting results. workflow_*, other_*, total_*, account and competition monetary/rate scalars remain null when accounting evidence is unavailable. pnl_by_currency contains gross price-change subtotals by contract currency; monetary_positions retains their basis/status and unmodified, unconfirmed broker_pnl_amount. No fee, FX, margin/equity return or verified contest score is inferred from these estimates. Actual zero and negative amounts are retained. currency is null for mixed or unavailable currencies. Consumers must handle nullable monetary fields and must not coerce them to zero.

WorkflowPnLEvent.personal_metrics is an optional versioned envelope for retained local workflow executions. Version 1 includes scope (kind, product, provider, trading mode), timezone-aware as_of, basis, executed-order count/status, per-symbol/exchange/currency realized amounts/status, and unavailable MDD. It is unverified personal evidence, independent of whole-account contest results. Stock realized amounts are stored long-only FIFO gross values excluding fees; unknown currency stays null. Futures monetary values and portfolio MDD require accounting evidence absent from this ledger and remain null. Consumers must preserve null/status and use the latest cumulative observation, not sum dates.

Workflow account boundary

Each workflow allows one account and one product through at most one broker connection. Additional connections produce DUPLICATE_BROKER_NODE, including unbound or cross-product nodes. Reuse one broker for all consumers. Account-free workflows and unrelated credentials remain supported. See the shared contract.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

programgarden_core-1.29.0.tar.gz (360.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

programgarden_core-1.29.0-py3-none-any.whl (444.0 kB view details)

Uploaded Python 3

File details

Details for the file programgarden_core-1.29.0.tar.gz.

File metadata

  • Download URL: programgarden_core-1.29.0.tar.gz
  • Upload date:
  • Size: 360.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.12.13 Darwin/25.6.0

File hashes

Hashes for programgarden_core-1.29.0.tar.gz
Algorithm Hash digest
SHA256 8e089cef67f0a86dc82c2b90d69204e89043d98e2c2cbb4de7840dec0e0c6ca8
MD5 70f3765e76cdfac9913cddd3eea5e95f
BLAKE2b-256 a982c8dab5f6f646343d7442b4b99a493ae0356309f01b462fa554df6f963dd7

See more details on using hashes here.

File details

Details for the file programgarden_core-1.29.0-py3-none-any.whl.

File metadata

File hashes

Hashes for programgarden_core-1.29.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1774f83dde6b3dc65c33f09e66501c585438d5bc578bcb5f12889a94d385555b
MD5 5cf63701eff1a2286ad2d4962826e22c
BLAKE2b-256 98560e3934317ebdbe6fc1396238bcdc23d9b490e20d9980fe8e521ed31a7d18

See more details on using hashes here.

Release history Release notifications | RSS feed

1.30.1

2 files

1.30.0

2 files

This release

1.29.0 This release

2 files

1.28.3

2 files

1.28.2

2 files

1.28.1

2 files

1.28.0

2 files

1.27.0

2 files

1.26.0

2 files

1.25.3

2 files

1.25.2

2 files

1.25.1

2 files

1.25.0

2 files

1.24.0

2 files

1.23.0

2 files

1.22.0

2 files

1.21.0

2 files

1.20.0

2 files

1.19.0

2 files

1.18.0

2 files

1.17.0

2 files

1.16.0

2 files

1.15.2

2 files

1.15.1

2 files

1.15.0

2 files

1.14.5

2 files

1.14.4

2 files

1.14.3

2 files

1.14.2

2 files

1.14.1

2 files

1.14.0

2 files

1.13.0

2 files

1.12.4

2 files

1.12.3

2 files

1.12.2

2 files

1.12.1

2 files

1.12.0

2 files

1.11.1

2 files

1.11.0

2 files

1.10.0

2 files

1.9.10

2 files

1.9.9

2 files

1.9.8

2 files

1.9.7

2 files

1.9.6

2 files

1.9.5

2 files

1.9.4

2 files

1.9.3

2 files

1.9.2

2 files

1.9.1

2 files

1.9.0

2 files

1.8.0

2 files

1.7.0

2 files

1.6.0

2 files

1.5.1

2 files

1.5.0

2 files

1.4.0

2 files

1.3.0

2 files

1.2.0

2 files

0.1.12

2 files

0.1.11

2 files

0.1.10

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page