Name | roseta JSON |
Version |
0.1.9
JSON |
| download |
home_page | https://github.com/Ailln/roseta |
Summary | From unstructured data to structured data. |
upload_time | 2023-11-15 03:18:56 |
maintainer | |
docs_url | None |
author | Ailln |
requires_python | >=3.6 |
license | MIT License |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Roseta
[![Pypi](https://img.shields.io/pypi/v/roseta.svg)](https://pypi.org/project/roseta/)
[![MIT License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/Ailln/roseta/blob/master/LICENSE)
[![stars](https://img.shields.io/github/stars/Ailln/roseta.svg)](https://github.com/Ailln/roseta/stargazers)
🧪 从「非结构化数据」到「结构化数据」!
> 如果需求多,就开始做,否则就慢慢推进~
> 1. 欢迎「提需求」🎉;
> 2. 欢迎「供数据」🎉。
## 1 功能
- [x] 转化「长度」描述;
- 身高
- 胸围
- 腰围
- 臀围
- 肩宽
- [x] 转化「重量」描述;
- [x] 转化「城市」描述;
- [x] 转化「年龄」描述;
- [x] 转化「罩杯」描述;
- [ ] 转化「日期」描述;
- [ ] 转化「地点」描述。
## 2 安装
```bash
pip install roseta -U
# or
git clone https://github.com/Ailln/roseta.git
cd roseta && python setup.py install
```
## 3 使用
```python
from roseta import trans
## 转化「长度」
num, unit = trans("一米八")
# (180, 'cm')
num, unit = trans("1.8米", cls="length", unit="cm")
# (180.0, 'cm')
num, unit = trans("180厘米", unit="m")
# (1.8, 'm')
num, unit = trans("两尺")
# (66.67, 'cm')
num, unit = trans("2.1尺", cls="length")
# (70.0, 'cm')
num, unit = trans("2尺", cls="length", unit="m")
# (0.6667, 'm')
## 转化「重量」
num, unit = trans("一斤八")
# (0.9, 'kg')
num, unit = trans("1.8公斤", cls="weight", unit="kg")
# (1.8, 'kg')
num, unit = trans("180kg", unit="g")
# (180000, 'g')
## 转化「城市」
text, unit = trans("杭州市")
# ('杭州市', '市')
text, unit = trans("杭州", cls="city")
# ('杭州市', '市')
text, unit = trans("杭州市", unit="省")
# ('浙江省杭州市', '省')
## 转化「年龄」
num, unit = trans("一岁")
# (1, 'year')
num, unit = trans("二个月", cls="age")
# (0.2, 'year')
num, unit = trans("二个月", unit="year")
# (0.2, 'year')
## 转化「罩杯」
# 类别不可以省略
num, unit = trans("c36", cls="cup")
# ([96, 80], 'cm'),96 为上胸围,80 为下胸围
num, unit = trans("九五F", cls="cup", unit="m")
# ([1.17, 0.95], 'm')
```
## 4 许可
[![](https://award.dovolopor.com?lt=License&rt=MIT&rbc=green)](./LICENSE)
Raw data
{
"_id": null,
"home_page": "https://github.com/Ailln/roseta",
"name": "roseta",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "",
"author": "Ailln",
"author_email": "kinggreenhall@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/03/7c/45600f13df631e3799796b863eaf4beb263b827a511ff6a0a7d001e769db/roseta-0.1.9.tar.gz",
"platform": null,
"description": "# Roseta\n\n[![Pypi](https://img.shields.io/pypi/v/roseta.svg)](https://pypi.org/project/roseta/)\n[![MIT License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/Ailln/roseta/blob/master/LICENSE)\n[![stars](https://img.shields.io/github/stars/Ailln/roseta.svg)](https://github.com/Ailln/roseta/stargazers)\n\n\ud83e\uddea \u4ece\u300c\u975e\u7ed3\u6784\u5316\u6570\u636e\u300d\u5230\u300c\u7ed3\u6784\u5316\u6570\u636e\u300d\uff01\n\n> \u5982\u679c\u9700\u6c42\u591a\uff0c\u5c31\u5f00\u59cb\u505a\uff0c\u5426\u5219\u5c31\u6162\u6162\u63a8\u8fdb\uff5e\n> 1. \u6b22\u8fce\u300c\u63d0\u9700\u6c42\u300d\ud83c\udf89\uff1b\n> 2. \u6b22\u8fce\u300c\u4f9b\u6570\u636e\u300d\ud83c\udf89\u3002\n\n## 1 \u529f\u80fd\n\n- [x] \u8f6c\u5316\u300c\u957f\u5ea6\u300d\u63cf\u8ff0\uff1b\n - \u8eab\u9ad8\n - \u80f8\u56f4\n - \u8170\u56f4\n - \u81c0\u56f4\n - \u80a9\u5bbd\n- [x] \u8f6c\u5316\u300c\u91cd\u91cf\u300d\u63cf\u8ff0\uff1b\n- [x] \u8f6c\u5316\u300c\u57ce\u5e02\u300d\u63cf\u8ff0\uff1b\n- [x] \u8f6c\u5316\u300c\u5e74\u9f84\u300d\u63cf\u8ff0\uff1b\n- [x] \u8f6c\u5316\u300c\u7f69\u676f\u300d\u63cf\u8ff0\uff1b\n- [ ] \u8f6c\u5316\u300c\u65e5\u671f\u300d\u63cf\u8ff0\uff1b\n- [ ] \u8f6c\u5316\u300c\u5730\u70b9\u300d\u63cf\u8ff0\u3002\n\n\n## 2 \u5b89\u88c5\n\n```bash\npip install roseta -U\n\n# or\ngit clone https://github.com/Ailln/roseta.git\ncd roseta && python setup.py install\n```\n\n## 3 \u4f7f\u7528\n\n```python\nfrom roseta import trans\n\n## \u8f6c\u5316\u300c\u957f\u5ea6\u300d\nnum, unit = trans(\"\u4e00\u7c73\u516b\")\n# (180, 'cm')\nnum, unit = trans(\"1.8\u7c73\", cls=\"length\", unit=\"cm\")\n# (180.0, 'cm')\nnum, unit = trans(\"180\u5398\u7c73\", unit=\"m\")\n# (1.8, 'm')\nnum, unit = trans(\"\u4e24\u5c3a\")\n# (66.67, 'cm')\nnum, unit = trans(\"2.1\u5c3a\", cls=\"length\")\n# (70.0, 'cm')\nnum, unit = trans(\"2\u5c3a\", cls=\"length\", unit=\"m\")\n# (0.6667, 'm')\n\n## \u8f6c\u5316\u300c\u91cd\u91cf\u300d\nnum, unit = trans(\"\u4e00\u65a4\u516b\")\n# (0.9, 'kg')\nnum, unit = trans(\"1.8\u516c\u65a4\", cls=\"weight\", unit=\"kg\")\n# (1.8, 'kg')\nnum, unit = trans(\"180kg\", unit=\"g\")\n# (180000, 'g')\n\n## \u8f6c\u5316\u300c\u57ce\u5e02\u300d\ntext, unit = trans(\"\u676d\u5dde\u5e02\")\n# ('\u676d\u5dde\u5e02', '\u5e02')\ntext, unit = trans(\"\u676d\u5dde\", cls=\"city\")\n# ('\u676d\u5dde\u5e02', '\u5e02')\ntext, unit = trans(\"\u676d\u5dde\u5e02\", unit=\"\u7701\")\n# ('\u6d59\u6c5f\u7701\u676d\u5dde\u5e02', '\u7701')\n\n## \u8f6c\u5316\u300c\u5e74\u9f84\u300d\nnum, unit = trans(\"\u4e00\u5c81\")\n# (1, 'year')\nnum, unit = trans(\"\u4e8c\u4e2a\u6708\", cls=\"age\")\n# (0.2, 'year')\nnum, unit = trans(\"\u4e8c\u4e2a\u6708\", unit=\"year\")\n# (0.2, 'year')\n\n## \u8f6c\u5316\u300c\u7f69\u676f\u300d\n# \u7c7b\u522b\u4e0d\u53ef\u4ee5\u7701\u7565\nnum, unit = trans(\"c36\", cls=\"cup\")\n# ([96, 80], 'cm')\uff0c96 \u4e3a\u4e0a\u80f8\u56f4\uff0c80 \u4e3a\u4e0b\u80f8\u56f4\nnum, unit = trans(\"\u4e5d\u4e94F\", cls=\"cup\", unit=\"m\")\n# ([1.17, 0.95], 'm')\n```\n\n## 4 \u8bb8\u53ef\n\n[![](https://award.dovolopor.com?lt=License&rt=MIT&rbc=green)](./LICENSE)\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "From unstructured data to structured data.",
"version": "0.1.9",
"project_urls": {
"Homepage": "https://github.com/Ailln/roseta"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "25ca3e84e964f507f2550ceff233dfcf1ec71fea83dd3cd3262ba7584aaf2896",
"md5": "885387adeb96a7a1192b33362790d0f9",
"sha256": "fadaf51808c9df67272b326b37eda385bf2f23e2da0dd6c6455085b39eeeb6ea"
},
"downloads": -1,
"filename": "roseta-0.1.9-py3-none-any.whl",
"has_sig": false,
"md5_digest": "885387adeb96a7a1192b33362790d0f9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 23237,
"upload_time": "2023-11-15T03:18:54",
"upload_time_iso_8601": "2023-11-15T03:18:54.738164Z",
"url": "https://files.pythonhosted.org/packages/25/ca/3e84e964f507f2550ceff233dfcf1ec71fea83dd3cd3262ba7584aaf2896/roseta-0.1.9-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "037c45600f13df631e3799796b863eaf4beb263b827a511ff6a0a7d001e769db",
"md5": "bfe809cda9e48db405cabbb4412f582b",
"sha256": "f6d6f580e91cfcc0d78f304192a506e58465ead45dd79573e7ae0f27b159df53"
},
"downloads": -1,
"filename": "roseta-0.1.9.tar.gz",
"has_sig": false,
"md5_digest": "bfe809cda9e48db405cabbb4412f582b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 16637,
"upload_time": "2023-11-15T03:18:56",
"upload_time_iso_8601": "2023-11-15T03:18:56.776686Z",
"url": "https://files.pythonhosted.org/packages/03/7c/45600f13df631e3799796b863eaf4beb263b827a511ff6a0a7d001e769db/roseta-0.1.9.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-15 03:18:56",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Ailln",
"github_project": "roseta",
"github_not_found": true,
"lcname": "roseta"
}