随机物种化身生成

bvatar的Python项目详细描述


bvatar创建字符串的唯一8x8图形表示。

设置

从pypi安装

使用以下pip命令安装:

pip install bvatar

或者,如果希望能够创建位图图像,请改用此选项:

pip install bvatar[bitmap]

安装开发版本

从github下载并使用以下命令安装开发版本:

git clone https://github.com/smileychris/bvatar
cd bvatar
pip install -e .[bitmap]

用法

导入bvatar类并像这样使用:

from bvatar import Bvatar bvtr = Bvatar(‘text’) img = bvtr.image() img.save(‘some_file.png’, ‘PNG’)

命令行脚本

生成bvatar(8x8随机艺术化身)。

用法:

bvatar [--mirror] [--no-color] [--px-size=<int>] ([TEXT] | [--hash=<sha1_hash>])
bvatar --ascii [--mirror] [--spaced] [--no-border] ([TEXT] | [--hash=<sha1_hash>])

第一种格式是生成位图图像。默认情况下,图像是 只显示不存储。要保存图像,请通过管道发送到文件:

bvatar > some_file.png

参数:

^{tt1}$
bvatar source text (otherwise a random bvatar is generated)

选项:

^{tt2}$
generate a horizontally mirrored bvatar
^{tt3}$
use greyscale rather than coloring the image
^{tt4}$
actual size for each pixel [default: 16]
^{tt5}$
rather than passing the text and having it SHA1ed, you can pass a hex encoded SHA1 hash explicitly
^{tt6}$
output ascii rather than generating a bitmap image
^{tt7}$
a “lighter” ascii art alternative
^{tt8}$
don’t add a border around the ascii art

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何设置将在类声明中使用的输入参数?   混合表达式和文本的java SpEL模板   getHeaders()无法返回java Mockito测试SimpMessageHeaderAccessor getHeaders()应返回MessageHeaders   如何在java中创建循环回菜单的方法   具有多态性的Java列表问题   java Guice多数据库自动切换   java服务器错误,状态代码:400,错误代码:100005,消息:您已超过组织的内存限制   静态mutator方法的Java命名约定   用于实例化另一个java文件的groovy java代码   javajavax。网ssl。SSLHandshakeException:握手期间远程主机关闭连接。重新启动服务器后,它工作正常,但会再次显示   java WebSphere+RAD+Taglib   REST客户端中出现java异常:找不到contenttype application/json的messagebodyreader   无参数setter的Java命名   java从数组中删除重复字符