Skip to main content

Random-art avatar generation

Project description

Bvatar creates a unique 8x8 graphical representation of a string.

Setup

Install from PYPI

Install with the following pip command:

pip install bvatar

Or if you want to be able to create bitmap images, use this instead:

pip install bvatar[bitmap]

Install development version

Download from github and install the development version with these commands:

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

Usage

Import the bvatar class and use it like so:

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

Command-line Script

Generate a Bvatar (an 8x8 randomart avatar).

Usage:

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

The first format is for generating bitmap images. By default, the image is only displayed and not stored. To save the image, pipe to a file:

bvatar > some_file.png

Arguments:

TEXT

bvatar source text (otherwise a random bvatar is generated)

Options:

--mirror

generate a horizontally mirrored bvatar

--no-color

use greyscale rather than coloring the image

--px-size=<int>

actual size for each pixel [default: 16]

--hash=<sha1_hash>

rather than passing the text and having it SHA1ed, you can pass a hex encoded SHA1 hash explicitly

--ascii

output ascii rather than generating a bitmap image

--spaced

a “lighter” ascii art alternative

--no-border

don’t add a border around the ascii art

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

bvatar-1.0.a3.tar.gz (4.3 kB view details)

Uploaded Source

File details

Details for the file bvatar-1.0.a3.tar.gz.

File metadata

  • Download URL: bvatar-1.0.a3.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for bvatar-1.0.a3.tar.gz
Algorithm Hash digest
SHA256 8dc5136f33d6c091346947523d526f403114818364dee2c3b394781b5bac1015
MD5 84036bab8ba153268e7796a1c2ab2669
BLAKE2b-256 373675cd4c4e15b673fb84a777dc4606dc57fdbc27f469662f8e33189e0af0bf

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page