Skip to main content
https://raw.githubusercontent.com/elapouya/django-robohash-svg/master/django_robohash.png

Django app for creating svg robots

The idea: from any string (username, first name and last name, etc…), obtain a unique svg robot to display. This is useful for creating avatars or for testing purposes.

Installation

Install with pip:

pip install django-robohash-svg

Then declare the app in your settings.py

INSTALLED_APPS = [
...
    'django_robohash',
]

Usage

If you want an inline image in your template use the robohash tag

{% load robohash %}
...
here is a robot:
{% robohash "a string" %}
a small one :
{% robohash "a string" width=100 height=100 %}

If you want to serve robot images, edit your urls.py and use robohash view

from django_robohash.views import robohash

urlpatterns = [
    ...
    path('robohash/<string>/', robohash,
         name='robohash')
]

You can custom the url if you want, but keep “<string>”.

Then you can display image like this

<img src="/robohash/{{ a_string }}/">

or

<img src="/robohash/{{ a_string }}/?width=120&height=120">

Default robots size is 300x300

You can generate the svg code by running this function:

from django_robohash.robotmaker import make_robot_svg
...
svg_code = make_robot_svg("my string", width=300, height=300)

News

0.9.4 (2018-08-13)

  • Add documentation

0.0.1 (2018-03-22)

  • Skeleton commit

Metadata

Release files for django-robohash-svg 0.9.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-robohash-svg 0.9.5
File Size Uploaded Provenance
django-robohash-svg-0.9.5.tar.gz 25.1 kB Without provenance Details

Release files / django-robohash-svg-0.9.5.tar.gz

Download URL django-robohash-svg-0.9.5.tar.gz
Size 25.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7a14e828163614ba033cf64ba4754d24e5fc87f8b68ccb1382c49cd1c50e37a6
BLAKE2b-256 checksum
How to use checksums
0f7259272628a41e5bc20275f2281268935e0752da54f12e3d3d852d28ae0022
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/2.7.15+

Security for django-robohash-svg 0.9.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page