用于为Clash Royale创建族管理仪表板的Python工具
crtools的Python项目详细描述
CRTOOLS-Clash Royale系列仪表板生成器
这是一个创建仪表板的工具,用于在Clashroyale中创建氏族参与。 请参见https://developer.clashroyale.com注册开发人员帐户和 创建一个用于此的api密钥。
有关为gran agrasar(jy8yvv)创建的仪表板示例,请参见:https://agrassar.com/
这个工具是一个静态的站点生成器——它生成静态的HTML、JavaScript, 以及用于呈现仪表板的css。如果你想用这个,你应该设置 在你的网络服务器上每小时运行一次。
安装
这需要机器上的python 3和pip。要安装,请使用
pip3 install crtools
如果安装了旧版本,要升级到最新版本,请运行:
pip3 install -U crtools
语法
用法:
crtools [-h] [--locale LOCALE] [--config CONFIG-FILE] [--api_key KEY] [--clan TAG] [--out PATH] [--favicon PATH] [--clan_logo PATH] [--description PATH] [--canonical_url URL] [--debug] [--version]
- 可选参数:
-h, --help show this help message and exit --locale LOCALE Locale if language other than English is desired (see Other languages/locales). --config FILE configuration file for this app. --api_key KEY API key for developer.clashroyale.com --clan CLAN Clan ID from Clash Royale. If it starts with a ‘#’, clan ID must be quoted. --out PATH Output path for HTML. --favicon PATH Source path for favicon.ico. If provided, we will copy to the output directory. --clan_logo PATH Source path for clan logo PNG. Recommended at least 64x64 pizels. If provided, we will copy to the output directory. --description PATH Source path snippet of HTML to replace the clan description. Should not be a complete HTML document. Sample here: https://github.com/AaronTraas/crtools-agrassar-assets/blob/master/description.html If provided, we will copy to the output directory. --canonical_url URL Canonical URL for this site. Used for setting the rel=canonical link in the web site, as well as generating the robots.txt and sitemap.xml --debug Turns on debug mode --version List the version of crtools.
可选配置文件
crtools在主目录中查找名为.crtools的配置文件
这是一个ini文件。从目前的版本来看,只有一种可能 参数:API U KEY。文件应该如下所示:
[API]# API key provided for your account at https://developer.clashroyale.com# Note that the key is limited to a specific list of public IP addressesapi_key=<YOUR-API-KEY># Your clan tagclan_id=#JY8YVV# Proxy URL -- URL for proxy server, if needed#proxy=https://my-proxy.com# Proxy headers -- custom headers for proxy if needed#proxy_headers=headers[Paths]# your output path. Where you want the static website to live.out=/var/www/html# Path to the logo artwork for clan. Must be PNG. Recommended at# least 64x64 pixels.clan_logo=~/myclan/logo.png# Path to the favicon file you want to use for thisfavicon=~/myclan/favicon.ico# Path to a file that contains arbitrary HTML for the site.description_html=~/myclan/body.html[www]# Canonical URL for this site. Used for setting the rel=canonical# link in the web site, as well as generating the robots.txt# and sitemap.xmlcanonical_url=https://yourclan.com/
有关详细信息,请参见samples/crtools.ini
使用Clashroyale官方风扇套件
此站点的设计可通过以下提供的风扇工具包进行增强: 这里是超级电池。要启用风扇套件的自动下载,请添加:
use_fankit=True
到配置文件的[Paths]
部分。
注意:这需要在你的临时文件夹中有大约5GB的空闲空间 crtools正在运行。下载和提取需要10-15分钟,但仅需 第一次在启用风扇套件的情况下运行。
如果有问题,可以手动安装风扇套件。见 Fan Kit Manual Install Instructions
其他语言/地区
crtools目前支持以下语言:
locale | language |
---|---|
en | English (default) |
fr | French |
cn | Chinese |
如果您想使用英语以外的语言,请添加以下开关 在命令行中:
--locale=fr
上面的例子是法语。使用上面列出的区域设置代码
如果您希望crtools以其他语言提供,请联系 我。我不能自己翻译(我只说英语),但我能 帮你翻译一下。
建议在Linux Web服务器上使用
这个工具是一个静态的站点生成器——它生成静态的HTML、JavaScript,
以及用于呈现仪表板的css。如果你想用这个,你应该设置
它可以使用cron
或类似方法在Web服务器上每小时运行一次。
下面是Linux上的一个安装示例。
假设root将运行脚本:
- 通过PIP安装此应用程序
- 安装nginx或apache
- 查找文档根目录(例如
/var/www/html
) - 按照上面的指定创建
/root/.crtools
文件,并添加 api键(来自https://developer.clashroyale.com),输出路径(来自 文档根)和族标记 - 在crontab中创建以下条目:
0 * * * * crtools
开发链接
该项目使用声纳进行静态分析。分析结果 在SonarCloud。 代码质量和测试覆盖率是一项正在进行的工作。
支架
如果你需要帮助,可以跳到 crtools discord。
请记住,这是一个命令行实用程序,需要一个工作的python 3 环境。它还假设您知道如何将web服务器配置为 在给定的平台上提供html、cron或类似的服务。没有 安装向导、任何类型的图形用户界面等。
贡献者
所有非代码贡献者都列在 CONTRIBUTORS.rst
图像权限
除此存储库中包含的标志外,所有图像都是由 团队,并包含在GPL许可证中。SVG都是在 墨景。
包含的标志来自http://www.famfamfam.com/lab/icons/flags/,其中 截至2019年5月27日没有归属或许可。我们是 解释这意味着这些在公共领域是可用的。
对我们来说,确保整个应用程序 开源的,不受删除请求的限制。我们永远不会 从游戏或任何其他网络属性中提取资产。
或者,crtools可以下载官方的clash royale fan kit并使用 包含的一些内容。这不是默认行为,也不是 由超级单元复制的作品包含在此代码中。
此内容不与 由超级电池批准,超级电池不负责。更多 有关信息,请参见超级单元的风扇内容策略:https://supercell.com/en/fan-content-policy/