Regular Python (repy) 🐍
一个专为Windows优化的Python通配符执行工具,弥补原生shell不支持
python /*/tar*get.py的不足,支持多级目录匹配操作。
仅支持Windows环境
让Python通配符执行像呼吸一样自然 🌟
✨ 功能特性
- 通配符解析
- 支持
*.py、src/**/test_*.py等复杂模式 - 自动转换为正则表达式,适配Windows大小写不敏感文件系统
- 支持
- 多层级递归匹配
- 通过
--rp-allow-multiple允许*跨多级目录匹配
- 通过
- 无缝参数传递
- 支持向被运行脚本传递参数(如
-- args)
- 支持向被运行脚本传递参数(如
📦 安装
通过PyPI安装
pip install stv_repy
从源码安装
git clone https://github.com/StarWindv/regular-python.git
cd regular-python
pip install .
🚀 使用指南
基本命令
repy [--rp-选项] <路径模式> [-- Python参数]
主要参数说明
| 选项 | 说明 |
|---|---|
-rh, --rp-help |
显示帮助信息 |
-ram, --rp-allow-multiple |
允许多级通配符(如**/*.py) |
示例
1. 执行当前目录所有Python文件
repy *.py
2. 多级目录匹配测试文件
repy --rp-allow-multiple tests/**/*_test.py args
3. 跨盘符匹配并传递参数
repy D:/*/*/*/target.py args
4. 显示帮助信息
repy --rp-help
5. 向Python解释器和脚本同时传参
repy D:/*/*/*/target.py script_args -- python_args
⚠️ 注意事项
-
路径空格处理
若路径含空格,需用双引号包裹(如"My Project/*.py")。 -
性能提示
深层目录匹配(如**/*.py)因设备原因可能较慢,建议结合具体层级限制。 -
特殊字符转义
尽可能避免在路径模式中使用特殊符号,或手动转义。
🤝 贡献指南
欢迎提交Issue或PR! 希望您能完善正则匹配模式!
📜 许可证
MIT License © 2025 StarWindv (星灿长风v)
📧 联系作者:starwindv.stv@gmail.com
Metadata
Release files for stv-repy 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| stv_repy-0.0.3.tar.gz | 9.4 kB | Without provenance | Details for stv_repy-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| stv_repy-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for stv_repy-0.0.3-py3-none-any.whl |
Total release size: 19.4 kB
Release files / stv_repy-0.0.3.tar.gz
| Download URL | stv_repy-0.0.3.tar.gz |
|---|---|
| Size | 9.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c17865a9d50d8c83a2fa8d7ca81144cdd08b208a24c21265ea118f1953cb2cbb
|
|
BLAKE2b-256 checksum How to use checksums |
18762e3dcd58cd2aa0d1c1db7924a5779cf1819d545cf423da3c8e71ef14df55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.1
|
Release files / stv_repy-0.0.3-py3-none-any.whl
| Download URL | stv_repy-0.0.3-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
183043ae75560bb4cfae861036f0a4ffa41dda0efb0be94b1a44d1236a7230f5
|
|
BLAKE2b-256 checksum How to use checksums |
9e8789f03bebcf6df3be62405f0a0bdfe8010f67c5f57ff733c4456cdb6f4a32
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.1
|
Security for stv-repy 0.0.3
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.