为Faker Python包提供各种星际飞船数据。
faker-starship的Python项目详细描述
faker starship是Fakerpython包的各种starship数据的提供者。伪星舰从一个静态库中随机抽取数千个虚构的星舰名称、类和注册号,它们跨越了多个科幻宇宙。
安装
使用PIP(或PIPENV)安装:
pip install faker-starship
用法
Python
将faker_starship.Provider
添加到faker.Faker
实例:
importfakerimportfaker_starshipfake=faker.Faker()fake.add_provider(faker_starship.Provider)
要从多元宇宙中获取星际飞船的名称、类别或注册号:
print(fake.starship_name())# prints "Colonial One" or similarprint(fake.starship_class())# prints "K't'inga" or similarprint(fake.starship_registry())# prints "ECS-222" or similar
或者限制到特定的源宇宙:
print(fake.starship_name("starwars"))# prints "Millennium Falcon" or similarprint(fake.starship_class("eveonline"))# prints "Nyx" or similarprint(fake.starship_registry("theorville"))# prints "ECV-197" or similar
命令行
faker starship_name -i faker_starship
faker starship_class -i faker_starship
faker starship_registry -i faker_starship
其他信息
- 许可证:MIT
- 发布:https://pypi.org/project/faker-starship/
- 代码:https://gitlab.com/infinitewarp/faker-starship
- 测试状态:https://gitlab.com/infinitewarp/faker-starship/pipelines/?scope=branches
- 测试覆盖率:https://codecov.io/gl/infinitewarp/faker-starship/branch/master