Skip to main content

xutk-tools

课题组(XuLab)独立命令行工具集:零依赖、Python >= 3.8、每个工具都是能单独拷走 直接 python3 <tool>.py 跑的单文件。

与库发行版 xutk 是分开的两个包:xutk 是 Python >= 3.11 的库(import xutk),本包只装命令,不拉任何第三方依赖。

安装 / 运行

# 不安装直接跑(推荐;需要 uv,不需要先建项目)
uvx --from xutk-tools s3-login --export rclone
uvx --from xutk-tools ants-init

# 装成常驻命令(s3-login / ants-init)
uv tool install xutk-tools

# 老环境:pip 也行
pip install xutk-tools

# 拷走即跑:把单文件放进 ~/.local/bin,之后不再需要本包
python -m xutk_tools install s3-login ~/.local/bin

uv run --with xutk-tools s3-login … 等价可行;uvx s3-login 不行——发行版名是 xutk-tools,命令名是 s3-login,名字不一致时必须用 uvx --from xutk-tools。

工具

命令 做什么 文档
s3-login 登录 XuLab S3(Kanidm → STS 短时凭据),默认打印三元组;--export shell/json/rclone/mc/aws/rc 直接把凭据交给具体工具 docs/reference/s3-login.md
ants-init 从 manifest 安装 ANTs 到 $HOME/.ants(并发安全、校验 sha256、原子切换符号链接) docs/reference/ants-init.md

python -m xutk_tools 列出已装工具;python -m xutk_tools <tool> … 直接运行。

单文件契约

每个工具模块必须满足(test/test_contract.py 会逐条检查,CI 拦截):

  • 只 import 标准库,零第三方依赖;拷走单个 .py 即可运行;
  • Python 3.8 语法(ast.parse(..., feature_version=(3, 8)));
  • 导入无副作用;提供 run(argv) -> int(返回退出码,不抛 SystemExit)与 main()(console script 入口)、TOOL_VERSION;
  • 不含内网地址/凭据;公开代码里只允许 login.xulab.ion.ac.cn 与 s3-xulab.ion.ac.cn 两个内网域名(test/test_privacy.py 扫描)。

开发

本包是 xutk 仓库里的 uv workspace 成员:

uv sync --all-packages                 # 装 xutk + xutk-tools
uv run --all-packages pytest           # 含本包的契约测试
uv run ruff check && uv run ty check
uv build --all-packages                # 产出两个发行版的 wheel/sdist

Metadata

Release files for xutk-tools 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xutk-tools 0.1.0
File Size Uploaded Provenance Actions
xutk_tools-0.1.0.tar.gz 28.0 kB Without provenance Details for xutk_tools-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for xutk-tools 0.1.0
File Interpreter ABI Platform Actions
xutk_tools-0.1.0-py3-none-any.whl Python 3 none any Details for xutk_tools-0.1.0-py3-none-any.whl

Total release size: 59.2 kB

Release files / xutk_tools-0.1.0.tar.gz

Download URL xutk_tools-0.1.0.tar.gz
Size 28.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d8273907dc220f910825e09cb5b9329356262b756f8ca2863c8b899235d7cbf1
BLAKE2b-256 checksum
How to use checksums
ca0b214477c83e496fe16433e4ced09a6e994cf00ce7cb4b091f47d473fe010d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Gentoo","version":"2.18","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / xutk_tools-0.1.0-py3-none-any.whl

Download URL xutk_tools-0.1.0-py3-none-any.whl
Size 31.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
efc5fb20604b3fa1e5e5138c82d3ec517f53edd98d434fadcca9535c209ccb56
BLAKE2b-256 checksum
How to use checksums
8734040d881d0eb41ae2b6177d8f2d62e86c3d6fc05ce113461bad5a4edf88ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Gentoo","version":"2.18","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for xutk-tools 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page