Versifier: A lyrical tool to transform Python requirements into Poetry configurations, effortlessly and elegantly.
Project description
versifier
Overview
这个项目提供了一套命令行工具集,主要用于处理 Python 项目的依赖管理。主要功能包括:
- 将 requirements.txt 转化为 Poetry 的 pyproject.toml
- 将 Poetry 的 pyproject.toml 导出为 requirements.txt
- 将私有包提取到指定目录
Installation
使用 pip 来安装这个项目:
pip install versifier
Commands
requirements-to-poetry
将 requirements 转换为 poetry。
versifier requirements-to-poetry --requirements <requirements_files> --dev-requirements <dev_requirements_files> --exclude <exclude_packages> --add-only --config <config_file> --root <root_dir> --poetry-path <path_to_poetry> --nuitka-path <path_to_nuitka3> --log-level <log_level>
参数说明:
-R, --requirements: 指定 requirements 文件。默认为当前目录的 requirements.txt。-d, --dev-requirements: 指定开发环境的 requirements 文件。默认为当前目录的 dev-requirements.txt。-e, --exclude: 指定要排除的包。--add-only: 只添加指定的包,而不删除任何现有的包。-c, --config: 指定配置文件。-r, --root: 指定根目录。默认为当前目录。--poetry-path: 指定 poetry 的路径。默认为 "poetry"。--nuitka-path: 指定 nuitka3 的路径。默认为 "nuitka3"。--log-level: 指定日志级别。
poetry-to-requirements
将 poetry 转换为 requirements。
versifier poetry-to-requirements --output <output_file> --exclude-specifiers --include-comments --include-dev-requirements --extra-requirements <extra_requirements> --markers <markers> --private-packages <private_packages> --config <config_file> --root <root_dir> --poetry-path <path_to_poetry> --nuitka-path <path_to_nuitka3> --log-level <log_level>
参数说明:
-o, --output: 指定输出文件。--exclude-specifiers: 排除指定的包。--include-comments: 包含注释。-d, --include-dev-requirements: 包含开发环境的 requirements。-E, --extra-requirements: 指定额外的 requirements。-m, --markers: 指定标记。-P, --private-packages: 指定私有包。-c, --config: 指定配置文件。-r, --root: 指定根目录。默认为当前目录。--poetry-path: 指定 poetry 的路径。默认为 "poetry"。--nuitka-path: 指定 nuitka3 的路径。默认为 "nuitka3"。--log-level: 指定日志级别。
extract-private-packages
提取私有包。
versifier extract-private-packages --output <output_dir> --extra-requirements <extra_requirements> --exclude-file-patterns <exclude_files> --private-packages <private_packages> --config <config_file> --root <root_dir> --poetry-path <path_to_poetry> --nuitka-path <path_to_nuitka3> --log-level <log_level>
参数说明:
-o, --output: 指定输出目录。默认为当前目录。-E, --extra-requirements: 指定额外的 requirements。--exclude-file-patterns: 指定要排除的文件模式。-P, --private-packages: 指定要提取的私有包列表。-c, --config: 指定配置文件。-r, --root: 指定根目录。默认为当前目录。--poetry-path: 指定 poetry 的路径。默认为 "poetry"。--nuitka-path: 指定 nuitka3 的路径。默认为 "nuitka3"。--log-level: 指定日志级别。
obfuscate-project-dirs
混淆项目目录。
versifier obfuscate-project-dirs --output <output_dir> --sub-dirs <included_sub_dirs> --exclude-packages <exclude_packages> --config <config_file> --root <root_dir> --poetry-path <path_to_poetry> --nuitka-path <path_to_nuitka3> --log-level <log_level>
参数说明:
-o, --output: 指定输出目录。默认为当前目录。-d, --sub-dirs: 指定要包含的子目录。--exclude-packages: 指定要排除的包。-c, --config: 指定配置文件。-r, --root: 指定根目录。默认为当前目录。--poetry-path: 指定 poetry 的路径。默认为 "poetry"。--nuitka-path: 指定 nuitka3 的路径。默认为 "nuitka3"。--log-level: 指定日志级别。
obfuscate-private-packages
混淆私有包。
versifier obfuscate-private-packages --output <output_dir> --extra-requirements <extra_requirements> --private-packages <private_packages> --config <config_file> --root <root_dir> --poetry-path <path_to_poetry> --nuitka-path <path_to_nuitka3> --log-level <log_level>
参数说明:
-o, --output: 指定输出目录。默认为当前目录。-E, --extra-requirements: 指定额外的 requirements。-P, --private-packages: 指定要混淆的私有包列表。-c, --config: 指定配置文件。-r, --root: 指定根目录。默认为当前目录。--poetry-path: 指定 poetry 的路径。默认为 "poetry"。--nuitka-path: 指定 nuitka3 的路径。默认为 "nuitka3"。--log-level: 指定日志级别。
License
此项目使用 MIT 许可证。有关详细信息,请参阅 LICENSE 文件。
Contributing
我们欢迎各种形式的贡献,包括报告问题、提出新功能、改进文档或提交代码更改。如果你想要贡献,请查看 CONTRIBUTING.md 获取更多信息。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file versifier-0.3.3.tar.gz.
File metadata
- Download URL: versifier-0.3.3.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.15 CPython/3.6.10 Darwin/24.0.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b19040c084938ec3d7dd4d33fbc73a13daafeb43f81ca4c80ae60ca8bb4e525d
|
|
| MD5 |
77dca55185ab420ae74946af9c7de9ce
|
|
| BLAKE2b-256 |
f6fcebf4abe332d4e614c7f157a6c7f4c3d4b6372dd594b2faf5a77782b1b3ff
|
File details
Details for the file versifier-0.3.3-py3-none-any.whl.
File metadata
- Download URL: versifier-0.3.3-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.15 CPython/3.6.10 Darwin/24.0.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0990ec787245452028c2b209491dbdfec9c99f18cebf8b31598a877670f40f3e
|
|
| MD5 |
ab0ccb792b0048c1ddfb212c90abb539
|
|
| BLAKE2b-256 |
539679703f747240a9bb037da60d72956c0c8398260e6d0b26c65fd94b6ad633
|