python-hearthstone 项目教程
1. 项目的目录结构及介绍
python-hearthstone/
├── github/
│ └── workflows/
├── hearthstone/
│ ├── cardxml/
│ ├── dbf/
│ ├── deckstrings/
│ └── enums/
├── scripts/
├── tests/
├── .editorconfig
├── .gitignore
├── LICENSE
├── README.md
├── setup.cfg
├── setup.py
└── tox.ini
目录结构介绍
- github/workflows/: 包含GitHub Actions的工作流配置文件。
- hearthstone/: 项目的主要代码目录,包含以下子目录:
- cardxml/: 包含CardDefs.xml解析器的代码。
- dbf/: 包含DbfXml解析器的代码。
- deckstrings/: 包含套牌代码编码和解码的代码。
- enums/: 包含Hearthstone枚举类的代码。
- scripts/: 包含项目的脚本文件。
- tests/: 包含项目的测试文件。
- .editorconfig: 编辑器配置文件,用于统一代码风格。
- .gitignore: Git忽略文件配置。
- LICENSE: 项目的MIT许可证文件。
- README.md: 项目的介绍和使用说明。
- setup.cfg: 项目的配置文件。
- setup.py: 项目的安装脚本。
- tox.ini: 用于配置tox测试环境的文件。
2. 项目的启动文件介绍
项目没有明确的“启动文件”,因为它是一个库,而不是一个可执行的应用程序。用户可以通过导入hearthstone
模块来使用其中的功能。例如:
from hearthstone import cardxml, dbf, deckstrings, enums
3. 项目的配置文件介绍
setup.cfg
setup.cfg
是一个配置文件,用于配置Python包的安装和构建过程。它包含以下内容:
[metadata]
name = hearthstone
version = 9.9.0
description = A Hearthstone Python library containing: A CardDefs.xml parser (hearthstone.cardxml), A DbfXml parser (hearthstone.dbf), A deck code encoder and decoder (hearthstone.deckstrings), Hearthstone enums as IntEnum (hearthstone.enums)
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/HearthSim/python-hearthstone
author = Jerome Leclanche
author_email = jerome@leclan.ch
license = MIT
classifiers =
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Topic :: Games/Entertainment
[options]
packages = find:
python_requires = >=3.6
install_requires =
lxml
[options.packages.find]
where = hearthstone
配置文件介绍
- [metadata]: 包含包的元数据,如名称、版本、描述、作者等。
- [options]: 包含包的安装选项,如需要安装的包、Python版本要求等。
- [options.packages.find]: 指定包的搜索路径。
通过这些配置文件,用户可以了解如何安装和使用python-hearthstone
库。