Skip to main content

A lightweight, easy-to-use Python package for generating unique identicons - graphical representations of hashed user information. It's perfect for adding a touch of personalization to user profiles in web applications, forums, or any platform requiring distinct visual user identification.

Project description

Identicons

identicons is a Python package that generates unique 5x5 identicons based on MD5 hashes of input strings. These identicons are symmetrical images commonly used for representing user avatars in applications.

Installation

pip install identicons

If you're downloading from a source, navigate to the root directory where setup.py is located and run:

git clone https://github.com/LVivona/identicons.git
python setup.py install

Usage

To generate an identicons, you can use the generate function:

from identicons import generate

# Generate an identicons with default colors
icon = generate('hello world')

# Generate an identicons with custom primary and secondary colors
icon_custom = generate('hello world', primary=0xFFD700, secondary=0x8B0000)
identicons --text "hello world" --file "output.png" -s 0xa0e7e5 -p 0xffffff

The generate function returns a NumPy array representing the identicons image. You can save this image using the save function:

from identicons import save

# Save the generated identicons that is 500x500
save(icon, 'identicons.png', 500, 500)

Features

  • Generate unique and symmetrical 5x5 identicons.
  • Customize identicons colors.
  • Save identicons in different sizes.

Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".

Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Why build this?

I was curious on how github generates there icons, and thought I should build a simple cli/package to do it for me lol. :)

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Your Name - your_email@example.com

Project Link: https://github.com/LVivona/identicons

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

identicons-0.1.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

identicons-0.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file identicons-0.1.0.tar.gz.

File metadata

  • Download URL: identicons-0.1.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for identicons-0.1.0.tar.gz
Algorithm Hash digest
SHA256 141030b24e9c78ee1297ce20a53d2ad3d414651aff05f5e93ad6ac418a322d9f
MD5 3c79049755a98e3c457bebec429b423f
BLAKE2b-256 ed663d11f9f0ac29269687c891247ab0718b9c5c7c2a59a806b0fb14dac2ec4b

See more details on using hashes here.

File details

Details for the file identicons-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: identicons-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for identicons-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cde5896d6a29bf2cc10c02c2f067efbd73dad23ea02ef506349ad04ed09660b8
MD5 38e6c901b98a5292eef36fad5d6f5523
BLAKE2b-256 88522d1051bd8f3d286d5a7cd5e1a2a27b6f0bedd3a0270d1984ec739ce118d2

See more details on using hashes here.

Supported by

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