# X2Case
> **X2Case** , `Xmind` 文件转 `jira` CSV 文件。 支持新版 xmind zen。
### 一、安装 Install
```
pip3 install x2case
```
### 二、使用方式 Usage
#### 1. to jira csv
```
import json
import logging
from x2case.func import XmindZenParser
from x2case.jira import xmind_to_jira_csv_file
logging.basicConfig(level=logging.INFO)
xmind_file = 'docs/jira_demo.xmind'
print('Start to convert XMind file: %s' % xmind_file)
# 1、testcases import file
# (1) jira
csv_file = xmind_to_jira_csv_file(xmind_file)
print(f'Convert XMind file to zentao csv file successfully: {xmind_file}')
```
#### 2. to testcases json file
```
parser = XmindZenParser(xmind_file)
# (1) testsuite
testsuite_json_file = parser.xmind_2_suite_json_file()
print('Convert XMind file to testsuite json file successfully: %s' % testsuite_json_file)
# (2) testcase
testcase_json_file = parser.xmind_2_case_json_file()
print('Convert XMind file to testcase json file successfully: %s' % testcase_json_file)
```
#### 3、test dict/json data
```
# (1) testsuite
test_suite = parser.get_xmind_testsuite_list()
print('Convert XMind to test suits dict data:\n%s' %
json.dumps(test_suite, indent=2, separators=(',', ': '), ensure_ascii=False))
# (2) testcase
testcases = parser.get_xmind_testcase_list()
print('Convert Xmind to testcases dict data:\n%s' %
json.dumps(testcases, indent=4, separators=(',', ': '), ensure_ascii=False))
print('Finished conversion, Congratulations!')
```
### 三、致谢
**X2Case** 工具的产生,受益于以下两个开源项目,并在此基础上扩展、优化,受益匪浅,感恩!
- 1、**[XMindParser](https://github.com/tobyqin/xmindparser)**:Parse xmind file to programmable data type (e.g. json,
xml). Python 3.x required. Now it supports XmindZen file type as well.
- 2、**[Xmind2Testcase](https://github.com/zhuifengshen/xmind2testcase)**:XMind2TestCase 工具,提供了一个高效测试用例设计的解决方案!
(如果本项目对你有帮助的话,也欢迎 _**[star](https://github.com/Allenzzz/x2case)**_ )
### LICENSE
```
MIT License
```
Raw data
{
"_id": null,
"home_page": null,
"name": "x2case",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "Xmind, testcase, jira, xmindparser",
"author": null,
"author_email": "Zeno Zhang <z_ok@me.com>",
"download_url": "https://files.pythonhosted.org/packages/d5/d8/cac3022ed7880dbd72326af84d0dbfab45a5b34391e9185a3a9ed0abf496/x2case-1.2.2.tar.gz",
"platform": null,
"description": "# X2Case\n\n> **X2Case** , `Xmind` \u6587\u4ef6\u8f6c `jira` CSV \u6587\u4ef6\u3002 \u652f\u6301\u65b0\u7248 xmind zen\u3002\n\n### \u4e00\u3001\u5b89\u88c5 Install\n\n```\npip3 install x2case\n```\n\n### \u4e8c\u3001\u4f7f\u7528\u65b9\u5f0f Usage\n\n#### 1. to jira csv\n\n```\nimport json\nimport logging\n\nfrom x2case.func import XmindZenParser\nfrom x2case.jira import xmind_to_jira_csv_file\n\nlogging.basicConfig(level=logging.INFO)\n\nxmind_file = 'docs/jira_demo.xmind'\nprint('Start to convert XMind file: %s' % xmind_file)\n\n# 1\u3001testcases import file\n# (1) jira\ncsv_file = xmind_to_jira_csv_file(xmind_file)\nprint(f'Convert XMind file to zentao csv file successfully: {xmind_file}')\n```\n\n#### 2. to testcases json file\n\n```\nparser = XmindZenParser(xmind_file)\n# (1) testsuite\ntestsuite_json_file = parser.xmind_2_suite_json_file()\nprint('Convert XMind file to testsuite json file successfully: %s' % testsuite_json_file)\n# (2) testcase\ntestcase_json_file = parser.xmind_2_case_json_file()\nprint('Convert XMind file to testcase json file successfully: %s' % testcase_json_file)\n```\n\n#### 3\u3001test dict/json data\n\n```\n# (1) testsuite\n\ntest_suite = parser.get_xmind_testsuite_list()\nprint('Convert XMind to test suits dict data:\\n%s' %\n json.dumps(test_suite, indent=2, separators=(',', ': '), ensure_ascii=False))\n# (2) testcase\ntestcases = parser.get_xmind_testcase_list()\nprint('Convert Xmind to testcases dict data:\\n%s' %\n json.dumps(testcases, indent=4, separators=(',', ': '), ensure_ascii=False))\n\nprint('Finished conversion, Congratulations!')\n\n```\n\n### \u4e09\u3001\u81f4\u8c22\n\n**X2Case** \u5de5\u5177\u7684\u4ea7\u751f\uff0c\u53d7\u76ca\u4e8e\u4ee5\u4e0b\u4e24\u4e2a\u5f00\u6e90\u9879\u76ee\uff0c\u5e76\u5728\u6b64\u57fa\u7840\u4e0a\u6269\u5c55\u3001\u4f18\u5316\uff0c\u53d7\u76ca\u532a\u6d45\uff0c\u611f\u6069\uff01\n\n- 1\u3001**[XMindParser](https://github.com/tobyqin/xmindparser)**\uff1aParse xmind file to programmable data type (e.g. json,\n xml). Python 3.x required. Now it supports XmindZen file type as well.\n- 2\u3001**[Xmind2Testcase](https://github.com/zhuifengshen/xmind2testcase)**\uff1aXMind2TestCase \u5de5\u5177\uff0c\u63d0\u4f9b\u4e86\u4e00\u4e2a\u9ad8\u6548\u6d4b\u8bd5\u7528\u4f8b\u8bbe\u8ba1\u7684\u89e3\u51b3\u65b9\u6848\uff01\n\n\uff08\u5982\u679c\u672c\u9879\u76ee\u5bf9\u4f60\u6709\u5e2e\u52a9\u7684\u8bdd\uff0c\u4e5f\u6b22\u8fce _**[star](https://github.com/Allenzzz/x2case)**_ \uff09\n\n### LICENSE\n\n```\nMIT License\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Xmind to jira test case",
"version": "1.2.2",
"project_urls": {
"Homepage": "https://github.com/Allenzzz/x2case",
"Repository": "https://github.com/Allenzzz/x2case"
},
"split_keywords": [
"xmind",
" testcase",
" jira",
" xmindparser"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "77c94bc6d0ca64e823f2c1b211b2e36106b5925a27835acfb1b22936df14d65d",
"md5": "6449638463f3de39ac469f2749b98f6b",
"sha256": "0741e57c92659fac88ea8b9ba225aa4ed0f8c08b882f6cf39bbd5f687e3c0085"
},
"downloads": -1,
"filename": "x2case-1.2.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6449638463f3de39ac469f2749b98f6b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 11144,
"upload_time": "2025-09-02T08:53:59",
"upload_time_iso_8601": "2025-09-02T08:53:59.584300Z",
"url": "https://files.pythonhosted.org/packages/77/c9/4bc6d0ca64e823f2c1b211b2e36106b5925a27835acfb1b22936df14d65d/x2case-1.2.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "d5d8cac3022ed7880dbd72326af84d0dbfab45a5b34391e9185a3a9ed0abf496",
"md5": "54fb9ed46a95de5647510092febe00dc",
"sha256": "5548b9eb7bb2edb4db2bd46717bf00dfa2a8888cf19cc224ccd42a46a98b86af"
},
"downloads": -1,
"filename": "x2case-1.2.2.tar.gz",
"has_sig": false,
"md5_digest": "54fb9ed46a95de5647510092febe00dc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 11173,
"upload_time": "2025-09-02T08:54:00",
"upload_time_iso_8601": "2025-09-02T08:54:00.938542Z",
"url": "https://files.pythonhosted.org/packages/d5/d8/cac3022ed7880dbd72326af84d0dbfab45a5b34391e9185a3a9ed0abf496/x2case-1.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-02 08:54:00",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Allenzzz",
"github_project": "x2case",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "xmindparser",
"specs": []
}
],
"lcname": "x2case"
}