versifier


Nameversifier JSON
Version 0.3.1 PyPI version JSON
download
home_pagehttps://github.com/mrlyc/versifier
SummaryVersifier: A lyrical tool to transform Python requirements into Poetry configurations, effortlessly and elegantly.
upload_time2024-08-08 02:39:37
maintainerNone
docs_urlNone
authorMrLYC
requires_python<4.0,>=3.6.2
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # versifier

[![Release](https://img.shields.io/github/v/release/mrlyc/versifier)](https://img.shields.io/github/v/release/mrlyc/versifier)
[![Build status](https://img.shields.io/github/actions/workflow/status/mrlyc/versifier/main.yml?branch=main)](https://github.com/mrlyc/versifier/actions/workflows/main.yml?query=branch%3Amain)
[![codecov](https://codecov.io/gh/mrlyc/versifier/branch/main/graph/badge.svg)](https://codecov.io/gh/mrlyc/versifier)
[![Commit activity](https://img.shields.io/github/commit-activity/m/mrlyc/versifier)](https://img.shields.io/github/commit-activity/m/mrlyc/versifier)
[![License](https://img.shields.io/github/license/mrlyc/versifier)](https://img.shields.io/github/license/mrlyc/versifier)

## Overview

这个项目提供了一套命令行工具集,主要用于处理 Python 项目的依赖管理。主要功能包括:
- 将 requirements.txt 转化为 Poetry 的 pyproject.toml
- 将 Poetry 的 pyproject.toml 导出为 requirements.txt
- 将私有包提取到指定目录

## Installation

使用 pip 来安装这个项目:

```shell
pip install versifier
```

## Commands
### requirements-to-poetry

将 requirements 转换为 poetry。

```bash
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。

```bash
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

提取私有包。

```bash
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

混淆项目目录。

```bash
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

混淆私有包。

```bash
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 获取更多信息。
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/mrlyc/versifier",
    "name": "versifier",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.6.2",
    "maintainer_email": null,
    "keywords": null,
    "author": "MrLYC",
    "author_email": "fx@m.mrlyc.com",
    "download_url": "https://files.pythonhosted.org/packages/e5/81/0a4e8bd0c3523183581951ce5a30f18f98ea0c3b0f09f658e6a23b3af5a6/versifier-0.3.1.tar.gz",
    "platform": null,
    "description": "# versifier\n\n[![Release](https://img.shields.io/github/v/release/mrlyc/versifier)](https://img.shields.io/github/v/release/mrlyc/versifier)\n[![Build status](https://img.shields.io/github/actions/workflow/status/mrlyc/versifier/main.yml?branch=main)](https://github.com/mrlyc/versifier/actions/workflows/main.yml?query=branch%3Amain)\n[![codecov](https://codecov.io/gh/mrlyc/versifier/branch/main/graph/badge.svg)](https://codecov.io/gh/mrlyc/versifier)\n[![Commit activity](https://img.shields.io/github/commit-activity/m/mrlyc/versifier)](https://img.shields.io/github/commit-activity/m/mrlyc/versifier)\n[![License](https://img.shields.io/github/license/mrlyc/versifier)](https://img.shields.io/github/license/mrlyc/versifier)\n\n## Overview\n\n\u8fd9\u4e2a\u9879\u76ee\u63d0\u4f9b\u4e86\u4e00\u5957\u547d\u4ee4\u884c\u5de5\u5177\u96c6\uff0c\u4e3b\u8981\u7528\u4e8e\u5904\u7406 Python \u9879\u76ee\u7684\u4f9d\u8d56\u7ba1\u7406\u3002\u4e3b\u8981\u529f\u80fd\u5305\u62ec\uff1a\n- \u5c06 requirements.txt \u8f6c\u5316\u4e3a Poetry \u7684 pyproject.toml\n- \u5c06 Poetry \u7684 pyproject.toml \u5bfc\u51fa\u4e3a requirements.txt\n- \u5c06\u79c1\u6709\u5305\u63d0\u53d6\u5230\u6307\u5b9a\u76ee\u5f55\n\n## Installation\n\n\u4f7f\u7528 pip \u6765\u5b89\u88c5\u8fd9\u4e2a\u9879\u76ee\uff1a\n\n```shell\npip install versifier\n```\n\n## Commands\n### requirements-to-poetry\n\n\u5c06 requirements \u8f6c\u6362\u4e3a poetry\u3002\n\n```bash\nversifier 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>\n```\n\n\u53c2\u6570\u8bf4\u660e\uff1a\n- `-R, --requirements`: \u6307\u5b9a requirements \u6587\u4ef6\u3002\u9ed8\u8ba4\u4e3a\u5f53\u524d\u76ee\u5f55\u7684 requirements.txt\u3002\n- `-d, --dev-requirements`: \u6307\u5b9a\u5f00\u53d1\u73af\u5883\u7684 requirements \u6587\u4ef6\u3002\u9ed8\u8ba4\u4e3a\u5f53\u524d\u76ee\u5f55\u7684 dev-requirements.txt\u3002\n- `-e, --exclude`: \u6307\u5b9a\u8981\u6392\u9664\u7684\u5305\u3002\n- `--add-only`: \u53ea\u6dfb\u52a0\u6307\u5b9a\u7684\u5305\uff0c\u800c\u4e0d\u5220\u9664\u4efb\u4f55\u73b0\u6709\u7684\u5305\u3002\n- `-c, --config`: \u6307\u5b9a\u914d\u7f6e\u6587\u4ef6\u3002\n- `-r, --root`: \u6307\u5b9a\u6839\u76ee\u5f55\u3002\u9ed8\u8ba4\u4e3a\u5f53\u524d\u76ee\u5f55\u3002\n- `--poetry-path`: \u6307\u5b9a poetry \u7684\u8def\u5f84\u3002\u9ed8\u8ba4\u4e3a \"poetry\"\u3002\n- `--nuitka-path`: \u6307\u5b9a nuitka3 \u7684\u8def\u5f84\u3002\u9ed8\u8ba4\u4e3a \"nuitka3\"\u3002\n- `--log-level`: \u6307\u5b9a\u65e5\u5fd7\u7ea7\u522b\u3002\n\n### poetry-to-requirements\n\n\u5c06 poetry \u8f6c\u6362\u4e3a requirements\u3002\n\n```bash\nversifier 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>\n```\n\n\u53c2\u6570\u8bf4\u660e\uff1a\n- `-o, --output`: \u6307\u5b9a\u8f93\u51fa\u6587\u4ef6\u3002\n- `--exclude-specifiers`: \u6392\u9664\u6307\u5b9a\u7684\u5305\u3002\n- `--include-comments`: \u5305\u542b\u6ce8\u91ca\u3002\n- `-d, --include-dev-requirements`: \u5305\u542b\u5f00\u53d1\u73af\u5883\u7684 requirements\u3002\n- `-E, --extra-requirements`: \u6307\u5b9a\u989d\u5916\u7684 requirements\u3002\n- `-m, --markers`: \u6307\u5b9a\u6807\u8bb0\u3002\n- `-P, --private-packages`: \u6307\u5b9a\u79c1\u6709\u5305\u3002\n- `-c, --config`: \u6307\u5b9a\u914d\u7f6e\u6587\u4ef6\u3002\n- `-r, --root`: \u6307\u5b9a\u6839\u76ee\u5f55\u3002\u9ed8\u8ba4\u4e3a\u5f53\u524d\u76ee\u5f55\u3002\n- `--poetry-path`: \u6307\u5b9a poetry \u7684\u8def\u5f84\u3002\u9ed8\u8ba4\u4e3a \"poetry\"\u3002\n- `--nuitka-path`: \u6307\u5b9a nuitka3 \u7684\u8def\u5f84\u3002\u9ed8\u8ba4\u4e3a \"nuitka3\"\u3002\n- `--log-level`: \u6307\u5b9a\u65e5\u5fd7\u7ea7\u522b\u3002\n\n### extract-private-packages\n\n\u63d0\u53d6\u79c1\u6709\u5305\u3002\n\n```bash\nversifier 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>\n```\n\n\u53c2\u6570\u8bf4\u660e\uff1a\n- `-o, --output`: \u6307\u5b9a\u8f93\u51fa\u76ee\u5f55\u3002\u9ed8\u8ba4\u4e3a\u5f53\u524d\u76ee\u5f55\u3002\n- `-E, --extra-requirements`: \u6307\u5b9a\u989d\u5916\u7684 requirements\u3002\n- `--exclude-file-patterns`: \u6307\u5b9a\u8981\u6392\u9664\u7684\u6587\u4ef6\u6a21\u5f0f\u3002\n- `-P, --private-packages`: \u6307\u5b9a\u8981\u63d0\u53d6\u7684\u79c1\u6709\u5305\u5217\u8868\u3002\n- `-c, --config`: \u6307\u5b9a\u914d\u7f6e\u6587\u4ef6\u3002\n- `-r, --root`: \u6307\u5b9a\u6839\u76ee\u5f55\u3002\u9ed8\u8ba4\u4e3a\u5f53\u524d\u76ee\u5f55\u3002\n- `--poetry-path`: \u6307\u5b9a poetry \u7684\u8def\u5f84\u3002\u9ed8\u8ba4\u4e3a \"poetry\"\u3002\n- `--nuitka-path`: \u6307\u5b9a nuitka3 \u7684\u8def\u5f84\u3002\u9ed8\u8ba4\u4e3a \"nuitka3\"\u3002\n- `--log-level`: \u6307\u5b9a\u65e5\u5fd7\u7ea7\u522b\u3002\n\n### obfuscate-project-dirs\n\n\u6df7\u6dc6\u9879\u76ee\u76ee\u5f55\u3002\n\n```bash\nversifier 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>\n```\n\n\u53c2\u6570\u8bf4\u660e\uff1a\n- `-o, --output`: \u6307\u5b9a\u8f93\u51fa\u76ee\u5f55\u3002\u9ed8\u8ba4\u4e3a\u5f53\u524d\u76ee\u5f55\u3002\n- `-d, --sub-dirs`: \u6307\u5b9a\u8981\u5305\u542b\u7684\u5b50\u76ee\u5f55\u3002\n- `--exclude-packages`: \u6307\u5b9a\u8981\u6392\u9664\u7684\u5305\u3002\n- `-c, --config`: \u6307\u5b9a\u914d\u7f6e\u6587\u4ef6\u3002\n- `-r, --root`: \u6307\u5b9a\u6839\u76ee\u5f55\u3002\u9ed8\u8ba4\u4e3a\u5f53\u524d\u76ee\u5f55\u3002\n- `--poetry-path`: \u6307\u5b9a poetry \u7684\u8def\u5f84\u3002\u9ed8\u8ba4\u4e3a \"poetry\"\u3002\n- `--nuitka-path`: \u6307\u5b9a nuitka3 \u7684\u8def\u5f84\u3002\u9ed8\u8ba4\u4e3a \"nuitka3\"\u3002\n- `--log-level`: \u6307\u5b9a\u65e5\u5fd7\u7ea7\u522b\u3002\n\n### obfuscate-private-packages\n\n\u6df7\u6dc6\u79c1\u6709\u5305\u3002\n\n```bash\nversifier 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>\n```\n\n\u53c2\u6570\u8bf4\u660e\uff1a\n- `-o, --output`: \u6307\u5b9a\u8f93\u51fa\u76ee\u5f55\u3002\u9ed8\u8ba4\u4e3a\u5f53\u524d\u76ee\u5f55\u3002\n- `-E, --extra-requirements`: \u6307\u5b9a\u989d\u5916\u7684 requirements\u3002\n- `-P, --private-packages`: \u6307\u5b9a\u8981\u6df7\u6dc6\u7684\u79c1\u6709\u5305\u5217\u8868\u3002\n- `-c, --config`: \u6307\u5b9a\u914d\u7f6e\u6587\u4ef6\u3002\n- `-r, --root`: \u6307\u5b9a\u6839\u76ee\u5f55\u3002\u9ed8\u8ba4\u4e3a\u5f53\u524d\u76ee\u5f55\u3002\n- `--poetry-path`: \u6307\u5b9a poetry \u7684\u8def\u5f84\u3002\u9ed8\u8ba4\u4e3a \"poetry\"\u3002\n- `--nuitka-path`: \u6307\u5b9a nuitka3 \u7684\u8def\u5f84\u3002\u9ed8\u8ba4\u4e3a \"nuitka3\"\u3002\n- `--log-level`: \u6307\u5b9a\u65e5\u5fd7\u7ea7\u522b\u3002\n\n\n## License\n\n\u6b64\u9879\u76ee\u4f7f\u7528 MIT \u8bb8\u53ef\u8bc1\u3002\u6709\u5173\u8be6\u7ec6\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605 LICENSE \u6587\u4ef6\u3002\n\n## Contributing\n\n\u6211\u4eec\u6b22\u8fce\u5404\u79cd\u5f62\u5f0f\u7684\u8d21\u732e\uff0c\u5305\u62ec\u62a5\u544a\u95ee\u9898\u3001\u63d0\u51fa\u65b0\u529f\u80fd\u3001\u6539\u8fdb\u6587\u6863\u6216\u63d0\u4ea4\u4ee3\u7801\u66f4\u6539\u3002\u5982\u679c\u4f60\u60f3\u8981\u8d21\u732e\uff0c\u8bf7\u67e5\u770b CONTRIBUTING.md \u83b7\u53d6\u66f4\u591a\u4fe1\u606f\u3002",
    "bugtrack_url": null,
    "license": null,
    "summary": "Versifier: A lyrical tool to transform Python requirements into Poetry configurations, effortlessly and elegantly.",
    "version": "0.3.1",
    "project_urls": {
        "Documentation": "https://mrlyc.github.io/versifier/",
        "Homepage": "https://github.com/mrlyc/versifier",
        "Repository": "https://github.com/mrlyc/versifier"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0375d51d9d5757dbd5c012c7c5f5b645e1e0e064251f5130706ee46bc86feac4",
                "md5": "863e82dfd3063eab0713fa7af8298206",
                "sha256": "f8ddd910b02ce50b8b2b905ee645d21e589e3e01c600f5de923bb192055dcfae"
            },
            "downloads": -1,
            "filename": "versifier-0.3.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "863e82dfd3063eab0713fa7af8298206",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.6.2",
            "size": 12642,
            "upload_time": "2024-08-08T02:39:36",
            "upload_time_iso_8601": "2024-08-08T02:39:36.072369Z",
            "url": "https://files.pythonhosted.org/packages/03/75/d51d9d5757dbd5c012c7c5f5b645e1e0e064251f5130706ee46bc86feac4/versifier-0.3.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e5810a4e8bd0c3523183581951ce5a30f18f98ea0c3b0f09f658e6a23b3af5a6",
                "md5": "14666d66658f5f039e3a47d9ffa4adb8",
                "sha256": "cdde3d0b2b6ae2e5e8cf165a89313ca5f2f77f2795395489b6f356a8098838e9"
            },
            "downloads": -1,
            "filename": "versifier-0.3.1.tar.gz",
            "has_sig": false,
            "md5_digest": "14666d66658f5f039e3a47d9ffa4adb8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.6.2",
            "size": 12733,
            "upload_time": "2024-08-08T02:39:37",
            "upload_time_iso_8601": "2024-08-08T02:39:37.285557Z",
            "url": "https://files.pythonhosted.org/packages/e5/81/0a4e8bd0c3523183581951ce5a30f18f98ea0c3b0f09f658e6a23b3af5a6/versifier-0.3.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-08 02:39:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mrlyc",
    "github_project": "versifier",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "versifier"
}
        
Elapsed time: 1.68666s