Python工具,旨在根据指定的令牌限制重新组织大型Python项目为精简文件。这对于处理大型Python项目,特别是与GPT模型一起处理时非常有用,因为它允许模型以可管理的块处理数据。
项目描述
split_python4gpt
split_python4gpt
是一个Python工具,旨在根据指定的令牌限制重新组织大型Python项目为精简文件。这对于处理大型Python项目,特别是与GPT模型一起处理时非常有用,因为它允许模型以可管理的块处理数据。
版本 1.0.3 (2023-06-22)
尚未实现
警告:代码尚未实现分割或令牌计数,仅实现了类型推断和精简。使用风险自负。
安装
您可以通过pip安装 split_python4gpt
pip install split_python4gpt
CLI使用
安装后,您可以使用 pysplit4gpt
或 python3.10 -m split_python4gpt
命令
python3.10 -m split_python4gpt PATH_OR_FOLDER [FLAGS]
POSITIONAL ARGUMENTS
PATH_OR_FOLDER
Type: str | pathlib.Path
Path to the input Python file or folder.
FLAGS
-o, --out=OUT
Type: Optional[str | pathlib...
Default: None
Output folder for the processed files. Defaults to input folder.
-p, --pyis=PYIS
Type: Optional[str | pathlib...
Default: None
Directory for storing generated .pyi files. Defaults to the output folder.
-t, --types=TYPES
Type: bool
Default: True
Infer types using PyType? Defaults to True.
--mini=MINI
Type: bool
Default: True
Minify the Python scripts? Defaults to True.
--mini_docs=MINI_DOCS
Type: bool
Default: True
Remove docstrings? Defaults to True.
--mini_globs=MINI_GLOBS
Type: bool
Default: False
Rename global names? Defaults to False.
--mini_locs=MINI_LOCS
Type: bool
Default: False
Rename local names? Defaults to False.
--mini_lits=MINI_LITS
Type: bool
Default: True
Hoist literal statements? Defaults to True.
--mini_annotations=MINI_ANNOTATIONS
Type: bool
Default: True
Remove annotations? Defaults to True.
--mini_asserts=MINI_ASSERTS
Type: bool
Default: True
Remove asserts? Defaults to True.
--mini_debug=MINI_DEBUG
Type: bool
Default: True
Remove debugging statements? Defaults to True.
--mini_imports=MINI_IMPORTS
Type: bool
Default: True
Combine imports? Defaults to True.
--mini_obj=MINI_OBJ
Type: bool
Default: True
Remove object base? Defaults to True.
--mini_pass=MINI_PASS
Type: bool
Default: True
Remove pass statements? Defaults to True.
--mini_posargs=MINI_POSARGS
Type: bool
Default: True
Convert positional to keyword args? Defaults to True.
--mini_retnone=MINI_RETNONE
Type: bool
Default: True
Remove explicit return None statements? Defaults to True.
--mini_shebang=MINI_SHEBANG
Type: bool
Default: True
Remove shebang? Defaults to True.
Python使用
- 查看API文档 以获取更多高级用法
变更日志
- v1.0.0: 初始发布
贡献
欢迎为 split_python4gpt
做出贡献!请在 GitHub 仓库 上提交问题或拉取请求。
许可协议
- 版权所有 (c) 2023 Adam Twardoch
- 在 ChatGPT 的协助下编写
- 基于 Apache License 2.0 许可
项目详情
下载文件
下载适用于您平台文件的文件。如果您不确定选择哪一个,请了解更多关于 安装包 的信息。
源代码发行版
split_python4gpt-1.0.3.tar.gz (15.1 kB 查看哈希值)
构建发行版
split_python4gpt-1.0.3-py3-none-any.whl (10.2 kB 查看哈希值)
关闭
split_python4gpt-1.0.3.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | ad0c6c08fa557ebcb275b28a86c0b7ad5f3300e2ea3a5c8d8051d26a706a6b6a |
|
MD5 | f30c23f67af68df122f725713422fe49 |
|
BLAKE2b-256 | fe3049802f408e1603f37349a5e9d9bf7fee83120cd3681a26664f01e8b8fd7e |
关闭
split_python4gpt-1.0.3-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 685c66870a0d4149950de006b256ecef172bd51a4c60cf05791ddb9d5e488ca7 |
|
MD5 | a44a139feec3200b35b9ac1f7f825d22 |
|
BLAKE2b-256 | efa600969e8e022e017d129dc3ece1c1b3029fa59ccd18a3bf4d0ba8abab9d38 |