Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

avatarsio

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

avatarsio

Avatar picker and uploader for Avatars.io

  • 0.1
  • PyPI
  • Socket score

Maintainers
1

avatars-io-python

Python avatar picker and uploader for Avatars.io.

Current version of avatarsio is 0.1; it's stable.

Requirements, dependencies

avatarsio supports both Python 2 and Python 3 and is on PyPi.

As described in requirements.txt, the only dependency is requests (HTTP for humans, because, well, it is awesome and should be built-in).

You can install it from source or using pip (eg. in a virtualenv):

pip install avatarsio

Usage

You don't really need the lib if you just want to get user avatars from services such as Twitter of Facebook. Just use the corresponding URL as explained on avatars.io.

The lib is useful for custom avatar upload. You need first to register an app on Chute. Then, it's quite straightforward:

>>> from avatarsio import AvatarsIO
>>> avtio = AvatarsIO('my-client-id', 'my-access-token')

# With a file name:
>>> avtio.upload('kitten.png')
"http://avatars.io/4fb6de143d242d44da000001/hashashash"

# With a file object:
>>> fobj = open('kitten.png', 'rb')
>>> avtio.upload(fobj)
"http://avatars.io/4fb6de143d242d44da000001/hashashash"

# You can give a custom identifer:
>>> avtio.upload('kitten.png', 'my-identifier')
"http://avatars.io/4fb6de143d242d44da000001/my-identifier"

# And obviously, build sersvice avatar URLs:
# (but sersiouly, you don't need the lib for that)
>>> AvatarsIO.avatar_url('twitter', 'my-identifier')
"http://avatars.io/twitter/my-identifier"

Licence

MIT

Extra stuff

Feel free to submit bug reports and improvements on the bug tracker.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc