跳转到主要内容

DBnomics Python客户端

项目描述

DBnomics Python客户端

从DBnomics下载时间序列并将其作为Pandas DataFrame访问。

此软件包与Python >= 3.8兼容。(待定vermin)

文档

快速入门

教程

一个教程,展示了如何将系列作为DataFrame下载并绘制,可作为一个笔记本获取。

安装

pip install dbnomics

另请参阅: https://pypi.ac.cn/project/DBnomics/

配置

使用代理

此Python软件包使用requests,它能够与代理(HTTP/HTTPS、SOCKS)一起工作。有关更多信息,请参阅其文档

自定义API基本URL

如果您计划使用运行在端口5000上的本地Web API,您需要使用fetch_*函数的api_base_url参数,如下所示

df = fetch_series(
    api_base_url='http://localhost:5000',
    provider_code='AMECO',
    dataset_code='ZUTN',
)

或者全局更改由dbnomics模块使用的默认API URL,如下所示

import dbnomics
dbnomics.default_api_base_url = "http://localhost:5000"

开发

要处理dbnomics-python-client源代码

git clone https://git.nomics.world/dbnomics/dbnomics-python-client.git
cd dbnomics-python-client
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install -e .

打开演示笔记本

如果尚未完成,请在一个虚拟环境中安装jupyter

pip install jupyter
jupyter notebook index.ipynb

测试

pip install -r requirements.txt
pip install -r requirements-test.txt
pip install -e .

pytest

# Specify an alternate API URL
API_URL=http://localhost:5000 pytest

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源代码分发

dbnomics-1.2.5.tar.gz (46.1 kB 查看哈希值)

上传时间 源代码

构建分发

dbnomics-1.2.5-py3-none-any.whl (32.1 kB 查看哈希值)

上传时间 Python 3

由以下支持