django-robohash-svg


Namedjango-robohash-svg JSON
Version 0.9.5 PyPI version JSON
download
home_pagehttps://github.com/elapouya/django-robohash-svg
SummaryLibrary for creating svg robots
upload_time2020-04-17 22:12:52
maintainer
docs_urlNone
authorEric Lapouyade
requires_python
licenseLGPL 2.1
keywords robots robohash svg hash
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ===================
django-robohash-svg
===================

.. image:: https://raw.githubusercontent.com/elapouya/django-robohash-svg/master/django_robohash.png
    :width: 100%
    :align: center

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
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/elapouya/django-robohash-svg",
    "name": "django-robohash-svg",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "robots,robohash,svg,hash",
    "author": "Eric Lapouyade",
    "author_email": "elapouya@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/0f/72/59272628a41e5bc20275f2281268935e0752da54f12e3d3d852d28ae0022/django-robohash-svg-0.9.5.tar.gz",
    "platform": "",
    "description": "===================\ndjango-robohash-svg\n===================\n\n.. image:: https://raw.githubusercontent.com/elapouya/django-robohash-svg/master/django_robohash.png\n    :width: 100%\n    :align: center\n\nDjango app for creating svg robots\n\nThe 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.\n\nInstallation\n------------\n\nInstall with pip::\n\n    pip install django-robohash-svg\n\nThen declare the app in your settings.py ::\n\n    INSTALLED_APPS = [\n    ...\n        'django_robohash',\n    ]\n\n\n\nUsage\n-----\n\nIf you want an inline image in your template use the robohash tag ::\n\n    {% load robohash %}\n    ...\n    here is a robot:\n    {% robohash \"a string\" %}\n    a small one :\n    {% robohash \"a string\" width=100 height=100 %}\n\nIf you want to serve robot images, edit your urls.py and use robohash view ::\n\n    from django_robohash.views import robohash\n\n    urlpatterns = [\n        ...\n        path('robohash/<string>/', robohash,\n             name='robohash')\n    ]\n\nYou can custom the url if you want, but keep \"<string>\".\n\nThen you can display image like this ::\n\n    <img src=\"/robohash/{{ a_string }}/\">\n\n    or\n\n    <img src=\"/robohash/{{ a_string }}/?width=120&height=120\">\n\n\nDefault robots size is 300x300\n\nYou can generate the svg code by running this function::\n\n    from django_robohash.robotmaker import make_robot_svg\n    ...\n    svg_code = make_robot_svg(\"my string\", width=300, height=300)\n\n\n\nNews\n====\n0.9.4 (2018-08-13)\n------------------\n- Add documentation\n\n0.0.1 (2018-03-22)\n------------------\n- Skeleton commit",
    "bugtrack_url": null,
    "license": "LGPL 2.1",
    "summary": "Library for creating svg robots",
    "version": "0.9.5",
    "project_urls": {
        "Homepage": "https://github.com/elapouya/django-robohash-svg"
    },
    "split_keywords": [
        "robots",
        "robohash",
        "svg",
        "hash"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0f7259272628a41e5bc20275f2281268935e0752da54f12e3d3d852d28ae0022",
                "md5": "5d82a63803aa6cd92048dc0068bde235",
                "sha256": "7a14e828163614ba033cf64ba4754d24e5fc87f8b68ccb1382c49cd1c50e37a6"
            },
            "downloads": -1,
            "filename": "django-robohash-svg-0.9.5.tar.gz",
            "has_sig": false,
            "md5_digest": "5d82a63803aa6cd92048dc0068bde235",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 25050,
            "upload_time": "2020-04-17T22:12:52",
            "upload_time_iso_8601": "2020-04-17T22:12:52.693825Z",
            "url": "https://files.pythonhosted.org/packages/0f/72/59272628a41e5bc20275f2281268935e0752da54f12e3d3d852d28ae0022/django-robohash-svg-0.9.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-04-17 22:12:52",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "elapouya",
    "github_project": "django-robohash-svg",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "django-robohash-svg"
}
        
Elapsed time: 0.12674s