Skip to main content

Eugene Investment & Securities Champion Open Api Python

Project description

pyEugene ๐Ÿ“ˆ

Publish to Pypi PyPI version Downloads

Eugene Investment & Securities Champion Open Api Python Wrapper

Free software: MIT

Demo

Demo

Prerequisites ๐Ÿ‘“

  • Python 3.9.*
  • 32 Bit Development environment
  • Eugene Web Account (need Eugene securities account)

Introduction ๐Ÿ’ป

pyEugene is an unofficial python wrapper for easy use of the Champion Open API provided by Eugene Investment & Securities.

Even if you are not familiar with the functions below, you can use all of them.

  • The API structure of OCX provided by Eugene Investment & Securities
  • Operating Structure of the Version Processing Program Provided by Eugene Investment & Securities
  • Use dynamicCall function for function invocation in control
ํ•œ๊ตญ์–ด ์†Œ๊ฐœ ๐Ÿ’ป pyEugene์€ ์œ ์ง„ํˆฌ์ž์ฆ๊ถŒ์—์„œ ์ œ๊ณตํ•˜๋Š” Champion Open API๋ฅผ ์‰ฝ๊ฒŒ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•œ ๋น„๊ณต์‹ python wrapper์ž…๋‹ˆ๋‹ค.

์•„๋ž˜์˜ ๊ธฐ๋Šฅ๋“ค์„ ์ž˜ ๋ชจ๋ฅด๋”๋ผ๋„ ์ถฉ๋ถ„ํžˆ ๋ชจ๋“  ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  • ์œ ์ง„ํˆฌ์ž์ฆ๊ถŒ์—์„œ ์ œ๊ณตํ•˜๋Š” OCX์˜ API ๊ตฌ์กฐ
  • ์œ ์ง„ํˆฌ์ž์ฆ๊ถŒ์—์„œ ์ œ๊ณตํ•˜๋Š” ๋ฒ„์ „์ฒ˜๋ฆฌ ํ”„๋กœ๊ทธ๋žจ์˜ ์ž‘๋™ ๊ตฌ์กฐ
  • ์ปจํŠธ๋กค์—์„œ ํ•จ์ˆ˜ ํ˜ธ์ถœ์„ ์œ„ํ•œ dynamicCall ํ•จ์ˆ˜ ์‚ฌ์šฉ

Getting Started ๐Ÿš€

To begin using pyEugene, start by installing anaconda(or you can use miniconda):

Download anaconda Download miniconda

When you're done installing the anaconda, run the anaconda prompt and set it to a 32-bit development environment

set CONDA_FORCE_32BIT=1

If you replace the anaconda with 32-bit, create a 32-bit virtual environment (You should use Python 3.9 version)

conda create --name py39_32 python=3.9

When you're done installing, activate virtual environment and use the pip to install pyEugene

conda activate py39_32
pip install pyeugene

Once you've installed pyEugene, you can start using it right away. For example, to get real-time stock price using pyEugene, enter the following code:

import sys
import os
from pprint import pprint
from dotenv import load_dotenv
from pyeugene.eugene_manager import EugeneManager

if __name__ == "__main__":
    load_dotenv()
    em = EugeneManager(os.getenv("USER_ID"), os.getenv("USER_PW"), os.getenv("CERT_PW"))

    real_cmd = {
        'realId': '21',
        'realKey': '005930',
        'output': ["SCODE", "SNAME", "CMARKETGUBUN", "LTIME", "CPCHECK", "LDIFF", "LCPRICE"]
    }

    em.put_real(real_cmd)
    for i in range(10):
        data = em.get_real()
        pprint(data)
    sys.exit()
ํ•œ๊ตญ์–ด ์‚ฌ์šฉ ๊ฐ€์ด๋“œ ๐Ÿš€

pyEugene์„ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” ์•„๋‚˜์ฝ˜๋‹ค๋ฅผ ์„ค์น˜ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค(๋ฏธ๋‹ˆ์ฝ˜๋‹ค๋ฅผ ์„ค์น˜ํ•ด ์‚ฌ์šฉํ•  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค)

์•„๋‚˜์ฝ˜๋‹ค ๋‹ค์šด๋กœ๋“œ ๋ฏธ๋‹ˆ์ฝ˜๋‹ค ๋‹ค์šด๋กœ๋“œ

์•„๋‚˜์ฝ˜๋‹ค ๋‹ค์šด๋กœ๋“œ๊ฐ€ ์™„๋ฃŒ ๋˜์—ˆ์œผ๋ฉด ์•„๋‚˜์ฝ˜๋‹ค ํ”„๋กฌํ”„ํŠธ๋ฅผ ์‹คํ–‰ํ•ด 32bit ๊ฐœ๋ฐœํ™˜๊ฒฝ์œผ๋กœ ์„ค์ •ํ•ด์ค˜์•ผ ํ•ฉ๋‹ˆ๋‹ค

set CONDA_FORCE_32BIT=1

32bit๋กœ ์„ค์ •์ด ์™„๋ฃŒ ๋˜์—ˆ์œผ๋ฉด 32bit ๊ฐ€์ƒ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ์„ ๋งŒ๋“ค์–ด์ค๋‹ˆ๋‹ค (ํŒŒ์ด์ฌ 3.9 ๋ฒ„์ „์„ ์‚ฌ์šฉํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค)

conda create --name py39_32 python=3.9

์„ค์น˜๊ฐ€ ๋ชจ๋‘ ๋๋‚˜๋ฉด ๊ฐ€์ƒํ™˜๊ฒฝ์„ ์‹คํ–‰ํ•˜๊ณ  pip๋ฅผ ํ†ตํ•ด pyEugene์„ ์„ค์น˜ํ•ด์ค๋‹ˆ๋‹ค

conda activate py39_32
pip install pyeugene

๋‹ค์Œ๋ถ€ํ„ฐ๋Š” pyEugene์„ ์„ค์น˜ํ•˜์ง€ ์•Š๊ณ ๋„ ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ฐ„๋‹จํ•œ ์˜ˆ์‹œ๋กœ pyEugene์„ ์ด์šฉํ•ด ์‹ค์‹œ๊ฐ„ ์‹œ์„ธ๋ฅผ ๋ฐ›์•„์˜ค๋ ค๋ฉด ์•„๋ž˜ ์ฝ”๋“œ๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค

import sys
import os
from pprint import pprint
from dotenv import load_dotenv
from pyeugene.eugene_manager import EugeneManager

if __name__ == "__main__":
    load_dotenv()
    em = EugeneManager(os.getenv("USER_ID"), os.getenv("USER_PW"), os.getenv("CERT_PW"))

    real_cmd = {
        'realId': '21',
        'realKey': '005930',
        'output': ["SCODE", "SNAME", "CMARKETGUBUN", "LTIME", "CPCHECK", "LDIFF", "LCPRICE"]
    }

    em.put_real(real_cmd)
    for i in range(10):
        data = em.get_real()
        pprint(data)
    sys.exit()

Contributions ๐Ÿ’ฌ

Feel free to contribute to pyEugene fixing bugs.

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

pyeugene-0.1.6.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

pyeugene-0.1.6-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file pyeugene-0.1.6.tar.gz.

File metadata

  • Download URL: pyeugene-0.1.6.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.9.13 Windows/10

File hashes

Hashes for pyeugene-0.1.6.tar.gz
Algorithm Hash digest
SHA256 94455d843b487b095653b929205d79644b0b1bd005dfe408a38bcb73b3f50f2d
MD5 ab3fa4ea86924f826ce7e3ccde684a04
BLAKE2b-256 c522cc96b902b08ffb20502db821f2472c0ebbf5d1e630e995cc7210944662ab

See more details on using hashes here.

File details

Details for the file pyeugene-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: pyeugene-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.9.13 Windows/10

File hashes

Hashes for pyeugene-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 1de627e3e961d6e44c9320312bfcd3069a558ddd0c3b17e080192ce8a341e1b4
MD5 95033872d514234a38e9f6ddee949caf
BLAKE2b-256 fba1bf6c6c7a7ea24f1f7776e0e303f1a527926060f0881f4d22045af3ea2e94

See more details on using hashes here.

Supported by

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