PyQQQ SDK
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 에서 제공됩니다.
라이선스
Metadata
Release files for pyqqq 0.12.252
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyqqq-0.12.252.tar.gz | 234.5 kB | Without provenance | Details for pyqqq-0.12.252.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyqqq-0.12.252-py3-none-any.whl | Python 3 | none | any | Details for pyqqq-0.12.252-py3-none-any.whl |
Total release size: 502.7 kB
Release files / pyqqq-0.12.252.tar.gz
| Download URL | pyqqq-0.12.252.tar.gz |
|---|---|
| Size | 234.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5d32e14b112f27dc0881396e183024adf5fd51953c913485421fdef7f0a505d4
|
|
BLAKE2b-256 checksum How to use checksums |
a85392293644dc94e36756e17174007bc5e2c4ee54422f33508f83d19f71179d
|
| 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.252-py3-none-any.whl
| Download URL | pyqqq-0.12.252-py3-none-any.whl |
|---|---|
| Size | 268.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
104ae1c5c8a97c6404f272c1fc8aba7dd97fe934de8b41e3c2ce98e51328cafe
|
|
BLAKE2b-256 checksum How to use checksums |
50b94f3fc9e24ad977e46c3131efa3c518112a85120cc3d2c4e136058313a678
|
| 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.252
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.