Skip to main content

ebest xing api wrapper

Project description

xing-tick-crawler

  • 반드시 python 32bit를 사용

설치

pip install xing-tick-crawler

사용예시

1. config.py 파일 생성 및 설정

config = {
    "id": "my_id",  # xing api 아이디
    "password": "my_password",  # xing api 패스워드
    "cert_password": "my_cert_password",  # 공동인증서 비밀번호
}

RES_FOLDER_PATH = "C:/eBEST/xingAPI/Res"  # xing_tick_crawler Res 파일 폴더 위치
TICKER_DATA_FOLDER_PATH = "."  # tick 데이터 저장할 위치

2. main.py 생성 및 실행

  • 필요없는 데이터 off 하고, 실행
from multiprocessing import Process, get_context
from multiprocessing.queues import Queue
from datetime import datetime
from xing_tick_crawler.crawler import stock_crawler, stock_futures_crawler
from xing_tick_crawler import tick_writer

BUNDLE_BY_MARKET = True

if __name__ == "__main__":
    KOSPI_ORDER_BOOK = False               # 코스피 전종목 호가
    KOSPI_TICK = True                      # 코스피 전종목 체결
    KOSDAQ_ORDER_BOOK = False              # 코스닥 전종목 호가
    KOSDAQ_TICK = True                     # 코스닥 전종목 체결
    STOCK_FUTURES_ORDER_BOOK = False       # 주식선물 전종목 호가
    STOCK_FUTURES_TICK = True              # 주식선물 전종목 체결

    queue = Queue(ctx=get_context())
    p0 = Process(target=stock_crawler, args=(queue, KOSPI_ORDER_BOOK, KOSPI_TICK, KOSDAQ_ORDER_BOOK, KOSDAQ_TICK))
    p1 = Process(target=stock_futures_crawler, args=(queue, STOCK_FUTURES_ORDER_BOOK, STOCK_FUTURES_TICK))

    p0.start()
    p1.start()

    try:
        while True:
            tick = queue.get()
            waiting_tasks = queue.qsize()
            tick_type, tick_data = tick
            print(f"\r{datetime.now()} waiting tasks : {'%6d' % waiting_tasks}", end='')
            tick_writer.handle_tick_data(tick_data, tick_type)

    except KeyboardInterrupt:
        tick_writer.close_all_writer()
        print("사용자 종료")

기능

  • 코스피 호가
  • 코스피 체결
  • 코스닥 호가
  • 코스닥 체결
  • 주식선물 호가
  • 주식선물 체결
  • 코스피200 선물호가
  • 코스피200 선물체결
  • 코스피 시간외단일가 호가
  • 코스피 시간외단일가 체결
  • 코스닥 시간외단일가 호가
  • 코스닥 시간외단일가 체결
  • 코스피 거래원
  • 코스닥 거래원
  • 주식VI 발동해제

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

xing_tick_crawler-0.0.3-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file xing_tick_crawler-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: xing_tick_crawler-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.6

File hashes

Hashes for xing_tick_crawler-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 340926fa59a9d016e6634d8447188eb8069fac3d71dd82e5e0c8cc1be4462b99
MD5 dec0dbbfe01af9040fa765dd6c0d3881
BLAKE2b-256 24ebe22b90508ef6ab9491f0e5272e1f2a92b0892652d0257c20299e7a9b34cb

See more details on using hashes here.

Supported by

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