get a chinesename by random
Project description
说明
项目包含《百家姓》姓氏504个,常用于名字的汉字2812个 名字汉字中包含大部分《楚辞》、《诗经》词汇
安装模块
pip install chinesename
代码示例:
>>> from chinesename import ChineseName # 导包
>>> cn = ChineseName() # 实例化
>>> cn.getName() # 获取一个姓名
'广袁'
>>> cn.getNames(10) # 获取多个姓名
['笪递', '慎彭徨', '席具', '锺谦', '任西', '公羊狱', '华桑', '利节', '燕角', '任彪']
>>> cn.getNameGenerator(10) # 获取生成器
<generator object ChineseName.getNameGenerator at 0x1045cfa40>
>>> cn.getLastName() # 获取姓氏
'舒'
>>> cn.getFirstName() # 获取名字
'崔'
>>> cn.getName(lastname="彭") # 设置姓氏
'彭圭'
>>> cn.getName(char_count=2) # 设置名字长度
'倪吏渚'
>>> cn.getName(sex="boy") # 设置性别 (boy | girl)
'骆留'
更新记录
2018年6月20日 修复资源文件导入问题,增加性别参数,区分男孩姓名和女孩姓名 感谢 JoffreyN 提出的建议 古语云:男楚辞,女诗经。名可以从诗经、楚辞里面取 在原有基础上进行了扩展 遗留问题:取词不准确,需要进一步优化
更新记录
2018年3月19日 修复导入lastnames 和 firstname 文件失败的问题,将两文件内容直接写到chinesename中,并删除两文件
更新记录
2018年1月22日 增加姓名生成器函数,getNameGenerator()
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
chinesename-0.0.9.tar.gz
(150.5 kB
view details)
Built Distributions
chinesename-0.0.9-py3-none-any.whl
(152.6 kB
view details)
chinesename-0.0.9-py2.7.egg
(153.6 kB
view details)
File details
Details for the file chinesename-0.0.9.tar.gz
.
File metadata
- Download URL: chinesename-0.0.9.tar.gz
- Upload date:
- Size: 150.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d73c0b88dec7513245ef002903ea216ec5e5b74ab3c3a3326a81a9c75c810f29 |
|
MD5 | aad7bc999fd454ab8de03d378360e866 |
|
BLAKE2b-256 | 7f9bc527e661ca3530bfbc65b4702ca055d58e2d3e11039631627b7ea01a45fe |
File details
Details for the file chinesename-0.0.9-py3-none-any.whl
.
File metadata
- Download URL: chinesename-0.0.9-py3-none-any.whl
- Upload date:
- Size: 152.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d706fba942799db43ff081c5ebd756b5a018f7af3965492204ca7487a94c88fa |
|
MD5 | dd7353174cef72b186370d8c8cd9a5c3 |
|
BLAKE2b-256 | 005342199dd1020a29f908386b3a764674cf978884fe1cfbd2ff02cdf07cbd93 |
File details
Details for the file chinesename-0.0.9-py2.7.egg
.
File metadata
- Download URL: chinesename-0.0.9-py2.7.egg
- Upload date:
- Size: 153.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.10.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.19.7 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9374dc3aff38fd08005edeb03308803ffd40734a1764ce8557b6571e808b16d5 |
|
MD5 | e1a2f793bc02b5c7535eea992b8a3428 |
|
BLAKE2b-256 | e7c63fe3bbdb66eefa6ce2bac622352daa18a9e275419664d62fb8ab87b5a470 |