mjob


Namemjob JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://jihulab.com/lsrami/mjob
SummaryPerform parallel tasks based on a given file list
upload_time2023-12-27 09:50:05
maintainer
docs_urlNone
authorsirui.li
requires_python
licenseApache License 2.0
keywords multi
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 列表并行

列表并行是一个用于并行处理列表任务的工具。它提供了一种简单而高效的方式来执行并行任务,针对给定的列表进行处理。

## 功能

- 并行执行任务:利用多线程或多进程的方式,并行处理给定的列表任务。
- 灵活的任务定义:可以自定义任务函数,根据具体需求对列表中的每个元素进行处理。
- 可配置的并行度:可以根据系统资源和任务复杂度,灵活地调整并行度。
- 进度跟踪和错误处理:提供进度跟踪功能,以及错误处理和日志记录,方便调试和排查问题。

## 安装

列表并行可以通过以下步骤进行安装:

1. 从源码安装:

```shell
git clone https://jihulab.com/lsrami/mjob.git
cd mjob
python -m pip install ./
```

2. 从pypi安装

```shell
pip install mjob
```

## 使用示例
```shell
# 查看参数说明
mjob --help

# 通过给定的test.list文件,快速复制到包含 data_new 的新目录中
mjob --task copy \
--file_list test.list \
--old_dir data \
--new_dir data_new \
--nj 4

# 通过给定的test.list文件,创建软连接到包含 data_new 的新目录中
mjob --task link \
--file_list test.list \
--old_dir data \
--new_dir data_new \
--nj 4

# 通过给定的test.list音频文件列表,快速音频重采样到16k,保存到到包含 data_new 的新目录中
mjob --task resample \
--file_list test.list \
--old_dir data \
--new_dir data_new \
--nj 4

# 通过给定的test.list文件,快速删除文件
mjob --task delete \
--file_list test.list \
--nj 4

# 通过给定的test.list文件,快速展示所有文件
mjob --task show \
--file_list test.list \
--nj 4

# 通过给定的test.list文件,快速执行命令(确保命令的合法性)
mjob --task run \
--file_list test.list \
--nj 4

# 以上任务默认使用多进程方式运行,添加 --thread 参数使用多线程方式运行
mjob --task copy \
--file_list test.list \
--old_dir data \
--new_dir data_new \
--nj 4 \
--thread
```

## 贡献

如果你发现了任何问题或有改进的建议,欢迎提出issue或提交pull request。我们非常欢迎贡献者为该项目做出贡献。

            

Raw data

            {
    "_id": null,
    "home_page": "https://jihulab.com/lsrami/mjob",
    "name": "mjob",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "multi",
    "author": "sirui.li",
    "author_email": "lisr@cslt.org",
    "download_url": "https://files.pythonhosted.org/packages/20/84/531053cea1faac54534be9dd5f31ca1918ed56206d7b02036a9b3f27360f/mjob-1.1.0.tar.gz",
    "platform": null,
    "description": "# \u5217\u8868\u5e76\u884c\n\n\u5217\u8868\u5e76\u884c\u662f\u4e00\u4e2a\u7528\u4e8e\u5e76\u884c\u5904\u7406\u5217\u8868\u4efb\u52a1\u7684\u5de5\u5177\u3002\u5b83\u63d0\u4f9b\u4e86\u4e00\u79cd\u7b80\u5355\u800c\u9ad8\u6548\u7684\u65b9\u5f0f\u6765\u6267\u884c\u5e76\u884c\u4efb\u52a1\uff0c\u9488\u5bf9\u7ed9\u5b9a\u7684\u5217\u8868\u8fdb\u884c\u5904\u7406\u3002\n\n## \u529f\u80fd\n\n- \u5e76\u884c\u6267\u884c\u4efb\u52a1\uff1a\u5229\u7528\u591a\u7ebf\u7a0b\u6216\u591a\u8fdb\u7a0b\u7684\u65b9\u5f0f\uff0c\u5e76\u884c\u5904\u7406\u7ed9\u5b9a\u7684\u5217\u8868\u4efb\u52a1\u3002\n- \u7075\u6d3b\u7684\u4efb\u52a1\u5b9a\u4e49\uff1a\u53ef\u4ee5\u81ea\u5b9a\u4e49\u4efb\u52a1\u51fd\u6570\uff0c\u6839\u636e\u5177\u4f53\u9700\u6c42\u5bf9\u5217\u8868\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u8fdb\u884c\u5904\u7406\u3002\n- \u53ef\u914d\u7f6e\u7684\u5e76\u884c\u5ea6\uff1a\u53ef\u4ee5\u6839\u636e\u7cfb\u7edf\u8d44\u6e90\u548c\u4efb\u52a1\u590d\u6742\u5ea6\uff0c\u7075\u6d3b\u5730\u8c03\u6574\u5e76\u884c\u5ea6\u3002\n- \u8fdb\u5ea6\u8ddf\u8e2a\u548c\u9519\u8bef\u5904\u7406\uff1a\u63d0\u4f9b\u8fdb\u5ea6\u8ddf\u8e2a\u529f\u80fd\uff0c\u4ee5\u53ca\u9519\u8bef\u5904\u7406\u548c\u65e5\u5fd7\u8bb0\u5f55\uff0c\u65b9\u4fbf\u8c03\u8bd5\u548c\u6392\u67e5\u95ee\u9898\u3002\n\n## \u5b89\u88c5\n\n\u5217\u8868\u5e76\u884c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u8fdb\u884c\u5b89\u88c5\uff1a\n\n1. \u4ece\u6e90\u7801\u5b89\u88c5\uff1a\n\n```shell\ngit clone https://jihulab.com/lsrami/mjob.git\ncd mjob\npython -m pip install ./\n```\n\n2. \u4ecepypi\u5b89\u88c5\n\n```shell\npip install mjob\n```\n\n## \u4f7f\u7528\u793a\u4f8b\n```shell\n# \u67e5\u770b\u53c2\u6570\u8bf4\u660e\nmjob --help\n\n# \u901a\u8fc7\u7ed9\u5b9a\u7684test.list\u6587\u4ef6\uff0c\u5feb\u901f\u590d\u5236\u5230\u5305\u542b data_new \u7684\u65b0\u76ee\u5f55\u4e2d\nmjob --task copy \\\n--file_list test.list \\\n--old_dir data \\\n--new_dir data_new \\\n--nj 4\n\n# \u901a\u8fc7\u7ed9\u5b9a\u7684test.list\u6587\u4ef6\uff0c\u521b\u5efa\u8f6f\u8fde\u63a5\u5230\u5305\u542b data_new \u7684\u65b0\u76ee\u5f55\u4e2d\nmjob --task link \\\n--file_list test.list \\\n--old_dir data \\\n--new_dir data_new \\\n--nj 4\n\n# \u901a\u8fc7\u7ed9\u5b9a\u7684test.list\u97f3\u9891\u6587\u4ef6\u5217\u8868\uff0c\u5feb\u901f\u97f3\u9891\u91cd\u91c7\u6837\u523016k\uff0c\u4fdd\u5b58\u5230\u5230\u5305\u542b data_new \u7684\u65b0\u76ee\u5f55\u4e2d\nmjob --task resample \\\n--file_list test.list \\\n--old_dir data \\\n--new_dir data_new \\\n--nj 4\n\n# \u901a\u8fc7\u7ed9\u5b9a\u7684test.list\u6587\u4ef6\uff0c\u5feb\u901f\u5220\u9664\u6587\u4ef6\nmjob --task delete \\\n--file_list test.list \\\n--nj 4\n\n# \u901a\u8fc7\u7ed9\u5b9a\u7684test.list\u6587\u4ef6\uff0c\u5feb\u901f\u5c55\u793a\u6240\u6709\u6587\u4ef6\nmjob --task show \\\n--file_list test.list \\\n--nj 4\n\n# \u901a\u8fc7\u7ed9\u5b9a\u7684test.list\u6587\u4ef6\uff0c\u5feb\u901f\u6267\u884c\u547d\u4ee4\uff08\u786e\u4fdd\u547d\u4ee4\u7684\u5408\u6cd5\u6027\uff09\nmjob --task run \\\n--file_list test.list \\\n--nj 4\n\n# \u4ee5\u4e0a\u4efb\u52a1\u9ed8\u8ba4\u4f7f\u7528\u591a\u8fdb\u7a0b\u65b9\u5f0f\u8fd0\u884c\uff0c\u6dfb\u52a0 --thread \u53c2\u6570\u4f7f\u7528\u591a\u7ebf\u7a0b\u65b9\u5f0f\u8fd0\u884c\nmjob --task copy \\\n--file_list test.list \\\n--old_dir data \\\n--new_dir data_new \\\n--nj 4 \\\n--thread\n```\n\n## \u8d21\u732e\n\n\u5982\u679c\u4f60\u53d1\u73b0\u4e86\u4efb\u4f55\u95ee\u9898\u6216\u6709\u6539\u8fdb\u7684\u5efa\u8bae\uff0c\u6b22\u8fce\u63d0\u51faissue\u6216\u63d0\u4ea4pull request\u3002\u6211\u4eec\u975e\u5e38\u6b22\u8fce\u8d21\u732e\u8005\u4e3a\u8be5\u9879\u76ee\u505a\u51fa\u8d21\u732e\u3002\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "Perform parallel tasks based on a given file list",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://jihulab.com/lsrami/mjob"
    },
    "split_keywords": [
        "multi"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "15d4afa0fc6df9bdd303e22db938b6db1285631bd8895b2915dcc268368f1342",
                "md5": "48143cb9c54dd2287c9064a9d27b9ad1",
                "sha256": "bd5d6ed9a1cebf330d862dd475fbbafcf701ac1efed85e4945a43c31239a8906"
            },
            "downloads": -1,
            "filename": "mjob-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "48143cb9c54dd2287c9064a9d27b9ad1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5018,
            "upload_time": "2023-12-27T09:50:03",
            "upload_time_iso_8601": "2023-12-27T09:50:03.312612Z",
            "url": "https://files.pythonhosted.org/packages/15/d4/afa0fc6df9bdd303e22db938b6db1285631bd8895b2915dcc268368f1342/mjob-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2084531053cea1faac54534be9dd5f31ca1918ed56206d7b02036a9b3f27360f",
                "md5": "0816854a318ab59968090ece456f80d7",
                "sha256": "1d93245eee381d1ff8bddfb9cf4428429042e191aca6dfc9a0b15ce6eb725893"
            },
            "downloads": -1,
            "filename": "mjob-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "0816854a318ab59968090ece456f80d7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4724,
            "upload_time": "2023-12-27T09:50:05",
            "upload_time_iso_8601": "2023-12-27T09:50:05.264033Z",
            "url": "https://files.pythonhosted.org/packages/20/84/531053cea1faac54534be9dd5f31ca1918ed56206d7b02036a9b3f27360f/mjob-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-27 09:50:05",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "mjob"
}
        
Elapsed time: 0.16614s