得到流行的猫/狗/超级英雄/超级恶棍的名字
getname的Python项目详细描述
得到猫/狗/超级英雄/超级恶棍的名字。
我只是把@sindresorhus的 四个职员进了这个。
安装
$ pip install getname
用法
api
random(the_type, gender, showall)
- 类型:猫/狗/超级英雄/超人。
- 性别:雌性/雄性,仅用于狗名。
- show all:true/false,显示所有名称。
>>>fromgetnameimportrandom_name>>>random_name('cat')u'Angel'>>>random_name('dog',gender='female')u'Maggie'>>>random_name('superhero',showall=True)[u'3-D Man',u'A-Bomb',u'A.I.M.',...]
cli
$ getname dog Angel $ getname dog -f Lady $ getname dog --showall [u'Max', u'Buddy',...]
使用getname -h可获取有关每个用法的帮助消息。
Usage: getname [OPTIONS] COMMAND [ARGS]... Get popular cat/dog/superhero/supervillain names. Options: -v, --version Show the version and exit. -h, --help Show this message and exit. Commands: cat Get popular cat names. dog Get popular dog names. superhero Get superhero names. supervillain Get supervillain names.
使用getname cat/dog/superhero/supervillain -h获取帮助消息 关于指定类型。
测试
$ pip install -r dev-requirements.txt
$ invoke test
学分
所有的荣耀都应该属于 @sindresorhus,我只是把它移植到 Python:)
许可证
麻省理工学院。