Giter Club home page Giter Club logo

koapy's People

Contributors

dependabot[bot] avatar dh377 avatar elbakramer avatar resoliwan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

koapy's Issues

opt10060이 동작하지 않아서 문의 드립니다.

Describe the bug
아래 코드 수행시 응답이 없습니다.

request_name = "종목별투자자기관별차트요청"
tr_code = "opt10060"
screen_no = "0001"
inputs = {
    '일자': "20220909",
    '종목코드': "005930",
    '금액수량구분': "2",
    '매매구분': "0",
    '단위구분': "1",
}

for event in entrypoint.TransactionCall(request_name, tr_code, screen_no, inputs):
    columns = event.multi_data.names
    records = [values.values for values in event.multi_data.values]
    data = pd.DataFrame.from_

아래 Screenshot에 보면 멀티데이터로 정보가 조회 되어야 할것 같은데 싱글 데이터로 조회됩니다.
처음 사용하는 거라 맞게 한건지 자신이 없습니다 --;;

Screenshots
image
image

Environment (please complete the following information):

  • OS: [Windows 10]
  • Python Version: [Python 3.8.12 32bit]
  • KOAPY Version: [0.8.4]

Additional context
Add any other context about the problem here.

koapy 'CybosPlusLookupRequestRateLimiter' object is not callable

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. 공식문서 페이지의 Notebooks/getting-historical-stock-price-data 페이지에서
  2. CybosPlus api를 이용해 15분봉 주가 데이터를 가져오는 함수의 예제코드를 똑같이 따라해보고 있었습니다.
  3. cybos_entrypoint.EnsureConnected( )까지는 출력값이 0으로 예제코드와 똑같이 수행됐으나
  4. GetDailyStockDataAsDataFrame, GetMinuteStockDataAsDataFrame 메소드를 둘 다 호출하니
    "TypeError: ''CybosPlusLookupRequestRateLimiter' object is not callable" 이라는 메시지가 똑같이 출력됩니다 ㅠㅠ

conda 가상환경에서 python 3.8.13, 32bit 환경 및 관리자 권한으로 실행한 VScode에서 수행하고 있습니다.
또한, Cybos plus 계좌 발급 및 로그인 완료한 상태이며 서버와의 연결도 확인했습니다..
어떻게 오류를 해결하면 좋을지, 제가 놓치고 있는 고려사항은 어떤 게 있을지 궁금합니다. 아무리 찾아봐도 답이 나오질 않아 고민 끝에 문의 글 올립니다..

TypeError: 'CybosPlusLookupRequestRateLimiter' object is not callable

err1
err2

인스톨 후 'koapy' 애러

'pip install koapy' 이후 제대로 된 인스톨이었는지 확인하기위해 터미널에서 koapy 치면 아래처럼 나옵니다.
제대로 인스톨이 안되었는지 기본 예제에서부터 애러가 뜹니다.

  1. 아나콘다 인스톨 Anaconda3-2021.04-Windows-x86_64 (파이썬 3.8 버전)
  2. 아나콘다 프롬프트 conda update conda
  3. 아나콘다 프롬프트 conda update --all
  4. 아나콘다 프롬프트 python -m pip install --upgrade pip
  5. 아나콘다 프롬프트 set CONDA_FORCE_32BIT=1
  6. 아나콘다 프롬프트 conda create -n x86 python=3.8 anaconda
  7. 아나콘다 프롬프트 conda activate x86
  8. 아나콘다 프롬프트 python 으로 x32 버전 확인 [첨부 스샷]
  9. 아나콘다 프롬프트 pip install koapy
  10. 아나콘다 프롬프트 koapy [첨부 스샷]

2023-07-24 16 50 34

2023-07-24 17 01 12

Environment (please complete the following information):

  • OS: Windows 10
  • Python Version: Python 3.8 64Bit -> 32Bit env
  • KOAPY Version: v0.9.0 [Latest]

로깅 관련한 에러??

Describe the bug
음 제가 잘못 하는 것 일수도 있는데, 모든 로그 or 선택적 (실시간 체결 정보 log 등)으로 logging을 할 수 없나요?
root logger를 생성해서 logging level을 크리티컬로 줘도, 실시간 체결 정보가 무조건 나오네요. 핸들러 삭제하고 있는거 다 삭제해봐도 왜인지모르게 실시간 체결 로그가 계속 print되고 있습니다. (콘솔창에서)

소스(KiwoomOpenApiPlusLoggingEventHandler.py)에서 로깅핸들러 소스에서 주석처리하고 나서야 안보이는데, 주석 처리로 말고 로깅 핸들러 자체를 안돌게 할 수 없을까요?
해당 로킹 핸들러에서 구간(logger.debug)을 주석처리하니까 가끔 grpc 서버쪽에서 에러가 나옵니다. (지금은 또 안나와서 캡처를 못하겠네요)

Environment (please complete the following information):

  • OS: windows 10
  • Python Version: Python 3.8 32Bit
  • KOAPY Version: 0.9

Additional context
Add any other context about the problem here.

조건검색 오류

안녕하세요.
오늘 처음 설치하고 시험해보는데 잘 만들어진 프로그램이고 안정화되면 좋을 것 같아요.
main_scenario.py 를 실행해보고 있는데 '5. 조건검색 예시'에서 오류가 발생합니다.
추적해보니 계정에서 등록한 조건검색은 잘 가져왔는데 다음과 같은 메시지로 오류 발생합니다.

========================================================================
2023-01-02 18:26:47,383 [INFO] Getting stock codes with condition: 최근장대양봉 - :12
Output exceeds the size limit. Open the full output data in a text editor

_MultiThreadedRendezvous Traceback (most recent call last)
d:\0.work\program\secu\koapy\koapy\examples\06_main_scenario.py in line 13
113 # condition_name = "대형 저평가 우량주"
115 logging.info("Getting stock codes with condition: %s", condition_name)
---> 116 codes, info = entrypoint.GetCodeListByCondition(condition_name, with_info=True)
118 print(codes)
119 print(info)

File D:\0.work\program\secu\koapy\koapy\backend\kiwoom_open_api_plus\grpc\KiwoomOpenApiPlusServiceClientStubWrapper.py:1298, in KiwoomOpenApiPlusServiceClientStubExtendedWrapper.GetCodeListByCondition(self, condition_name, condition_index, with_info, is_future_option, request_name, screen_no)
1295 records = []
1296 remove_zeros_width = None
-> 1298 for response in self.ConditionCall(
1299 screen_no,
1300 condition_name,
1301 condition_index,
1302 search_type,
1303 with_info,
1304 is_future_option,
1305 request_name,
1306 ):
1307 if response.name == "OnReceiveTrCondition":
1308 code_list = response.arguments[1].string_value

File d:\miniconda3\envs\koapy\lib\site-packages\grpc_channel.py:426, in _Rendezvous.next(self)
...
_MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
status = StatusCode.UNKNOWN
details = "Exception iterating responses: 'str' object has no attribute 'name'"
debug_error_string = "UNKNOWN:Error received from peer ipv4:127.0.0.1:5943 {grpc_message:"Exception iterating responses: 'str' object has no attribute 'name'", grpc_status:2, created_time:"2023-01-02T09:30:07.704446572+00:00"}"

혹시 재무재표도 열람이 가능할까요?

dataframe으로 재무재표 열람 기능도 있을까요?

추가로, 증권사에서 제공하는 지표 (envelope, stochastic등) 도 실시간으로 가져오는 함수가 있을까요?

너무 감사합니다

TypeError: Descriptors cannot not be created directly.

Describe the bug

script

from koapy import KiwoomOpenApiPlusEntrypoint

if __name__ == "__main__":
    with KiwoomOpenApiPlusEntrypoint() as context:
        context.EnsureConnected(credentials={
        ...
        })

Error:

If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates

Environment (please complete the following information):

  • OS: Win 11
  • Python Version: [e.g. Python 3.8.13 32Bit]
  • KOAPY Version: [e.g. 0.9.0]

Additional context
Add any other context about the problem here.

라이브러리를 불러오는 과정에서 몇 가지 오류가 발생합니다.

안녕하세요, 좋은 패키지를 공개해 주셔서 감사합니다.

Koapy를 사용하려고 예제 코드를 시도했습니다만, 패키지를 불러오는 과정에서 오류가 발생했습니다.

from koapy import KiwoomOpenApiContext
Traceback (most recent call last):
File "", line 1, in
File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.2.3\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self.system_import(name, *args, **kwargs)
File "C:\Users\needl\Desktop\stockauto_kiwoom\project_env\lib\site-packages\koapy_init
.py", line 10, in
from koapy.context.KiwoomOpenApiContext import KiwoomOpenApiContext
File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.2.3\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Users\needl\Desktop\stockauto_kiwoom\project_env\lib\site-packages\koapy\context\KiwoomOpenApiContext.py", line 5, in
from koapy.grpc.KiwoomOpenApiServiceClient import KiwoomOpenApiServiceClient
File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.2.3\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Users\needl\Desktop\stockauto_kiwoom\project_env\lib\site-packages\koapy\grpc\KiwoomOpenApiServiceClient.py", line 4, in
from koapy.grpc.KiwoomOpenApiServiceClientStubWrapper import KiwoomOpenApiServiceClientStubWrapper
File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.2.3\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Users\needl\Desktop\stockauto_kiwoom\project_env\lib\site-packages\koapy\grpc\KiwoomOpenApiServiceClientStubWrapper.py", line 11, in
from koapy.openapi.RealType import RealType
File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.2.3\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Users\needl\Desktop\stockauto_kiwoom\project_env\lib\site-packages\koapy\openapi\RealType.py", line 168, in
RealType.load_from_dump_file()
File "C:\Users\needl\Desktop\stockauto_kiwoom\project_env\lib\site-packages\koapy\openapi\RealType.py", line 164, in load_from_dump_file
cls.Fid.load_from_dump_file()
File "C:\Users\needl\Desktop\stockauto_kiwoom\project_env\lib\site-packages\koapy\openapi\RealType.py", line 39, in load_from_dump_file
cls._NAME_BY_FID = cls.name_by_fid_from_dump_file(dump_file)
File "C:\Users\needl\Desktop\stockauto_kiwoom\project_env\lib\site-packages\koapy\openapi\RealType.py", line 32, in name_by_fid_from_dump_file
df = pd.read_excel(dump_file)
File "C:\Users\needl\Desktop\stockauto_kiwoom\project_env\lib\site-packages\pandas\util_decorators.py", line 299, in wrapper
return func(*args, **kwargs)
File "C:\Users\needl\Desktop\stockauto_kiwoom\project_env\lib\site-packages\pandas\io\excel_base.py", line 336, in read_excel
io = ExcelFile(io, storage_options=storage_options, engine=engine)
File "C:\Users\needl\Desktop\stockauto_kiwoom\project_env\lib\site-packages\pandas\io\excel_base.py", line 1102, in init
raise ValueError(
ValueError: Your version of xlrd is 2.0.1. In xlrd >= 2.0, only the xls format is supported. Install openpyxl instead.

위 문제는 xlrd를 1.2.0 버전으로 다운그레드하니 실행은 됩니다만 추가적으로 아래와 같은 Warning이 발생합니다.

FutureWarning: Your version of xlrd is 1.2.0. In xlrd >= 2.0, only the xls format is supported. As a result, the openpyxl engine will be used if it is installed and the engine argument is not specified. Install openpyxl instead.
df = pd.read_excel(dump_file)

확인 부탁드립니다, 감사합니다 :)

0.4버젼 backtrader 샘플 에러 로그

안녕하세요.

bactrader 샘플을 실행하는데 아래와 같에 에러가 발생하네요.
혹시 원인을 알 수 있을까요?

(base) C:\quant\kiwoom>C:/ProgramData/Anaconda3/python.exe c:/quant/kiwoom/test_2.py
2021-07-13 11:17:35,198 [INFO] NumExpr defaulting to 4 threads. - utils.py:141
Traceback (most recent call last):
File "c:/quant/kiwoom/test_2.py", line 14, in
File "C:\Users\my\AppData\Roaming\Python\Python38\site-packages\shiboken2\files.dir\shibokensupport_feature_.py", line 142, inrt_feature_.py", line 142, in _import
return original_import(name, *args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\koapy\backtrader\KiwoomOpenApiPlusEventStreamer.py", line 275, in py", line 275, in
class KiwoomOpenApiPlusEventStreamer(Observer, Logging): the metaclasses of all its bases
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of
the metaclasses of all its bases

GetMarketPriceInfo not working

최신 버전으로 update후 GetMarketPriceInfo함수가 작동되지 않습니다. 항상 [] 값d이 return됩니다.

'KiwoomOpenApiPlusEntrypoint' object has no attribute '_client'

완전히 새로운 환경에서 아무리 시도를 해도 위의 에러가 뜹니다
python 3.10버전으로 시도중입니다.

self._server_executable = get_32bit_executable()
File "C:\Users$user$\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\koapy\config.py", line 303, in get_32bit_executable
return get_executable_from_executable_config(executable_config)
File "C:\Users$user$\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\koapy\config.py", line 289, in get_executable_from_executable_config
return get_executable_from_conda_envname(envname)
File "C:\Users$user$\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\koapy\config.py", line 248, in get_executable_from_conda_envname
return subprocess.check_output(
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 421, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 503, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 971, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 1456, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] 지정된 파일을 찾을 수 없습니다
Exception ignored in: <function KiwoomOpenApiPlusEntrypoint.del at 0x000002CB70B6C790>
Traceback (most recent call last):
File "C:\Users$user$\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\koapy\backend\kiwoom_open_api_plus\core\KiwoomOpenApiPlusEntrypoint.py", line 62, in del
self.close()
File "C:\Users$user$\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\koapy\backend\kiwoom_open_api_plus\core\KiwoomOpenApiPlusEntrypoint.py", line 89, in close
self.close_client()
File "C:\Users$user$\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\koapy\backend\kiwoom_open_api_plus\core\KiwoomOpenApiPlusEntrypoint.py", line 80, in close_client
self._client.close()
File "C:\Users$user$\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\koapy\backend\kiwoom_open_api_plus\core\KiwoomOpenApiPlusEntrypoint.py", line 96, in getattr
return self.getattribute(name)
AttributeError: 'KiwoomOpenApiPlusEntrypoint' object has no attribute '_client'

3개 주식종목 이상 실시간데이터 수신 요청 후 cancel 시 서버 종료 현상

안녕하세요?
좋은 라이브러리 만들어주셔서 감사합니다.
실시간 데이터 수신에 문제가 있어보여 리포트 합니다.

3개 종목 이상 실시간 데이터 stream 요청한 후 stream.cancel() 하면 koapy 서버가 죽는 현상이 있습니다.
2개 종목 이하로 실시간데이터 요청을 하면 죽지 않습니다.
아래 테스트 코드 참고하시어 문제 한번 확인해봐주시겠습니까?

test.py

from time import sleep
from koapy.backend.kiwoom_open_api_plus.grpc.KiwoomOpenApiPlusServiceClient import KiwoomOpenApiPlusServiceClient 
import threading

def getreal(kiwoom, codes,fids,realtype,screenno):
    stream = kiwoom.GetRealDataForCodesAsStream(codes,
                                                fids=fids,
                                                realtype=realtype,
                                                screen_no=screenno)
    sleep(5)
    stream.cancel()

def start():
    print("Started")
    kiwoom = KiwoomOpenApiPlusServiceClient()
    kiwoom.EnsureConnected()

    # codes=["252670","005930"] #<--OK
    codes=["252670","005930","122630"] #<--Not OK, gRPC server get killed.
    fids=[10,11,12,27,28,16,17,18,26,311]
    t=threading.Thread(target=getreal, args=(kiwoom,codes,fids,"주식시세", "1001"))
    t.start()
    t.join()
    print("Finished")

if __name__=="__main__":
    start()

테스트방법

koapy 버전: 0.4.1
python 버전: Python 3.8.8 (default, Apr 13 2021, 15:08:07) [MSC v.1916 32 bit (Intel)] :: Anaconda, Inc. on win32

서버: 터미널 띄워서 koapy serve 실행

koapy serve

클라이언트: 다른 터미널 띄워서 위 스크립트 실행

python test.py

현상
test.py 가 종료되는 순간 server 가 죽음.
수신종목을 2개 이하로 하면 server 죽지 않음.

참고로, 장이 열리지 않는 주말에 테스트 한 것입니다.

감사합니다.

요청이 실행되지 않는 경우가 있는 것 같습니다.

안녕하세요. 만들어주신 라이브러리 잘 사용하고 있습니다.

주문이 실행(요청이 안나가는)이 안되는 경우가 있는 것 같은데, 확인해주실 수 있을까요?

  1. 매도 주문을 연속으로 빠르게 주문하는 경우
    --> 2개의 매도 주문 사이에 0.5초의 시간 텀을 두는 경우 주문이 두개 모두 성공하는 것 같은데, 딜레이 없이 주문하는 경우 두개의 주문 중 하나만 주문 요청이 되고(두개 모두 요청이 안되는 경우도 있습니다.) 나머지는 로그도 남지 않고 없어지는? 상황이 있습니다. 키움증권에서 막는 api 요청 리밋을 넘지는 않았습니다.

  2. 서버 자체가 이상한 경우
    --> 어떤 요청을 해도 아무것도 되지 않는 경우가 가끔씩 발생하는 것 같습니다. 콘솔에 찍히는 로그도 없구요.. 이상황에선 그냥 완전 서버부터 재시작 하면 정상 동작하는데,, 이런 경우는 어떨 때 발생할 수 있을까요?

두가지 상황 모두 무엇을 파악해야 좋을지 OR 알고 계신게 있다면 말씀 부탁드립니다.
감사합니다.

Environment (please complete the following information):

  • OS: window 10
  • Python Version: 3.9.12
  • KOAPY Version: 0.8.4

Additional context
Add any other context about the problem here.

실시간데이터 수신과 반복적인 계좌조회가 multi thread 로 수행될때 gRPC 서버 멈춤 현상

실시간데이터 수신과 반복적인 계좌조회가 multi thread 로 수행될때 gRPC 서버 멈춤 현상을 리포트 합니다.
재현 하실 수 있게 real2.py 를 게시합니다.

real2.py

from time import sleep
from koapy.backend.kiwoom_open_api_plus.grpc.KiwoomOpenApiPlusServiceClient import KiwoomOpenApiPlusServiceClient 
import threading
import random

wait=5
evt = threading.Event()
def getreal(kiwoom, codes,fids,screenno):
    global evt
    stream = kiwoom.GetRealDataForCodesAsStream(codes,
                                                fids=fids,
                                                screen_no=screenno)
    for event in stream:
        if evt.is_set():
            stream.cancel()
            break

    return

def getaccount(kiwoom):
    global evt
    while True:
        s,m=kiwoom.GetAccountEvaluationStatusAsSeriesAndDataFrame(account_no='800409****')
        print(m)
        sleep(wait)
        if evt.is_set():
            break
    return

def start_account_thread(kiwoom):
    t=threading.Thread(target=getaccount, args=(kiwoom,))
    t.start()
    print(f"Account thread started\n")
    return t

def start_real_thread(kiwoom):
    codes=["252670","005930","122630","302440","111710","293490","323410"]
    fids=[10,11,12,27,28,16,17,18,26,311]
    scrno = str(random.randrange(1000,9999))
    t=threading.Thread(target=getreal, args=(kiwoom,codes,fids,scrno))
    t.start()
    print(f"Realtime thread started")
    return t

def start():
    print("Started")
    kiwoom = KiwoomOpenApiPlusServiceClient()
    kiwoom.EnsureConnected()

    t_account = start_account_thread(kiwoom)
    t_real    = start_real_thread(kiwoom) 
    
    sleep(600)
    print('sleep done')
    evt.set() # 600초 뒤에 모든 Thread에 종료 시그널을 보냅니다.
    t_account.join()
    print(f"Account thread terminated\n")
    t_real.join()
    print(f"Realtime thread terminated\n")
    print("Finished")

if __name__=="__main__":
    start()

real2.py 의 동작은 다음과 같습니다.

  1. "5초마다 계좌를 조회"하는 쓰레드 생성 : start_account_thread()
  2. "7개 종목데이터를 실시간 수신"하는 쓰레드 생성 : start_real_thread()
  3. 600초 뒤에 모든 쓰레드를 종료

테스트방법

터미널을 열어 서버를 띄웁니다.
koapy version: 0.5.1

koapy serve

real2.py 에서 account_no='800409****' 의 계좌번호를 본인의 것으로 수정합니다.
터미널을 한개 더 띄워서 real2.py 를 실행시킵니다.

python real2.py

문제현상

처음 1~2분간은 순조롭게 2개 쓰레드가 정상 수행됩니다.
이후 서버가 갑자기 멈추면서 쓰레드 역시 동작을 멈춥니다.

tr : opt10072, opt10073 실행시 multi_data가 안넘어 오는 현상 문의

먼저 이렇게 편하고 좋은 API를 공유해 주셔서 감사합니다.
현재 koapy를 가지고, 실매매 거래정보를 가져와 재구성하는 프로그램을 작성중 입니다.

예제의 하위함수를 통한 TR 요청을 이용하여,
TR번호 opt10072, opt10073 실행시 event.multi_data 가 생성되지 않아 문의 드립니다.

KOA StudioSA 2.20 버전에서 보면, 멀티데이터를 전달하나,
실행시, 멀티데이터값이 없습니다.

키움 HTS에 자동일지차트를 이용해서 보면, 실제 계좌에는 해당 기간동안 해당 종목을 여러번 실현손익한 정보는 있습니다.

하기와 같이 TransactionCall을 이용하여, 호출하고 있습니다.

    rqname = '일자별종목별실현손익요청'
    trcode = 'opt10073'
    screen_no = '0001' # 화면번호, 0000 을 제외한 4자리 숫자 임의로 지정
    inputs = {'계좌번호' : acc,
                '종목코드' : '253840',
                '시작일자' : '20210620',
                '종료일자' : '20210707',
                }
    for event in self.entrypoint.TransactionCall(rqname, trcode, screen_no, inputs):
        print(event)
        columns = event.multi_data.names
        values = event.multi_data.values
        # columns = []
        records = []

        for values in values:
            records.append(self._RemoveLeadingZerosForNumbersInValues(values.values, 10))

TransactionCall 실행시, 하기 경고가 발생하여, 못가져 오는것으로 보입니다.
[WARNING] Repeat count greater than 0, but no multi data names available. - KiwoomOpenApiPlusEventHandlers.py:683

서버에서 정보가 잘못전달 되는것인지, 도저히 확인이 되지 않아, 염치 불구하고 문의 드립니다.

참고로 event.single_data에는 최근 1개의 실현손익 정보가 들어가 있습니다.

도움주셔서 감사합니다.

image

koapy backtrader sample 사용중 알수 없는 중단 현상 문의

안녕하세요?
koapy 내에 backtrader sample프로그램을 활용하고자 합니다.
몇번의 테스트를 해 보았지만 원인을 찾기가 어렵네요.

kiwoom_broker_iteration을 활용해서 테스트를 해보았습니다.
로직상은 이상없는 것처럼 잘 돌아 갑니다.
그런데 약 2시간 정도(정확하지는 않음, 즉 하루종일 구동할수 없음)를 구동하고나면 아무런 응답이 없습니다.
그냥 realtimedata를 가져오지 못하는 듯합니다.

추정해보다면 어떤 특정 시간을 제한하고 있는 것 처럼 느껴지는데.. 이건 느낌일 뿐이고..

그래서 realtimedata를 for loop로 구동했더니 이건 하루종일 구동되었습니다.
backtrader에서 고동하는 하기코드는 중단되는데.. backtrader의 qcheck일까 싶어서 조정해 보았지면 Check시간만 길어지고
약 2 ~3시간후에는 realdata 수신이 되지 않습니다.

혹 방법이 있을까요?
QueueBasedBufferedIterator가 import 되지 않은 프로그램이 있어서 import 해 놓으시면 감사하겠습니다.

좋은 프로그램 공개해 주셔서 많은 도움이 되겠습니다.
고맙습니다.

data = kiwoomstore.getdata(dataname='005930', backfill_start=False, timeframe=bt.TimeFrame.Ticks, compression=1, qcheck=10)
data.resample(timeframe=bt.TimeFrame.Minutes, compression=1)
data.addfilter(bt.filters.SessionFiller)
cerebro.adddata(data, name='005930')
cerebro.replaydata(data, name='005930-1day', timeframe=bt.TimeFrame.Days, compression=1)

data = kiwoomstore.getdata(dataname='035420', backfill_start=False, timeframe=bt.TimeFrame.Ticks, compression=1, qcheck=10)
data.resample(timeframe=bt.TimeFrame.Minutes, compression=1)
data.addfilter(bt.filters.SessionFiller)
cerebro.adddata(data, name='035420')
cerebro.replaydata(data, name='035420-1day', timeframe=bt.TimeFrame.Days, compression=1)

로그인 과정에서 오류가 발생합니다.

with KiwoomOpenApiContext() as context:
# 로그인 예시
context.EnsureConnected()

위 코드 실행시 아래와 같은 메시지가 출력되며 오류가 발생합니다.

Traceback (most recent call last):
File "", line 1, in
File "C:\Users\needl\Desktop\stockauto_kiwoom\project_env\lib\site-packages\koapy\context\KiwoomOpenApiContext.py", line 35, in init
assert self._client.is_ready()
AssertionError

order 취소가 잘 안되요

Debug시 test로 진행할경우 order취소가 되는데, 실제 프로그램 실행시 최소가 안되요,
무슨 원인인지 파악하기가 어렵네요.

stream 두번 같이 쓰면 안되는건가요?

실시간 조건식을 불러오고

실시간데이터요청해서 데이터 다루고 싶은데

for event in cancel_after(stream, 10):
  elif event.name == "OnReceiveRealCondition":
        code = event.arguments[0].string_value
        condition_type = event.arguments[1].string_value
        if condition_type == "I":
            code_inserted = code
            condition_met_code_list.append(code_inserted)
  elif condition_type == "D":
            code_deleted = code
            condition_met_code_list.remove(code_deleted)
   elif event.name == "OnReceiveRealData":
        data = dict(zip(event.single_data.names, event.single_data.values))
        print(data)



stream = entrypoint.GetCodeListByConditionAsStream(condition_name)


stream = entrypoint.GetRealDataForCodesAsStream(
    code_list,
    fid_list,
    opt_type,
    screen_no=None,  # 화면번호, 0000 을 제외한 4자리 숫자 임의로 지정, None 의 경우 내부적으로 화면번호 자동할당
    infer_fids=True,  # True 로 설정 시 주어진 fid_list 를 고집하지 말고 이벤트 처리 함수의 인자로 전달받는 실시간데이터 이름에 따라 유연하게 fid_list 를 추론
    readable_names=True,  # True 로 설정 시 각 fid 마다 숫자 대신 읽을 수 있는 이름으로 변환하여 반환
    fast_parse=False,  # True 로 설정 시 이벤트 처리 함수내에서 데이터 값 읽기 시 GetCommRealData() 함수 호출 대신, 이벤트 처리 함수의 인자로 넘어오는 데이터를 직접 활용, infer_fids 가 True 로 설정된 경우만 유의미함
)

이렇게 복사했습니다.

근데 조건식은 잘 표시되는데

리얼데이터가 안받아져요... ㅠ

어떻게 해야될까요?

FID를 xlsx 대신 csv로 바꾸면 어떨까 합니다.

Is your feature request related to a problem? Please describe.

  1. FID number에 대한 label을 추가 하고 싶어도 excel이 없으면, 추가하기 쉽지 않음.
  2. xlsx는 로딩하는데 csv보다 시간이 걸림. 바꿔서 테스트해본 결과 0.4초 정도의 로딩 이득이 있음.

_InactiveRpcError 문의

안녕하세요?

koapy 가 아래와 같은 에러로 자주 멈춥니다.

---------------------------------------------------------------------------
_InactiveRpcError                         Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_16832/2625759874.py in <module>
      4 from koapy.backend.kiwoom_open_api_plus.grpc.KiwoomOpenApiPlusServiceClient import KiwoomOpenApiPlusServiceClient
      5 kiwoom = KiwoomOpenApiPlusServiceClient()
----> 6 kiwoom.EnsureConnected()

~\.conda\envs\danta\lib\site-packages\koapy\backend\kiwoom_open_api_plus\core\KiwoomOpenApiPlusQAxWidgetMixin.py in EnsureConnected(self, credentials)
    794         로그인이 되어있지 않다면 로그인을 수행합니다.
    795         """
--> 796         is_connected = self.IsConnected()
    797         if not is_connected:
    798             self.Connect(credentials)

~\.conda\envs\danta\lib\site-packages\koapy\backend\kiwoom_open_api_plus\core\KiwoomOpenApiPlusQAxWidgetMixin.py in IsConnected(self)
     41         키움증권 서버에 접속되었는지 여부를 반환합니다.
     42         """
---> 43         return self.GetConnectState() == 1
     44 
     45     def ShowAccountWindow(self):

~\.conda\envs\danta\lib\site-packages\koapy\backend\kiwoom_open_api_plus\grpc\KiwoomOpenApiPlusServiceClientSideDynamicCallable.py in __call__(self, *args)
     32     def __call__(self, *args):
     33         request = self._create_call_request(self._name, args)
---> 34         response = self._stub.Call(request)
     35         result = self._unpack_response(response)
     36         return result

~\AppData\Roaming\Python\Python39\site-packages\grpc\_channel.py in __call__(self, request, timeout, metadata, credentials, wait_for_ready, compression)
    944         state, call, = self._blocking(request, timeout, metadata, credentials,
    945                                       wait_for_ready, compression)
--> 946         return _end_unary_response_blocking(state, call, False, None)
    947 
    948     def with_call(self,

~\AppData\Roaming\Python\Python39\site-packages\grpc\_channel.py in _end_unary_response_blocking(state, call, with_call, deadline)
    847             return state.response
    848     else:
--> 849         raise _InactiveRpcError(state)
    850 
    851 

_InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
	status = StatusCode.UNAVAILABLE
	details = "failed to connect to all addresses"
	debug_error_string = "{"created":"@1648791831.720000000","description":"Failed to pick subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":3129,"referenced_errors":[{"created":"@1648791831.720000000","description":"failed to connect to all addresses","file":"src/core/lib/transport/error_utils.cc","file_line":163,"grpc_status":14}]}"

재현시나리오를 특정하지는 못했으나, 계좌조회, 조건검색, 주식매매 등 여러 동작들이 반복되던 중에
꼭 한번씩은 발생되는 것 같습니다. 어떻게 디버깅해보면 좋을지 조언 부탁드립니다.

실시간 등록,해제를 반복하면 gRPC 서버가 멈추는 현상

아래 이슈에 연계된 버그 리포트 드립니다.
#36 (comment)

실시간 등록 해제를 반복하다보면 서버가 멈추는 현상이 발생합니다.
아래 테스트 코드 참고하시어 문제 한번 확인 해 보시길 부탁드립니다.

real.py

from time import sleep
from koapy.backend.kiwoom_open_api_plus.grpc.KiwoomOpenApiPlusServiceClient import KiwoomOpenApiPlusServiceClient 
import threading
import random

wait=5
def getreal(kiwoom, codes,fids,realtype,screenno):
    stream = kiwoom.GetRealDataForCodesAsStream(codes,
                                                fids=fids,
                                                realtype=realtype,
                                                screen_no=screenno)
    sleep(wait)
    stream.cancel()

def start():
    print("Started")
    kiwoom = KiwoomOpenApiPlusServiceClient()
    kiwoom.EnsureConnected()

    codes=["252670","005930","122630","302440","111710","293490","323410"]
    fids=[10,11,12,27,28,16,17,18,26,311]
    for i in range(1,8):
        scrno = str(random.randrange(1000,9999))
        t=threading.Thread(target=getreal, args=(kiwoom,codes[:i],fids,"주식시세", scrno))
        t.start()
        print(f"Thread #{i} started")
        t.join()
        print(f"Thread #{i} terminated\n")
        sleep(wait)
    print("Finished")

if __name__=="__main__":
    start()

실시간 등록,해제를 Thread를 사용해서 7번 반복하는 스크립트입니다.

테스트방법

터미널을 열어서 서버를 띄웁니다.

koapy serve

터미널을 한개 더 띄워서 real.py 를 실행시킵니다.

python real.py

문제현상

실시간 등록 해제가 반복되던중 5~6번째 반복에서 서버가 응답이 없어집니다.
wait=5 시간을 더 줄이면 문제 현상이 더 자주 발생되는 점 참고 부탁드립니다.

감사합니다.

no module named koapy.comp

Describe the bug
예시 스크립트 실행시 3행 no module named koapy.comp에서 no module named koapy.comp 오류 발생

To Reproduce
README.rst 파일의 예시 스크립트를 저장한 후 그대로 그대로 실행해 보았을 때 처음 만나는 오류입니다. miniconda의 python3.8 64bit설치 후 koapi 0.3.1 패키지를 pip을 통하여 설치하였습니다. ipython 쉘에서 실행해 보아도 다음과 같은 오류가 발생합니다.

(base) C:\Users\danho\proj\trading2021v1\koapy>ipython
Python 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.20.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from koapy import KiwoomOpenApiPlusEntrypoint

ModuleNotFoundError Traceback (most recent call last)
in
----> 1 from koapy import KiwoomOpenApiPlusEntrypoint

~\miniconda3\lib\site-packages\koapy_init_.py in
5 version = '0.3.1'
6
----> 7 from koapy.backend.kiwoom_open_api_plus.core.KiwoomOpenApiPlusQAxWidget import KiwoomOpenApiPlusQAxWidget
8 from koapy.backend.kiwoom_open_api_plus.core.KiwoomOpenApiPlusEntrypoint import KiwoomOpenApiPlusEntrypoint
9 from koapy.backend.kiwoom_open_api_plus.core.KiwoomOpenApiPlusError import KiwoomOpenApiPlusError

~\miniconda3\lib\site-packages\koapy\backend\kiwoom_open_api_plus\core\KiwoomOpenApiPlusQAxWidget.py in
----> 1 from koapy.compat.pyside2.QtWidgets import QWidget
2 from koapy.compat.pyside2.QtAxContainer import QAxWidget
3 from koapy.compat.pyside2.QtCore import QEvent, Qt
4
5 from koapy.backend.kiwoom_open_api_plus.core.KiwoomOpenApiPlusDynamicCallable import KiwoomOpenApiPlusDynamicCallable

ModuleNotFoundError: No module named 'koapy.compat'

In [2]:

Environment (please complete the following information):

  • OS: Windows 10
  • Python Version: Python 3.8 64bit
  • KOAPY Version: 0.3.1

거래시 Cannot specify order no 에러

Cannot specify order no 오류 발생
backtrader live환경을 사용하고 있습니다. 실거래 시에 오류가 발생하여
예제 코드를 돌렸습니다만, 실거래 환경에서 매수 거래를 하는데 오류가 발생하네요.
재밌는건 대략 2주 전에도 모의/실거래 환경에서도 거래가 잘 되었었습니다.

To Reproduce
예제를 돌린 상황입니다.

request_name = '삼성전자 1주 시장가 신규 매수' # 사용자 구분명, 구분가능한 임의의 문자열
screen_no = '0001'                           # 화면번호
account_no = account_no                # 계좌번호 10자리, 여기서는 계좌번호 목록에서 첫번째로 발견한 계좌번호로 매수처리
order_type = 1         # 주문유형, 1 : 신규매수
code = '005930'
# 종목코드, 앞의 삼성전자 종목코드
quantity = 1           # 주문수량, 1주 매수
price = 0              # 주문가격, 시장가 매수는 가격설정 의미없음
quote_type = '03'      # 거래구분, 03 : 시장가
original_order_no = '' # 원주문번호, 주문 정정/취소 등에서 사용

# 현재는 기본적으로 주문수량이 모두 소진되기 전까지 이벤트를 듣도록 되어있음 (단순 호출 예시)
for event in context.OrderCall(request_name, screen_no, account_no, order_type, code, quantity, price, quote_type, original_order_no):
        pp.pprint(MessageToDict(event))

** 로그
{'arguments': [{'stringValue': '0001'},
{'stringValue': '삼성전자 1주 시장가 신규 매수'},
{'stringValue': 'KOA_NORMAL_BUY_KP_ORD'},
{'stringValue': ''},
{'stringValue': ''}],
'name': 'OnReceiveTrData',
'singleData': {'names': ['주문번호'], 'values': ['']}}
Traceback (most recent call last):
File "c:/quant/kiwoom/test.py", line 52, in
for event in context.OrderCall(request_name, screen_no, account_no, order_type, code, quantity, price, quote_type, original_order_no):
File "C:\ProgramData\Anaconda3\lib\site-packages\grpc_channel.py", line 416, in next
return self._next()
File "C:\ProgramData\Anaconda3\lib\site-packages\grpc_channel.py", line 803, in _next
raise self
grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
status = StatusCode.UNKNOWN
details = "Exception iterating responses: Cannot specify order no"
debug_error_string = "{"created":"@1608852409.406000000","description":"Error received from peer ipv6:[::1]:5943","file":"src/core/lib/surface/call.cc","file_line":1062,"grpc_message":"Exception iterating responses: Cannot specify order no","grpc_status":2}"

32bit server, 64bit client 실행 중 오류

Describe the bug
먼저 훌륭한 소스를 공개해주셔서 감사합니다. koapy 32bit server를 실행하고, 64bit에서 login(성공) 후 stockinfo 호출 시 오류 발생

To Reproduce
Steps to reproduce the behavior:

  1. python3.9 32bit > koapy serv 실행
(koapy-srv-py3.9) D:\pjt_py\koapy_srv>koapy serve
2022-10-15 01:19:39,454 [DEBUG] Creating manager application - KiwoomOpenApiPlusManagerApplication.py:206
2022-10-15 01:19:42,001 [DEBUG] Creating server application - KiwoomOpenApiPlusServerApplication.py:150
2022-10-15 01:19:42,290 [DEBUG] Started server application - KiwoomOpenApiPlusServerApplication.py:394
2022-10-15 01:19:42,398 [DEBUG] Started manager application - KiwoomOpenApiPlusManagerApplication.py:664
  1. python3.10 64bit > koapy login
[GetPCIdentity] VER 3.2.0.0  build 2015.8.12

[GetPCIdentity] VER 3.2.0.0  build 2015.8.12
2022-10-15 01:20:56,661 [DEBUG] OnEventConnect(0) - KiwoomOpenApiPlusLoggingEventHandler.py:89
  1. python3.10 64bit > koapy get stockinfo -c 005930
    오류 발생

Screenshots

(koapy-cli-py3.10) D:\pjt_py\koapy_cli>koapy get stockinfo -c 005930
Traceback (most recent call last):
  File "runpy.py", line 196, in _run_module_as_main
  File "runpy.py", line 86, in _run_code
  File "D:\pjt_py\koapy_cli\.venv\Scripts\koapy.exe\__main__.py", line 7, in <module>
  File "D:\pjt_py\koapy_cli\.venv\lib\site-packages\koapy\cli\__init__.py", line 391, in main
    cli()
  File "D:\pjt_py\koapy_cli\.venv\lib\site-packages\click\core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "D:\pjt_py\koapy_cli\.venv\lib\site-packages\click\core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "D:\pjt_py\koapy_cli\.venv\lib\site-packages\click\core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "D:\pjt_py\koapy_cli\.venv\lib\site-packages\click\core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "D:\pjt_py\koapy_cli\.venv\lib\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "D:\pjt_py\koapy_cli\.venv\lib\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "D:\pjt_py\koapy_cli\.venv\lib\site-packages\click\decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "D:\pjt_py\koapy_cli\.venv\lib\site-packages\koapy\cli\extensions\verbose_option.py", line 128, in new_func
    return ctx.invoke(f, *args, **kwargs)
  File "D:\pjt_py\koapy_cli\.venv\lib\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "D:\pjt_py\koapy_cli\.venv\lib\site-packages\koapy\cli\commands\get\stock_meta\stockname.py", line 24, in stockname
    with KiwoomOpenApiPlusEntrypoint(port=port) as context:
  File "D:\pjt_py\koapy_cli\.venv\lib\site-packages\koapy\backend\kiwoom_open_api_plus\core\KiwoomOpenApiPlusEntrypoint.py", line 31, in __init__
    self._server_executable = get_32bit_executable()
  File "D:\pjt_py\koapy_cli\.venv\lib\site-packages\koapy\config.py", line 303, in get_32bit_executable
    return get_executable_from_executable_config(executable_config)
  File "D:\pjt_py\koapy_cli\.venv\lib\site-packages\koapy\config.py", line 289, in get_executable_from_executable_config
    return get_executable_from_conda_envname(envname)
  File "D:\pjt_py\koapy_cli\.venv\lib\site-packages\koapy\config.py", line 248, in get_executable_from_conda_envname
    return subprocess.check_output(
  File "subprocess.py", line 421, in check_output
  File "subprocess.py", line 503, in run
  File "subprocess.py", line 971, in __init__
  File "subprocess.py", line 1440, in _execute_child
FileNotFoundError: [WinError 2] 지정된 파일을 찾을 수 없습니다
Exception ignored in: <function KiwoomOpenApiPlusEntrypoint.__del__ at 0x0000019BC1A21F30>
Traceback (most recent call last):
  File "D:\pjt_py\koapy_cli\.venv\lib\site-packages\koapy\backend\kiwoom_open_api_plus\core\KiwoomOpenApiPlusEntrypoint.py", line 62, in __del__
    self.close()
  File "D:\pjt_py\koapy_cli\.venv\lib\site-packages\koapy\backend\kiwoom_open_api_plus\core\KiwoomOpenApiPlusEntrypoint.py", line 89, in close
    self.close_client()
  File "D:\pjt_py\koapy_cli\.venv\lib\site-packages\koapy\backend\kiwoom_open_api_plus\core\KiwoomOpenApiPlusEntrypoint.py", line 80, in close_client
    self._client.close()
  File "D:\pjt_py\koapy_cli\.venv\lib\site-packages\koapy\backend\kiwoom_open_api_plus\core\KiwoomOpenApiPlusEntrypoint.py", line 96, in __getattr__
    return self.__getattribute__(name)
AttributeError: 'KiwoomOpenApiPlusEntrypoint' object has no attribute '_client'

Environment (please complete the following information):

  • OS: [Windows 10]
  • Python Version: [Python 3.9 32Bit / Python 3.10 64Bit]
  • KOAPY Version: [0.9.0]

그래서, 원인을 찾던 중 koapy\backend\kiwoom_open_api_plus\core\KiwoomOpenApiPlusEntrypoint.py 파일 내용을 일부 수정 후 테스트 결과 정상적으로 동작을 했습니다.
소스를 수정하는 것 외에 다른 방법이 있는 지 궁금하네요.

import threading

from koapy.backend.kiwoom_open_api_plus.core.KiwoomOpenApiPlusEntrypointMixin import (
    KiwoomOpenApiPlusEntrypointMixin,
)
from koapy.backend.kiwoom_open_api_plus.grpc.KiwoomOpenApiPlusServiceClient import (
    KiwoomOpenApiPlusServiceClient,
)
**from koapy.config import config, get_32bit_executable, get_64bit_executable**# 추가
from koapy.utils.logging import get_verbosity
from koapy.utils.logging.Logging import Logging
from koapy.utils.networking import get_free_localhost_port
from koapy.utils.subprocess import Popen`


class KiwoomOpenApiPlusEntrypoint(KiwoomOpenApiPlusEntrypointMixin, Logging):
    def __init__(
        self,
        port=None,
        client_check_timeout=None,
    ):
        if port is None:
            port = (
                config.get("koapy.backend.kiwoom_open_api_plus.grpc.port", 0)
                or get_free_localhost_port()
            )

        self._port = port
        self._client_check_timeout = client_check_timeout

        **#self._server_executable = get_32bit_executable() # comment out
        self._server_executable = get_64bit_executable()**  # 추가

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.