|
| 1 | +RoboHash |
| 2 | +======== |
| 3 | + |
| 4 | +The source code for `RoboHash.org`_. |
| 5 | + |
| 6 | +It basically copy/pastes various robot pictures together, using bits |
| 7 | +from the SHA hash. It's not perfect, and not entirely secure, but it |
| 8 | +gives a good gut-check to "Hey, this SHA is wrong." |
| 9 | + |
| 10 | +Install |
| 11 | +------- |
| 12 | + |
| 13 | +Just the library: |
| 14 | + |
| 15 | +.. code:: bash |
| 16 | +
|
| 17 | + $ pip install robohash |
| 18 | +
|
| 19 | +Or if you also want the web frontend: |
| 20 | + |
| 21 | +.. code:: bash |
| 22 | +
|
| 23 | + $ pip install robohash[web] |
| 24 | +
|
| 25 | +Usage |
| 26 | +----- |
| 27 | + |
| 28 | +.. code:: python |
| 29 | +
|
| 30 | + from robohash import Robohash |
| 31 | +
|
| 32 | + hash = "whatever-hash-you-want" |
| 33 | + rh = Robohash(hash) |
| 34 | + rh.assemble(roboset='any') |
| 35 | + with open("path/to/new/file.png", "wb") as f: |
| 36 | + rh.img.save(f, format="png") |
| 37 | +
|
| 38 | +Robosets |
| 39 | +-------- |
| 40 | + |
| 41 | +RoboHash comes with five image sets, named "set1", "set2", "set3", "set4" and "set5". |
| 42 | +Specify which set you want in the ``assemble()`` method. Alternatively, |
| 43 | +specify the string "any", and RoboHash will pick an image set for you, |
| 44 | +based on the provided hash. |
| 45 | + |
| 46 | + |
| 47 | +License |
| 48 | +------- |
| 49 | + |
| 50 | +The Python Code is available under the MIT/Expat license. See the |
| 51 | +``LICENSE.txt`` file for the full text of this license. Copyright (c) |
| 52 | +2011, Colin Davis. |
| 53 | + |
| 54 | +The RoboHash images are available under license- |
| 55 | + |
| 56 | +The "set1" artwork was created by Zikri Kader. |
| 57 | +They are available under CC-BY-3.0 or CC-BY-4.0 license. |
| 58 | + |
| 59 | +The "set2" artwork was created by Hrvoje Novakovic. |
| 60 | +They are available under CC-BY-3.0 license. |
| 61 | + |
| 62 | +The "set3" artwork was created by Julian Peter Arias. |
| 63 | +They are available under CC-BY-3.0 license. |
| 64 | + |
| 65 | +The Cats/"set4" were created by David Revoy, used under CC-BY-4.0 |
| 66 | +https://www.peppercarrot.com/en/article391/cat-avatar-generator |
| 67 | + |
| 68 | +The avatars used in "set5" were created by Pablo Stanley, for https://avataaars.com/ |
| 69 | +They are "Free for personal and commercial use. 😇" |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | +Disclaimer |
| 75 | +---------- |
| 76 | + |
| 77 | +OK, I'll admit I'm a crappy programmer. Compounding this, I wrote this |
| 78 | +code initially to be internal-only. It's ugly, and could be a LOT nicer. |
| 79 | + |
| 80 | +Sorry about that. |
| 81 | + |
| 82 | +.. _RoboHash.org: https://robohash.org/ |
0 commit comments