Skip to main content

PyQQQ SDK

PyPI Python License: MIT

PyQQQ SDK(pyqqq) 는 PyQQQ 플랫폼에서 퀀트 전략을 개발하기 위한 Python SDK입니다. 국내 주식·선물옵션 시장 데이터 조회와 증권사(한국투자증권, LS증권) 연동 기능을 제공하며, 데이터 분석부터 자동 매매 전략 운영까지 하나의 SDK로 처리할 수 있습니다.

주요 기능

  • 시장 데이터 조회 — 국내/미국 주식의 일봉·분봉·틱, 지수, 파생상품 데이터 (pyqqq.data)
  • 증권사 연동 — 한국투자증권(KIS), LS증권(eBest) OAuth 인증, 시세 조회, 주문/체결 (pyqqq.brokerage)
  • 실시간 추적 — WebSocket 기반 주문·포지션 이벤트 트래커 (TradingTracker)
  • 백테스팅 — 과거 데이터 기반 전략 검증 프레임워크 (pyqqq.backtest)

설치

pip install pyqqq

Python 3.9 이상을 지원합니다. (3.11 이상 권장)

API Key 설정

시장 데이터 조회에는 PyQQQ API Key가 필요합니다. pyqqq.net 회원가입 후 프로필 페이지에서 발급받을 수 있습니다.

발급받은 키는 다음 중 한 가지 방법으로 설정합니다.

# 방법 1: ~/.qred 파일에 저장
echo "your-api-key" > ~/.qred

# 방법 2: 환경변수로 설정
export PYQQQ_API_KEY="your-api-key"

빠른 시작

일봉(OHLCV) 데이터 조회

import datetime as dtm
from pyqqq.data.daily import get_ohlcv_by_codes_for_period

codes = ["005930", "000660"]  # 삼성전자, SK하이닉스
ohlcv = get_ohlcv_by_codes_for_period(codes, dtm.date(2025, 1, 6), dtm.date(2025, 1, 10))

for code, df in ohlcv.items():
    print(f"code: {code}")
    print(df)

증권사 API로 시세 조회 (한국투자증권)

from pyqqq.brokerage.kis.oauth import KISAuth
from pyqqq.brokerage.kis.simple import KISSimpleDomesticStock

auth = KISAuth(app_key="...", app_secret="...")
stock = KISSimpleDomesticStock(auth, account_no="...", account_product_code="01")

price = stock.get_price("005930")  # 삼성전자 현재가
print(price)

더 많은 예제는 튜토리얼 문서에서 확인할 수 있습니다.

문서

전체 문서는 docs.pyqqq.net 에서 제공됩니다.

라이선스

MIT License

Metadata

Release files for pyqqq 0.12.253

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyqqq 0.12.253
File Size Uploaded Provenance Actions
pyqqq-0.12.253.tar.gz 234.6 kB Without provenance Details for pyqqq-0.12.253.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyqqq 0.12.253
File Interpreter ABI Platform Actions
pyqqq-0.12.253-py3-none-any.whl Python 3 none any Details for pyqqq-0.12.253-py3-none-any.whl

Total release size: 502.9 kB

Release files / pyqqq-0.12.253.tar.gz

Download URL pyqqq-0.12.253.tar.gz
Size 234.6 kB
Tags Source
SHA-256 checksum
How to use checksums
56f59a3d513eeea1af8565bfb1cd13647b85f604f3913eefcc169ceef3726999
BLAKE2b-256 checksum
How to use checksums
1332b5fbe052b8d93f974d251a9e41880abc0a8fff5f6cad08d55c12def9d1b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.11.7 Linux/6.12.105+

Release files / pyqqq-0.12.253-py3-none-any.whl

Download URL pyqqq-0.12.253-py3-none-any.whl
Size 268.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
34b9726905259febb80bc2d9c5ea198fcfc8c1f535684503d29cd41c0ec13276
BLAKE2b-256 checksum
How to use checksums
6eeb70e6f90fe2858ef43142434b81dc4b591d542cf6b23619ab32a408c97b6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.11.7 Linux/6.12.105+

Security for pyqqq 0.12.253

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.12.253 This release

2 release files No provenance

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