They're really some great tools!
Project description
Chaostools
They're really some great tools!
超棒的一些工具!
If you want to add your tools, please contact the author of this library! (E-mail: admin@wcfstudio.cn)
如果你想添加你的工具,请联系这个库的作者!(电子邮箱:admin@wcfstudio.cn)
Simple Tutorial
-
meanAgree(text,lang='zh-cn')
- Example 例子
import chaostools # Chinese print(chaostools.meanAgree("是的")) # True print(chaostools.meanAgree("你好")) # False print(chaostools.meanAgree("123")) # False print(chaostools.meanAgree("Yes")) # False # English print(chaostools.meanAgree("Yes")) # True print(chaostools.meanAgree("Hello")) # False print(chaostools.meanAgree("456")) # False print(chaostools.meanAgree("是的")) # False
-
Explanation 解释
This is a function that can determine whether it represents agreement, approval, and permission, supporting both Chinese and English.
这是一个可以判断是否表示同意、认可、允许的函数,支持中英双语。
Note: The first letter of English should be capitalized. Sentence ending punctuation (such as . ... ! ?) is not allowed in both Chinese and English.
注意:英文的首字母要大写。中英文均不得出现句末标点(如。 …… ! ?)。
-
bdbk(word, id=None, mu_first=False)
- Example 例子
import chaostools # Basic print(chaostools.bdbk("昔阳县")) # {'status': 'OK', 'id': '5631351', 'description': '昔阳县,隶属于山西省晋中市,位于晋中市东部、太行山西麓,东与河北省赞皇县、内丘县、井陉县、邢台市接壤,西与寿阳县为邻,南与和顺县毗连,北与平定县相衔。总面积1954平方千米。截至2022年末,昔阳县常住人口186614人。商朝时期,属微。东汉建安末年(219年)为乐平郡,隋大业初年改为乐平县。民国元年(1912年),恢复乐平县,归中路道。1968年,晋中专区改设晋中地区,昔阳县仍属之。截至2021年10月,昔阳县下辖5个镇、5个乡和1个管委会。县政府驻乐平镇育新巷10号。昔阳县地方特产有昔阳小米、杏鲍菇。有大寨、龙岩大峡谷等风景名胜。2023年,昔阳县地区生产总值163.0亿元,比2022年增长5.1%。', 'contents': ['昔阳县', '昔阳县历史沿革', '昔阳县行政区划', '昔阳县地理环境', '昔阳县自然资源', '昔阳县人口', '昔阳县政治', '昔阳县经济', '昔阳县交通运输', '昔阳县社会事业', '昔阳县风景名胜', '昔阳县地方特产', '昔阳县著名人物', '昔阳县荣誉称号', '昔阳县现任领导'], 'contents_len': 15} print(chaostools.bdbk("昔阳县")["status"]) # OK print(chaostools.bdbk("昔阳县")["id"]) # 5631351 print(chaostools.bdbk("昔阳县")["description"]) # 昔阳县,隶属于山西省晋中市,位于晋中市东部、太行山西麓,东与河北省赞皇县、内丘县、井陉县、邢台市接壤,西与寿阳县为邻,南与和顺县毗连,北与平定县相衔。总面积1954平方千米。截至2022年末,昔阳县常住人口186614人。商朝时期,属微。东汉建安末年(219年)为乐平郡,隋大业初年改为乐平县。民国元年(1912年),恢复乐平县,归中路道。1968年,晋中专区改设晋中地区,昔阳县仍属之。截至2021年10月,昔阳县下辖5个镇、5个乡和1个管委会。县政府驻乐平镇育新巷10号。昔阳县地方特产有昔阳小米、杏鲍菇。有大寨、龙岩大峡谷等风景名胜。2023年,昔阳县地区生产总值163.0亿元,比2022年增长5.1%。 # Others print(chaostools.bdbk("1450")) # {'status': 'MU', 'bdbk_multimeanings': [{'meaning': '中国台湾人对民进党网军的戏称', 'id': '56654602'}, {'meaning': '在爱情里表示“你是我的”', 'id': '63224232'}]} print(chaostools.bdbk("1450", id=chaostools.bdbk("1450")["bdbk_multimeanings"][1]["id"])) # {'status': 'OK', 'id': '63224232', 'description': '1450,在爱情里表示“你是我的”。', 'contents': ['1450'], 'contents_len': 1} print(chaostools.bdbk("1450", mu_first=True)) # {'status': 'OK', 'id': '56654602', 'description': '1450,网络流行语,中国台湾人对民进党网军的戏称。', 'contents': ['1450', '1450引申含义', '1450社会评价'], 'contents_len': 3}
-
Explanation 解释
This is a function used to crawl information from Baidu Baike.
这是一个用来爬取百度百科信息的函数。
Parameter 参数
-
word
Keyword. 关键词。
-
id=None
The unique ID of the specified entry. 指定的词条唯一ID。
-
mu_first=False
When the keyword is a polysemous word, does it default to obtaining the content of the first semantic item. 当关键词是一个多义词时,是否默认获取第一个义项的内容。
Return 返回
-
status
Status value: OK represents successful acquisition, ML represents polysemous words (and there is no ID or default setting for the first item).
状态值:OK代表获取成功,ML表示多义词(且没有ID和默认第一项的设置)。
-
The rest have literal meanings and do not need to be repeated. 其余的就是字面意思,无需赘述。
Note: The description is only a brief and overview section.
注意:description只是简述、概述部分。
-
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for chaostools-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef4383f4e6c0a1ccb20884b40cee8aee9db66f0b852aa948ce876e18a26151ad |
|
MD5 | 6a0e1a65c95ff6793e50da155152e78a |
|
BLAKE2b-256 | fcdbeb2640c2e9874415b5bdca5762ee401a5bbebd84405180e3c7bbeb17140d |