Skip to main content

jh finance data provider sdk

Project description

banner

jh_data

jh_data是一个免费,高性能,简洁易用的金融数据获取框架。

亮点

  • 丰富的数据源:兼容akshare和tushare多种数据类型,支持获取A股、基金、宏观等数据
  • 统一的数据接口:通过 DataTypes 枚举类统一管理数据类型,输出字段名标准化为英文字段名
  • 多时间颗粒度支持:支持日、周、月级别数据,以及分钟级实时数据
  • 多数据接口兼容:支持 JHData、akshare、tushare 三种接口方式
  • 易于扩展:支持自定义数据源
  • MCP Server 支持:可作为 MCP 服务器运行,AI Agent 可通过标准协议调用

快速开始

安装

uv安装(推荐)

uv add jh-data
# 或者uv pip install -U jh-data

pip安装

pip install -U jh-data

数据获取

jh_data 支持三种数据获取方式:

方式一:JHData 直接获取

from jh_data.data import JHData, DataTypes

jh = JHData()

# 获取股票日线数据(前复权)
stock_price = jh.get_data(
    DataTypes.AK_STOCK_ZH_A_HIST_QFQ,
    symbol="000001",
    start="2025-01-01",
    end="2025-01-10",
)
print(stock_price)

方式二:akshare 兼容接口

from jh_data.data_providers import akshare as ak

# akshare 风格:使用 start_date/end_date/adjust 参数
stock_price = ak.stock_zh_a_hist(
    symbol="000001",
    start_date="20250101",
    end_date="20250110",
    adjust="qfq"
)
print(stock_price)

方式三:tushare 兼容接口

from jh_data.data_providers import tushare as ts

# tushare 风格:使用 ts_code/start_date/end_date 参数
daily_data = ts.daily(
    ts_code="000001.SZ",
    start_date="20250101",
    end_date="20250110"
)
print(daily_data)

License

This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.

Project details


Download files

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

Source Distribution

jh_fin_data-0.1.3.tar.gz (84.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jh_fin_data-0.1.3-py3-none-any.whl (83.4 kB view details)

Uploaded Python 3

File details

Details for the file jh_fin_data-0.1.3.tar.gz.

File metadata

  • Download URL: jh_fin_data-0.1.3.tar.gz
  • Upload date:
  • Size: 84.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for jh_fin_data-0.1.3.tar.gz
Algorithm Hash digest
SHA256 cdbbe6e12a070c039a989c98c60db6c87daa390db4ce34b561c7735aecbdb58d
MD5 8cfd0ef1702e5d4e1cdeb117ed4d6717
BLAKE2b-256 24b435c0a8f36635b4e5967f01b94acd28723d0e3e29a70213054dd196d7a6c7

See more details on using hashes here.

File details

Details for the file jh_fin_data-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for jh_fin_data-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e8f962f6e08906dc2d50cfa221c3732ae6cbda6e017352315c45f178f84be49e
MD5 a2b12cb3354146c3ff2257a4480a74c6
BLAKE2b-256 c0994946bfc04c51daa84898fd80ab81eb4c8099c6db48dfb57f0d3db36cff6d

See more details on using hashes here.

Supported by

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