empyrical 项目使用教程

empyrical 项目使用教程

empyricalCommon financial risk and performance metrics. Used by zipline and pyfolio.项目地址:https://gitcode.com/gh_mirrors/em/empyrical

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

empyrical 项目的目录结构如下:

empyrical/
├── docs/
│   ├── conf.py
│   ├── index.rst
│   └── ...
├── empyrical/
│   ├── __init__.py
│   ├── core.py
│   ├── stats.py
│   └── ...
├── tests/
│   ├── test_core.py
│   ├── test_stats.py
│   └── ...
├── .gitattributes
├── .gitignore
├── LICENSE
├── MANIFEST.in
├── README.md
├── setup.cfg
├── setup.py
└── versioneer.py

目录介绍:

  • docs/: 包含项目的文档文件,如 conf.pyindex.rst 等。
  • empyrical/: 项目的主要代码目录,包含核心功能模块如 core.pystats.py 等。
  • tests/: 包含项目的测试文件,如 test_core.pytest_stats.py 等。
  • .gitattributes, .gitignore: Git 配置文件。
  • LICENSE: 项目的许可证文件。
  • MANIFEST.in: 用于打包的清单文件。
  • README.md: 项目说明文档。
  • setup.cfg, setup.py: 用于项目安装和打包的配置文件。
  • versioneer.py: 用于版本管理的脚本。

2. 项目的启动文件介绍

empyrical 项目的启动文件主要是 setup.py。这个文件包含了项目的安装和打包配置,通过运行 python setup.py install 可以安装项目。

# setup.py
from setuptools import setup, find_packages
import versioneer

setup(
    name='empyrical',
    version=versioneer.get_version(),
    cmdclass=versioneer.get_cmdclass(),
    description='Common financial risk metrics',
    url='https://github.com/quantopian/empyrical',
    author='Quantopian Inc',
    author_email='opensource@quantopian.com',
    license='Apache 2.0',
    packages=find_packages(),
    install_requires=[
        'numpy>=1.11.1',
        'pandas>=0.18.1',
    ],
    classifiers=[
        'Development Status :: 4 - Beta',
        'Intended Audience :: Science/Research',
        'License :: OSI Approved :: Apache Software License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Topic :: Scientific/Engineering :: Mathematics',
    ],
)

3. 项目的配置文件介绍

empyrical 项目的配置文件主要包括 setup.cfgdocs/conf.py

setup.cfg

setup.cfg 文件包含了项目的安装和打包配置,如测试命令和文档生成命令等。

# setup.cfg
[metadata]
name = empyrical
version = attr: empyrical.__version__
description = Common financial risk metrics
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/quantopian/empyrical
author = Quantopian Inc
author_email = opensource@quantopian.com
license = Apache 2.0
classifiers =
    Development Status :: 4 - Beta
    Intended Audience :: Science/Research
    License :: OSI Approved :: Apache Software License
    Operating System :: OS Independent
    Programming Language :: Python
    Programming Language :: Python :: 2
    Programming Language :: Python :: 2.7
    Programming Language :: Python :: 3
    Programming Language :: Python :: 3.4
    Programming Language :: Python :: 3.5
    Topic :: Scientific/Engineering :: Mathematics

[options]
packages = find:
install_requires =
    numpy>=1.11.1
    pandas>=0.18.1

[options.packages.find]

empyricalCommon financial risk and performance metrics. Used by zipline and pyfolio.项目地址:https://gitcode.com/gh_mirrors/em/empyrical

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

时翔辛Victoria

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

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

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

打赏作者

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

抵扣说明:

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

余额充值