
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
pykis는 한국투자증권에서 제공하는 Open Trading API를 쉽게 사용하기 위한 비공식 python wrapper입니다.
기존 eFriend expert (HTS 프로그램) 연동 방식 API 대비 다음과 같은 장점들이 있습니다.
기존 eFriend expert 연동 방식 API를 사용하는 python 패키지는 pjueon/eFriendPy를 참고하세요.
pykis는 Apache-2.0 license를 따릅니다.
git clone https://github.com/pjueon/pykis.git
cd pykis
pip3 install -r requirements.txt
import pykis
Api 객체 생성실제 계좌를 사용하는 경우
# API 사용을 위한 API key정보 및 계좌 정보를 설정합니다.
# 별도의 파일(json, yaml, xml, etc) 등에 내용을 저장하여 불러오는 것을 추천합니다.
# key 정보는 절대 외부로 유출되지 않도록 주의하시고, 유출시 즉시 재발급 하시기 바랍니다.
key_info = { # KIS Developers 서비스 신청을 통해 발급받은 API key 정보
"appkey": "[발급 받은 APP Key]",
"appsecret": "[발급 받은 APP Secret]"
}
account_info = { # 사용할 계좌 정보
"account_code": "[API를 신청한 종합 계좌번호(계좌번호 앞자리 8자리 숫자)]",
"product_code": "[계좌번호의 끝자리 2자리 숫자]" # ex> "01", "22", etc
}
# API 객체 생성
api = pykis.Api(key_info=key_info, account_info=account_info)
모의 계좌를 사용하는 경우
domain = pykis.DomainInfo(kind="virtual")
# API 객체 생성
api = pykis.Api(key_info=key_info, domain_info=domain_info, account_info=account_info)
account_info = { # 사용할 계좌 정보
"account_code": "[API를 신청한 종합 계좌번호(계좌번호 앞자리 8자리 숫자)]",
"product_code": "[계좌번호의 끝자리 2자리 숫자]" # ex> "01", "22", etc
}
api.set_account(account_info)
cash = api.get_kr_buyable_cash()
print(f"거래 가능 현금: {cash} 원")
ticker = "005930" # 삼성전자 종목코드
price = api.get_kr_current_price(ticker)
print(f"삼성전자 현재가: {price} 원")
# 최근 30 일/주/월 OHLCV 데이터를 DataFrame으로 반환
ticker = "005930" # 삼성전자 종목코드
time_unit = "D" # 기간 분류 코드 (D/day-일, W/week-주, M/month-월), 기본값 "D"
ohlcv = api.get_kr_ohlcv(ticker, time_unit)
ticker = "005930" # 삼성전자 종목코드
price = api.get_kr_min_price(ticker)
print(f"삼성전자 하한가: {price} 원")
ticker = "005930" # 삼성전자 종목코드
price = api.get_kr_max_price(ticker)
print(f"삼성전자 상한가: {price} 원")
# DataFrame 형태로 국내 주식 잔고 반환
stock = api.get_kr_stock_balance()
print(f"보유중인 국내 주식: \n{stock}")
deposit = api.get_kr_deposit()
print(f"총 예수금: {deposit} 원")
ticker = "005930" # 삼성전자 종목코드
price = 100000 # 매수 가격 예시. 가격이 0 이하인 경우 시장가로 매수
# 종목코드 ticker인 국내 주식 1주 매수 주문
ret = api.buy_kr_stock(ticker, 1, price=price)
# 반환값: 서버 응답 (주문 번호 등의 정보)
print(ret)
ticker = "005930" # 삼성전자 종목코드
price = 100000 # 매도 가격 예시. 가격이 0 이하인 경우 시장가로 매도
# 종목코드 ticker인 국내 주식 1주를 지정가로 매도 주문
ret = api.sell_kr_stock(ticker, 1, price=price)
# 반환값: 서버 응답 (주문 번호 등의 정보)
print(ret)
# 정정/취소 가능한 국내 주식 주문을 DataFrame으로 반환
orders = api.get_kr_orders()
print(orders)
# order_num: 주문 번호. api.get_kr_orders 통해 확인 가능.
# amount: 취소할 주문 수량. 지정하지 않은 경우 잔량 전부 취소.
api.cancel_kr_order(order_num, amount)
api.cancel_all_kr_orders()
# order_num: 주문 번호. api.get_kr_orders 통해 확인 가능.
# price: 정정할 1주당 가격.
# amount: 정정할 주문 수량. 지정하지 않은 경우 잔량 전부 정정.
api.revise_kr_order(order_num, price, amount)
FAQs
A python wrapper for open trading api of Korea Investment & Securities.
We found that pykis demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.