Skip to main content

Windows COM 기반으로 파이썬 32비트로만 동작하는 키움증권 오픈API 패키지

Project description

KiwoomOpenAPI

Windows COM 기반으로 파이썬 32비트로만 동작하는 키움증권 오픈API 패키지.

KiwoomTraderV2 프로젝트 패키지의 내부 모듈을 독립적인 패키지로 분리하는 작업 완료.

사용법

데이터 요청할 때

import kiwoomapi as api
api.CommConnect()

데이터 수신할 때 (PyQt QAxWidget 객체사용)

from kiwoomapi import OpenAPI
OpenAPI.OnReceiveMessage.connect(YOUR_METHOD) 

로그인 객체 구현 예시:

from PyQt5.QtCore import QObject, pyqtSignal, pyqtSlot, QEventLoop
import kiwoomapi as api
from kiwoomapi import OpenAPI

class LoginAPI(QObject):

    LoginSucceeded = pyqtSignal()

    def __init__(self):
        super().__init__()
        OpenAPI.OnReceiveMessage.connect(self.__recv_msg__)
        OpenAPI.OnEventConnect.connect(self.__recv_login__)

    @pyqtSlot(str, str, str, str)
    def __recv_msg__(self, ScrNo, RQName, TrCode, Msg):
        print([ScrNo, RQName, TrCode, Msg])
    
    @pyqtSlot(int)
    def __recv_login__(self, ErrCode):
        print(ErrCode)
        if ErrCode == 0:
            self.LoginSucceeded.emit()
        else:
            print('로그인 실패)
        self._event_loop.exit()

    def login(self):
        api.CommConnect()
        self._event_loop = QEventLoop()
        self._event_loop.exec()

LoginAPI = LoginAPI()
LoginAPI.login()

개발 가이드 문서

로그인-버전처리\기본설명

모의투자

로그인-버전처리

조건검색

조회와-실시간데이터처리

주문과-잔고처리

OpenAPI-오류코드

OpenAPI-사용제한

Project details


Download files

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

Source Distribution

kiwoomapi-0.4.4.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

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

kiwoomapi-0.4.4-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file kiwoomapi-0.4.4.tar.gz.

File metadata

  • Download URL: kiwoomapi-0.4.4.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.2

File hashes

Hashes for kiwoomapi-0.4.4.tar.gz
Algorithm Hash digest
SHA256 d7a4e847ade5dd9337feaf83c255d40c9752ac333fc9d74df5f81287fc649328
MD5 74a579be429fb857105a920f8205cd9e
BLAKE2b-256 150cea2631d2de1ae352eff21aace97907f98cf46882a5ceb4bb55dace523cff

See more details on using hashes here.

File details

Details for the file kiwoomapi-0.4.4-py3-none-any.whl.

File metadata

  • Download URL: kiwoomapi-0.4.4-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.2

File hashes

Hashes for kiwoomapi-0.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2abfecd0281cbc51d5de8cb49676fe6ca0ce7c107fe6147f7b3675dc339ac353
MD5 af17556759a4214393c7435b30bd4675
BLAKE2b-256 027c45b8ca081a6bf4e8eec7dd63e9c40366b27b5fcfe56cb569a178e554a2c4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page