V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
wgwang
V2EX  ›  Python

shell 看股票小程序

  •  
  •   wgwang · 2015-01-27 17:45:30 +08:00 · 5286 次点击
    这是一个创建于 3371 天前的主题,其中的信息可能已经有所发展或是发生改变。

    python写的, 运行需安装requests库, 带颜色显示.

    程序: https://raw.githubusercontent.com/wgwang/quant/master/tools/sinaStock.py

    欢迎fork&pull, 一起搞个好用的工具: https://github.com/wgwang/quant

    另外还有A股相关的接口可以用?

    9 条回复    2015-01-28 23:15:47 +08:00
    ob
        2
    ob  
       2015-01-27 23:11:37 +08:00
    @august 数据有多少?包括所有历史数据?
    wgwang
        3
    wgwang  
    OP
       2015-01-27 23:12:57 +08:00
    @august 搞定了, 代码在github上
    wgwang
        4
    wgwang  
    OP
       2015-01-27 23:15:21 +08:00
    @wgwang

    使用样例:

    python3 sinaStock.py sz000001 sh000001
    python3 yahooStock.py 000001.sz appl
    codepiano
        5
    codepiano  
       2015-01-27 23:39:26 +08:00
    雅虎的数据不全,一些太新的股没数据
    geeklian
        6
    geeklian  
       2015-01-28 00:09:12 +08:00
    雅虎新浪更新都太慢了=.=
    要想方设法从大智慧/同花顺这些程序里读才行。
    august
        8
    august  
       2015-01-28 09:56:04 +08:00
    @geeklian
    @wgwang
    @codepiano

    其實還可以用騰訊的,騰訊的主要是港股也能實時,雖然沒有 API.

    http://data.gtimg.cn/flashdata/hk/minute/hk00700.js
    codepiano
        9
    codepiano  
       2015-01-28 23:15:47 +08:00
    @august 目前发现的免费历史数据只有雅虎一家,不过太新的股没数据,还有人说雅虎的复权数据不对,这个没验证过,存疑
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1904 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 16:20 · PVG 00:20 · LAX 09:20 · JFK 12:20
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.