Skip to main content
=====================

.. image:: https://api.travis-ci.org/GuQiangJS/finance-datareader-py.svg?branch=master
:target: https://travis-ci.org/GuQiangJS/finance-datareader-py

.. image:: https://coveralls.io/repos/github/GuQiangJS/finance-datareader-py/badge.svg?branch=master
:target: https://coveralls.io/github/GuQiangJS/finance-datareader-py?branch=master



基于 ``pandas-datareader`` 开发,用来读取 上证、深证(股票列表、每日成交汇总)

依赖
~~~~~

使用 finance-datareader-py 依赖于以下包:

* xlrd
* pandas-datareader
* numpy
* beautifulsoup4

编译帮助文档时使用:

* sphinx
* sphinxcontrib-napoleon

快速安装
~~~~~~~~

安装发布版本
------------

.. code-block:: shell

$ pip install finance-datareader-py

安装开发版本
------------

.. code-block:: shell

$ pip install git+https://github.com/GuQiangJS/finance-datareader-py.git

文档
~~~~

`开发文档 <https://guqiangjs.github.io/finance-datareader-py/devel/>`__

使用示例
~~~~~~~~

* 一次获取多支股票的收盘价。并自动填充停牌数据。

.. code-block:: python

>>> from finance_datareader_py import DailyReader
>>> df = DailyReader((601398,601939), drop_zs_columns=False).read()
>>> print(df.tail())

sh000001_Close 601398_Close 601939_Close
Date
2018-08-17 2668.97 5.26 6.52
2018-08-20 2698.47 5.36 6.66
2018-08-21 2733.83 5.40 6.72
2018-08-22 2714.61 5.39 6.70
2018-08-23 2724.62 5.40 6.69

* 获取上证股票列表

.. code-block:: python

>>> from finance_datareader_py.sse import get_sse_symbols
>>> print(get_sse_symbols().tail())

name symbol
1425 洛阳钼业 603993
1426 中新科技 603996
1427 继峰股份 603997
1428 方盛制药 603998
1429 读者传媒 603999

* 读取上市公司主要财务指标

.. code-block:: python

>>> from finance_datareader_py.sohu import FinancialIndicatorReader
>>> df = FinancialIndicatorReader('601398').read()
>>> print(df.iloc[0][:-1])

净资产收益率加权(%) 3.85
股东权益不含少数股东权益(万元) 217151000
流动负债(万元) --
总负债(万元) 2430887600
流动资产(万元) --
总资产(万元) 2649378100
现金及现金等价物净增加额(万元) -5756000
经营活动产生的现金流量净额(万元) 6216000
净利润(扣除非经常性损益后)(万元) 7779500
净利润(万元) 7880200
利润总额(万元) 10164600
营业外收支净额(万元) 136000
投资收益(万元) 267800
营业利润(万元) 10028600
主营业务利润(万元) 10028600
主营业务收入(万元) 19719800
每股经营活动产生的现金流量净额(元) --
每股净资产(元) 5.85
Name: 2018-03-31 00:00:00, dtype: object

Home-page: https://github.com/GuQiangJS/finance-datareader-py.git
Author: GuQiangJS
Author-email: guqiangjs@gmail.com
License: Apache License 2.0
Description: Python 金融数据读取器
=====================

.. image:: https://api.travis-ci.org/GuQiangJS/finance-datareader-py.svg?branch=master
:target: https://travis-ci.org/GuQiangJS/finance-datareader-py

.. image:: https://coveralls.io/repos/github/GuQiangJS/finance-datareader-py/badge.svg?branch=master
:target: https://coveralls.io/github/GuQiangJS/finance-datareader-py?branch=master



基于 ``pandas-datareader`` 开发,用来读取 上证、深证(股票列表、每日成交汇总)

依赖
~~~~~

使用 finance-datareader-py 依赖于以下包:

* xlrd
* pandas-datareader
* numpy
* beautifulsoup4

编译帮助文档时使用:

* sphinx
* sphinxcontrib-napoleon

快速安装
~~~~~~~~

安装发布版本
------------

.. code-block:: shell

$ pip install finance-datareader-py

安装开发版本
------------

.. code-block:: shell

$ pip install git+https://github.com/GuQiangJS/finance-datareader-py.git

文档
~~~~

`开发文档 <https://guqiangjs.github.io/finance-datareader-py/devel/>`__

使用示例
~~~~~~~~

* 一次获取多支股票的收盘价。并自动填充停牌数据。

.. code-block:: python

>>> from finance_datareader_py import DailyReader
>>> df = DailyReader((601398,601939), drop_zs_columns=False).read()
>>> print(df.tail())

sh000001_Close 601398_Close 601939_Close
Date
2018-08-17 2668.97 5.26 6.52
2018-08-20 2698.47 5.36 6.66
2018-08-21 2733.83 5.40 6.72
2018-08-22 2714.61 5.39 6.70
2018-08-23 2724.62 5.40 6.69

* 获取上证股票列表

.. code-block:: python

>>> from finance_datareader_py.sse import get_sse_symbols
>>> print(get_sse_symbols().tail())

name symbol
1425 洛阳钼业 603993
1426 中新科技 603996
1427 继峰股份 603997
1428 方盛制药 603998
1429 读者传媒 603999

* 读取上市公司主要财务指标

.. code-block:: python

>>> from finance_datareader_py.sohu import FinancialIndicatorReader
>>> df = FinancialIndicatorReader('601398').read()
>>> print(df.iloc[0][:-1])

净资产收益率加权(%) 3.85
股东权益不含少数股东权益(万元) 217151000
流动负债(万元) --
总负债(万元) 2430887600
流动资产(万元) --
总资产(万元) 2649378100
现金及现金等价物净增加额(万元) -5756000
经营活动产生的现金流量净额(万元) 6216000
净利润(扣除非经常性损益后)(万元) 7779500
净利润(万元) 7880200
利润总额(万元) 10164600
营业外收支净额(万元) 136000
投资收益(万元) 267800
营业利润(万元) 10028600
主营业务利润(万元) 10028600
主营业务收入(万元) 19719800
每股经营活动产生的现金流量净额(元) --
每股净资产(元) 5.85
Name: 2018-03-31 00:00:00, dtype: object

Keywords: data
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Topic :: Scientific/Engineering

Release files for finance-datareader-py 0.2.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for finance-datareader-py 0.2.10
File Size Uploaded
finance-datareader-py-0.2.10.tar.gz 53.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for finance-datareader-py 0.2.10
File Interpreter ABI Platform
finance_datareader_py-0.2.10-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 118.3 kB

Release files / finance-datareader-py-0.2.10.tar.gz

Download URL finance-datareader-py-0.2.10.tar.gz
Size 53.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e2d125486f0f953f99411f08f7cdb2acf3fde266523cb4618c5e9d4251aa4df1
BLAKE2b-256 checksum
How to use checksums
04b8b823417f1229f90c907f26790b2a3f2f50416f2555b9fbcb9b07c54ae588
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5

Release files / finance_datareader_py-0.2.10-py2.py3-none-any.whl

Download URL finance_datareader_py-0.2.10-py2.py3-none-any.whl
Size 64.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
e2239542fcce8410a33938011330697e57e190ac3ff77115d295f404c8f5d91b
BLAKE2b-256 checksum
How to use checksums
47a566a19e2a03eb52b89d76d7aa23564c8690402fe79abfbb5f98d03f03d26b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5

Release history Release notifications | RSS feed

This release

0.2.10 This release

2 release files

0.1.9

2 release files

0.1.8

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page