OANDA API v20 开源项目教程

OANDA API v20 开源项目教程

oanda-api-v20OANDA REST-V20 API wrapper. Easy access to OANDA's REST v20 API with oandapyV20 package. Checkout the Jupyter notebooks!项目地址:https://gitcode.com/gh_mirrors/oa/oanda-api-v20

1. 项目的目录结构及介绍

oanda-api-v20/
├── examples/
│   ├── account_details.py
│   ├── account_list.py
│   ├── ...
├── oandapyV20/
│   ├── contrib/
│   │   ├── ...
│   ├── endpoints/
│   │   ├── accounts.py
│   │   ├── instruments.py
│   │   ├── ...
│   ├── ...
├── tests/
│   ├── ...
├── .gitignore
├── LICENSE
├── README.md
├── requirements.txt
├── setup.py
  • examples/: 包含使用 OANDA API v20 的示例代码。
  • oandapyV20/: 核心库文件,包含 API 的实现和端点处理。
  • tests/: 包含项目的测试代码。
  • .gitignore: Git 忽略文件。
  • LICENSE: 项目许可证。
  • README.md: 项目说明文档。
  • requirements.txt: 项目依赖文件。
  • setup.py: 项目安装脚本。

2. 项目的启动文件介绍

项目的启动文件通常是 examples/ 目录下的示例代码。例如,account_details.py 是一个典型的启动文件,用于获取账户详情。

from oandapyV20 import API
import oandapyV20.endpoints.accounts as accounts

accountID = "YOUR_ACCOUNT_ID"
api = API(access_token="YOUR_ACCESS_TOKEN")

r = accounts.AccountDetails(accountID)
api.request(r)
print(r.response)

3. 项目的配置文件介绍

项目的配置文件主要是 setup.pyrequirements.txt

  • setup.py: 用于安装项目的脚本,包含项目的元数据和依赖项。
from setuptools import setup, find_packages

setup(
    name="oandapyV20",
    version="0.6.3",
    packages=find_packages(),
    install_requires=[
        "requests",
    ],
    author="Tor Dahl",
    author_email="tordahl@gmail.com",
    description="A python wrapper for the OANDA v20 API",
    license="MIT",
    keywords="oanda forex trading api",
    url="https://github.com/hootnot/oanda-api-v20",
)
  • requirements.txt: 列出了项目运行所需的依赖项。
requests==2.25.1

通过这些配置文件,可以确保项目在不同环境中的一致性和可重复性。

oanda-api-v20OANDA REST-V20 API wrapper. Easy access to OANDA's REST v20 API with oandapyV20 package. Checkout the Jupyter notebooks!项目地址:https://gitcode.com/gh_mirrors/oa/oanda-api-v20

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

倪澄莹George

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值