django-initials-avatar


Namedjango-initials-avatar JSON
Version 0.0.7 PyPI version JSON
download
home_pagehttps://github.com/riquedev/django-initials-avatar
SummaryA ridiculously simple avatar generator with initials from names.
upload_time2023-12-25 15:25:14
maintainer
docs_urlNone
authorHenrique da Silva Santos
requires_python>=3.6
licenseApache License 2.0
keywords letter initials avatar django
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            django-initials-avatar
---
<dl>
<table>
<tr>
    <th>Summary</th>
    <td>A ridiculously simple avatar generator with initials from names.</td>
  </tr>
  <tr>
    <th>Original Repository</th>
    <td><a href="https://github.com/eddiejibson/avatars">eddiejibson/avatars</a></td>
  </tr> 
    <tr>
        <th>Django Packages</th>
        <td><a href="https://djangopackages.org/packages/p/django-initials-avatar/">packages/django-initials-avatar</a></td>
    </tr>
</table>
</dl>

[![Upload Python Package](https://github.com/riquedev/django-initials-avatar/actions/workflows/python-publish.yml/badge.svg)](https://github.com/riquedev/django-initials-avatar/actions/workflows/python-publish.yml)
[![Python package](https://github.com/riquedev/django-initials-avatar/actions/workflows/python-package.yml/badge.svg)](https://github.com/riquedev/django-initials-avatar/actions/workflows/python-package.yml)
[![CodeQL](https://github.com/riquedev/django-initials-avatar/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/riquedev/django-initials-avatar/actions/workflows/codeql-analysis.yml)

[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/riquedevbr)

## Installing
First add the application to your Python path. The easiest way is to use pip:

```shell
pip install django-initials-avatar
```

Check the [Release History](https://pypi.org/project/django-initials-avatar/#history) tab on the PyPI package page for
pre-release versions. These can be downloaded by specifying the version.

You can also install by downloading the source and running:

```shell
python setup.py install
```

## Configuring

Make sure you have add the django_initials_avatar application to your INSTALLED_APPS list:

```python
INSTALLED_APPS = (
    ...
    'django_initials_avatar',
)
```

Then ensure that your project URL conf is updated.

```python
from django.urls import path, include

urlpatterns = [
    ...
    path("initials-avatar/", include('django_initials_avatar.urls'))
]
```

### Default Background Colors

```python
INITIALS_AVATAR_BG_COLORS = [
    "#E284B3", "#FFED8B", "#681313", "#F3C1C6", "#735372", "#009975", "#FFBD39", "#B1E8ED", "#52437B", "#F76262",
    "#216583", "#293462", "#DD9D52", "#936B93", "#6DD38D", "#888888", "#6F8190", "#BCA0F0", "#AAF4DD", "#96C2ED",
    "#3593CE", "#5EE2CD", "#96366E", "#E38080"
]
```

### Default Text Color

```python
INITIALS_AVATAR_TEXT_COLOR = '#fff'
```

### Default Text Length

```python
INITIALS_AVATAR_TEXT_LENGTH = 2
```

### Default Avatar Width

```python
INITIALS_AVATAR_WIDTH = 500
```

### Default Avatar Height

```python
INITIALS_AVATAR_HEIGHT = 500
```

### Default Avatar Font Size

```python
INITIALS_AVATAR_FONT_SIZE = 250
```

### Avatar Rounded By Default

```python
INITIALS_AVATAR_ROUNDED = False
```

### Avatar Capitalize by Default

```python
INITIALS_AVATAR_CAPITALIZE = False
```

### Avatar Lowercase by Default

```python
INITIALS_AVATAR_LOWERCASE = False
```

### Avatar Bold by Default

```python
INITIALS_AVATAR_BOLD = False
```

### Cache timeout

```python
INITIALS_AVATAR_CACHE_TIMEOUT = 60 * 60
```

Usage Overview
---

In most cases it will probably be more efficient to use the template tag to get the avatar's reverse url
```django
{% load initials_avatar %}
{% render_initials_avatar "Your Name Here" %}
```
You can also pass parameters
```django
{% load initials_avatar %}
{% render_initials_avatar "Your Name Here" background="transparent" %}
```
Available parameters:
- name
- background
- color
- length
- width
- height
- size
- rounded
- capitalize
- lowercase
- bold


### Desired next step

Make it possible to render the png instead of an svg, perhaps directly converting the svg to png.
However so far the libraries need specific dll's and the intention would be to avoid this type of need.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/riquedev/django-initials-avatar",
    "name": "django-initials-avatar",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "letter,initials,avatar,django",
    "author": "Henrique da Silva Santos",
    "author_email": "henrique.santos@4u360.com.br",
    "download_url": "https://files.pythonhosted.org/packages/f3/18/3c6c738806b478d96fc574e2060294440b74e2c84d5479b3931e6dd68192/django_initials_avatar-0.0.7.tar.gz",
    "platform": null,
    "description": "django-initials-avatar\n---\n<dl>\n<table>\n<tr>\n    <th>Summary</th>\n    <td>A ridiculously simple avatar generator with initials from names.</td>\n  </tr>\n  <tr>\n    <th>Original Repository</th>\n    <td><a href=\"https://github.com/eddiejibson/avatars\">eddiejibson/avatars</a></td>\n  </tr> \n    <tr>\n        <th>Django Packages</th>\n        <td><a href=\"https://djangopackages.org/packages/p/django-initials-avatar/\">packages/django-initials-avatar</a></td>\n    </tr>\n</table>\n</dl>\n\n[![Upload Python Package](https://github.com/riquedev/django-initials-avatar/actions/workflows/python-publish.yml/badge.svg)](https://github.com/riquedev/django-initials-avatar/actions/workflows/python-publish.yml)\n[![Python package](https://github.com/riquedev/django-initials-avatar/actions/workflows/python-package.yml/badge.svg)](https://github.com/riquedev/django-initials-avatar/actions/workflows/python-package.yml)\n[![CodeQL](https://github.com/riquedev/django-initials-avatar/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/riquedev/django-initials-avatar/actions/workflows/codeql-analysis.yml)\n\n[![\"Buy Me A Coffee\"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/riquedevbr)\n\n## Installing\nFirst add the application to your Python path. The easiest way is to use pip:\n\n```shell\npip install django-initials-avatar\n```\n\nCheck the [Release History](https://pypi.org/project/django-initials-avatar/#history) tab on the PyPI package page for\npre-release versions. These can be downloaded by specifying the version.\n\nYou can also install by downloading the source and running:\n\n```shell\npython setup.py install\n```\n\n## Configuring\n\nMake sure you have add the django_initials_avatar application to your INSTALLED_APPS list:\n\n```python\nINSTALLED_APPS = (\n    ...\n    'django_initials_avatar',\n)\n```\n\nThen ensure that your project URL conf is updated.\n\n```python\nfrom django.urls import path, include\n\nurlpatterns = [\n    ...\n    path(\"initials-avatar/\", include('django_initials_avatar.urls'))\n]\n```\n\n### Default Background Colors\n\n```python\nINITIALS_AVATAR_BG_COLORS = [\n    \"#E284B3\", \"#FFED8B\", \"#681313\", \"#F3C1C6\", \"#735372\", \"#009975\", \"#FFBD39\", \"#B1E8ED\", \"#52437B\", \"#F76262\",\n    \"#216583\", \"#293462\", \"#DD9D52\", \"#936B93\", \"#6DD38D\", \"#888888\", \"#6F8190\", \"#BCA0F0\", \"#AAF4DD\", \"#96C2ED\",\n    \"#3593CE\", \"#5EE2CD\", \"#96366E\", \"#E38080\"\n]\n```\n\n### Default Text Color\n\n```python\nINITIALS_AVATAR_TEXT_COLOR = '#fff'\n```\n\n### Default Text Length\n\n```python\nINITIALS_AVATAR_TEXT_LENGTH = 2\n```\n\n### Default Avatar Width\n\n```python\nINITIALS_AVATAR_WIDTH = 500\n```\n\n### Default Avatar Height\n\n```python\nINITIALS_AVATAR_HEIGHT = 500\n```\n\n### Default Avatar Font Size\n\n```python\nINITIALS_AVATAR_FONT_SIZE = 250\n```\n\n### Avatar Rounded By Default\n\n```python\nINITIALS_AVATAR_ROUNDED = False\n```\n\n### Avatar Capitalize by Default\n\n```python\nINITIALS_AVATAR_CAPITALIZE = False\n```\n\n### Avatar Lowercase by Default\n\n```python\nINITIALS_AVATAR_LOWERCASE = False\n```\n\n### Avatar Bold by Default\n\n```python\nINITIALS_AVATAR_BOLD = False\n```\n\n### Cache timeout\n\n```python\nINITIALS_AVATAR_CACHE_TIMEOUT = 60 * 60\n```\n\nUsage Overview\n---\n\nIn most cases it will probably be more efficient to use the template tag to get the avatar's reverse url\n```django\n{% load initials_avatar %}\n{% render_initials_avatar \"Your Name Here\" %}\n```\nYou can also pass parameters\n```django\n{% load initials_avatar %}\n{% render_initials_avatar \"Your Name Here\" background=\"transparent\" %}\n```\nAvailable parameters:\n- name\n- background\n- color\n- length\n- width\n- height\n- size\n- rounded\n- capitalize\n- lowercase\n- bold\n\n\n### Desired next step\n\nMake it possible to render the png instead of an svg, perhaps directly converting the svg to png.\nHowever so far the libraries need specific dll's and the intention would be to avoid this type of need.\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "A ridiculously simple avatar generator with initials from names.",
    "version": "0.0.7",
    "project_urls": {
        "Bug Tracker": "https://github.com/riquedev/django-initials-avatar/issues",
        "Homepage": "https://github.com/riquedev/django-initials-avatar",
        "Repository": "https://github.com/riquedev/django-initials-avatar"
    },
    "split_keywords": [
        "letter",
        "initials",
        "avatar",
        "django"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "95fc70dea3600c1da431020d69635da2ee14fa2150c88e9f2b53c87c0ca8c3a7",
                "md5": "c635f77f338edb67cab010a74a2dfbac",
                "sha256": "e9dfc32bf2d6a24b982474641406386e6a98086a5be862fce46afca58f8d9cd9"
            },
            "downloads": -1,
            "filename": "django_initials_avatar-0.0.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c635f77f338edb67cab010a74a2dfbac",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 12160,
            "upload_time": "2023-12-25T15:25:12",
            "upload_time_iso_8601": "2023-12-25T15:25:12.585371Z",
            "url": "https://files.pythonhosted.org/packages/95/fc/70dea3600c1da431020d69635da2ee14fa2150c88e9f2b53c87c0ca8c3a7/django_initials_avatar-0.0.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f3183c6c738806b478d96fc574e2060294440b74e2c84d5479b3931e6dd68192",
                "md5": "3748320b1cb6bcee43376d0d085fd12a",
                "sha256": "108c1865d366ce5c8ade0e75723469abab74c35aaf2a3867802c772e68ec63aa"
            },
            "downloads": -1,
            "filename": "django_initials_avatar-0.0.7.tar.gz",
            "has_sig": false,
            "md5_digest": "3748320b1cb6bcee43376d0d085fd12a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 11747,
            "upload_time": "2023-12-25T15:25:14",
            "upload_time_iso_8601": "2023-12-25T15:25:14.149887Z",
            "url": "https://files.pythonhosted.org/packages/f3/18/3c6c738806b478d96fc574e2060294440b74e2c84d5479b3931e6dd68192/django_initials_avatar-0.0.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-25 15:25:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "riquedev",
    "github_project": "django-initials-avatar",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "django-initials-avatar"
}
        
Elapsed time: 0.17176s