Roseta
🧪 从「非结构化数据」到「结构化数据」!
如果需求多,就开始做,否则就慢慢推进~
- 欢迎「提需求」🎉;
- 欢迎「供数据」🎉。
1 功能
- 转化「长度」描述;
- 身高
- 胸围
- 腰围
- 臀围
- 肩宽
- 转化「重量」描述;
- 转化「城市」描述;
- 转化「年龄」描述;
- 转化「罩杯」描述;
- 转化「日期」描述;
- 转化「地点」描述。
2 安装
pip install roseta -U
# or
git clone https://github.com/Ailln/roseta.git
cd roseta && python setup.py install
3 使用
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 许可
Metadata
Release files for roseta 0.1.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| roseta-0.1.9.tar.gz | 16.6 kB | Without provenance | Details for roseta-0.1.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| roseta-0.1.9-py3-none-any.whl | Python 3 | none | any | Details for roseta-0.1.9-py3-none-any.whl |
Total release size: 39.9 kB
Release files / roseta-0.1.9.tar.gz
| Download URL | roseta-0.1.9.tar.gz |
|---|---|
| Size | 16.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f6d6f580e91cfcc0d78f304192a506e58465ead45dd79573e7ae0f27b159df53
|
|
BLAKE2b-256 checksum How to use checksums |
037c45600f13df631e3799796b863eaf4beb263b827a511ff6a0a7d001e769db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.13
|
Release files / roseta-0.1.9-py3-none-any.whl
| Download URL | roseta-0.1.9-py3-none-any.whl |
|---|---|
| Size | 23.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fadaf51808c9df67272b326b37eda385bf2f23e2da0dd6c6455085b39eeeb6ea
|
|
BLAKE2b-256 checksum How to use checksums |
25ca3e84e964f507f2550ceff233dfcf1ec71fea83dd3cd3262ba7584aaf2896
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.13
|
Security for roseta 0.1.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.