comforticons
v0.1.0 is out
이 패키지는 다양한 동일성/아이콘/그라바타/아바타 풍미를위한 동일성 생성 모듈입니다.
Libravatar Project 및 Gravatar Project를 참조하십시오.
이 모듈은 Bitverversio의 PHP Identicon Generator Architecture/Generations 및 Azaghal의 Pydenticon 패키지 (Gravatar Retro-Like Identicon Generator)에서 영감을 얻었습니다.
소스 링크.
이 모듈은 pypi.org에서 사용할 수 있습니다.
pip install comforticons
preprocessors목록 및generator클래스 구동 된 Identicon Generation
python3 -m comforticons
from comforticons import Identicon
# Customize preprocessors and generator settings here
generator = Identicon ()
# This will generate 120x120 with 0 padding PNG identicon
# with transparent background 5x5 pixel identicon (retro gravatar)
# using PixelGenerator and MD5Preprocessor as default
identicon = generator . generate ( "provide data here" )
# Save to file
with open ( "image.png" , "wb" ) as file :
file . write ( identicon ) from comforticons import Identicon
from comforticons . preprocessors . hash import * # *Preprocessor
from comforticons . generators . image import * # PixelGenerator
# Customize preprocessors and generator settings here
generator = Identicon (
# First, process data with md5, then with sha1
preprocessors = [ MD5Preprocessor (), SHA1Preprocessor ],
generator = PixelGenerator (
size = 10 , # 10x10 grid
foreground_colors = [ "#ffffff" ], # Only use white foreground
background = "#000000" , # black, non-transparent background
image_format = "png" , # PNG image format
invert = True , # This will swap bg-fg colors
)
)
# Actually generate identicon
identicon = generator . generate ( "provide data here" )
# Save to file
with open ( "image.png" , "wb" ) as file :
file . write ( identicon )
MD5Preprocessor+PixelGenerator
"동일성"
SHA1Preprocessor+PixelGenerator
"동일성"
라이센스를 참조하십시오.
또한이 라이센스를 참조하십시오.