Code Monkey home page Code Monkey logo

dataapi's Introduction

DataApi

标准数据API定义。

安装步骤

1、安装Python环境

如果本地还没有安装Python环境,强烈建议安装 Anaconda

打开上面的网址,选择相应的操作系统,确定要按照的Python版本,一般建议用Python 2.7。

下载完成以后,按照图形界面步骤完成安装。在默认情况下,Anaconda会自动设置PATH环境。

2、安装依赖包

如果Python环境不是类似Anaconda的集成开发环境,我们需要单独安装依赖包,在已经有pandas/numpy包前提下,还需要有以下几个包:

  • pyzmq
  • msgpack_python
  • python-snappy

可以通过单个安装完成,例如: pip install pyzmq

需要注意的是,python-snappy这个包在Windows上的安装需要比较多的编译依赖,建议从这个网页下载编译好的包,然后安装:

pip install python_snappy-0.5.1-cp27-cp27m-win_amd64.whl

3、使用DataApi

from .data_api import DataApi  # 这里假设工作目录是项目根目录

api = DataApi(addr="tcp://data.tushare.org:8910")
result, msg = api.login("username", "password") # 示例账户,用户需要改为自己在www.quantos.org上注册的账户
print(result)
print(msg)

dataapi's People

Contributors

quantosorg avatar pkujohnson avatar

Watchers

James Cloos avatar  avatar

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.