Giter Club home page Giter Club logo

okex-py's Introduction

okex-py

欧易OKEx (现OKX) 数字货币自动交易python语言SDK (非官方)
OKEx (OKX) Cryptocurrency Exchange python SDK (Unofficial)

本项目基于V5 API,支持WebSocket接口
This project supports V5 REST and WebSocket API.

本项目期望使用充分的类型标注提升API的编程体验,但也因此需要高版本的python We expect to enhance the API programming experience with adequate type annotations.

API Documents: okx-zh-v5, okx-en-v5

前置条件 Requirements

Python >= 3.10

使用例子 Example

import okex.v5.account_api as account
import okex.v5.market_api as market
accountAPI = account.AccountAPI(api_key, secret_key, passphrase, False, test=test)
result = accountAPI.get_positions()
# print my positions
print(result)

文档 Documentation

施工中 Future Work

安装 Installation

方法一 (Method 1):

  1. 直接安装,Install the package directly
pip install git+https://github.com/quantmew/okex-py.git 

方法二 (Method 2):

  1. 克隆本仓库,Clone the repository
git clone https://github.com/quantmew/okex-py.git
  1. 安装,Install the package
cd okex-py
pip install .

免责声明 Disclaimers

API接口尚不稳定
API is not yet stable
本项目不对软件运行的行为做任何保证,对于因使用本软件产生的损失均不承担任何责任。请充分测试软件后再酌情使用。
This project does not guarantee the behavior of the software and is not responsible for any damages arising from the use of the software. Please test the software sufficiently before using it.

okex-py's People

Contributors

jstzwj avatar yanghongtu 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

okex-py's Issues

一些问题

python是什么版本的,websocket有报错,是V5的还是V3的api?

Wrong "API_URL"?

Should API_URL in const.py be changed to okex.win instead of okex.com ?

I will get HTTPSConnectionPool(host='www.okex.com', port=443) when using the latter address.

无法导入TypeAlias

无法导入TypeAlias

# python3 example_v5.py 
Traceback (most recent call last):
  File "example_v5.py", line 14, in <module>
    import okex.v5.account_api as account
  File "/usr/local/lib/python3.8/dist-packages/okex/v5/account_api.py", line 10, in <module>
    from .ccytype import CcyType
  File "/usr/local/lib/python3.8/dist-packages/okex/v5/ccytype.py", line 3, in <module>
    from typing import TypeAlias, Union
ImportError: cannot import name 'TypeAlias' from 'typing' (/usr/lib/python3.8/typing.py)

已经安装这个包了:

# pip3 list
Package                Version             
---------------------- --------------------          
typing                 3.7.4.3     

要怎么解决呢?

运行run.py报错

运行的时候有报错,报FileNotFoundError: [Errno 2] No such file or directory: 'api.json'

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.