{"id":18256572,"url":"https://github.com/honmaple/flask-avatar","last_synced_at":"2025-04-04T18:30:26.097Z","repository":{"id":57430132,"uuid":"62445632","full_name":"honmaple/flask-avatar","owner":"honmaple","description":"To generate avatar for flask","archived":false,"fork":false,"pushed_at":"2018-03-03T13:42:18.000Z","size":2312,"stargazers_count":8,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-20T16:51:55.758Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/honmaple.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-02T10:23:13.000Z","updated_at":"2024-03-09T06:04:43.000Z","dependencies_parsed_at":"2022-08-26T04:00:12.690Z","dependency_job_id":null,"html_url":"https://github.com/honmaple/flask-avatar","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honmaple%2Fflask-avatar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honmaple%2Fflask-avatar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honmaple%2Fflask-avatar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honmaple%2Fflask-avatar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/honmaple","download_url":"https://codeload.github.com/honmaple/flask-avatar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247229077,"owners_count":20904976,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T10:22:37.267Z","updated_at":"2025-04-04T18:30:25.060Z","avatar_url":"https://github.com/honmaple.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"* flask-avatar\n  [[https://pypi.python.org/pypi/Flask-Avatar][https://img.shields.io/badge/pypi-v0.1.2-brightgreen.svg]]\n  [[https://pypi.python.org/pypi/Flask-Avatar][https://img.shields.io/badge/python-3.4-brightgreen.svg]]\n  [[LICENSE][https://img.shields.io/badge/license-BSD-blue.svg]]\n\n** Example\n   [[https://raw.githubusercontent.com/honmaple/flask-avatar/master/example/avatar1.png]]\n   [[https://raw.githubusercontent.com/honmaple/flask-avatar/master/example/avatar2.png]]\n   [[https://raw.githubusercontent.com/honmaple/flask-avatar/master/example/avatar3.png]]\n\n** Installation\n   To install Flask-Avatar:\n\n   #+BEGIN_SRC shell\n   pip install flask-avatar\n   #+END_SRC\n\n   Or alternatively, you can download the repository and install manually by doing:\n\n   #+BEGIN_SRC sehll\n   git clone git@github.com:honmaple/flask-avatar.git\n   cd flask-avatar\n   python setup.py install\n   #+END_SRC\n\n** Usage\n\n   #+BEGIN_SRC python\n   from flask_avatar import Avatar\n   [...]\n   Avatar(app)\n   # or use cachefunc\n   Avatar(app, cache=cachefunc)\n   #+END_SRC\n   \n   *cachefunc* must be a decorator:\n   example:\n   #+BEGIN_SRC python\n     def cachefunc(func):\n         @wrap(func)\n         def _cache(*args, **kwargs):\n             r = cacheclient.get(\"cache key\")\n             if r is not None:\n                 return r\n             return func(*args, **kwargs)\n         return _cache\n   #+END_SRC\n\n   Templates:\n\n   #+BEGIN_SRC html\n    {{ url_for('avatar',text = user.username )}}\n   #+END_SRC\n\n   or set *width* with:\n   #+BEGIN_SRC html\n    {{ url_for('avatar',text = user.username,width=60)}}\n   #+END_SRC\n\n** Config\n\n   #+BEGIN_SRC python\n   AVATAR_URL = '/avatar' #The avatar url,default '/avatar/\u003ctext\u003e/\u003cwidth\u003e'\n   AVATAR_RANGE = [0,512] #set avatar range to allow generate,if disallow,abort(404).Default [0,512]\n   #+END_SRC\n** Thanks to\n   [[https://github.com/maethor/avatar-generator][https://github.com/maethor/avatar-generator]]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhonmaple%2Fflask-avatar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhonmaple%2Fflask-avatar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhonmaple%2Fflask-avatar/lists"}