Compare commits
No commits in common. "v2.0a" and "main" have entirely different histories.
29
.github/workflows/gh-release.yml
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
name: Create Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
create-release:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Create GitHub Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
tag_name: ${{ github.ref_name }}
|
||||
name: Release ${{ github.ref_name }}
|
||||
body: |
|
||||
## Release ${{ github.ref_name }}
|
||||
|
||||
Source code archive for Robohash at tag ${{ github.ref_name }}.
|
||||
draft: false
|
||||
prerelease: ${{ contains(github.ref_name, '-') }}
|
||||
generate_release_notes: true
|
@ -20,7 +20,7 @@ WORKDIR /app
|
||||
|
||||
# Copy the application code
|
||||
COPY robohash/ /app/robohash/
|
||||
COPY setup.py .
|
||||
COPY pyproject.toml .
|
||||
COPY README.md .
|
||||
|
||||
# Install the application in development mode
|
||||
|
41
README.md
@ -17,35 +17,31 @@ There are several ways to use Robohash, depending on your needs:
|
||||
The easiest way to use Robohash is through the public service at [robohash.org](https://robohash.org/).
|
||||
|
||||
Super Easy to use: Anytime you need a Robohash, just embed:
|
||||
|
||||
```html
|
||||
<img src="https://robohash.org/YOUR-TEXT.png">
|
||||
<img src="https://robohash.org/YOUR-TEXT.png" />
|
||||
```
|
||||
|
||||
**URL Parameters and Advanced Options:**
|
||||
|
||||
- **Image Formats**: Want a JPG instead? Fine. PNG? Fine. Want it as a bitmap? We think you're nutty. But fine.
|
||||
Just change the extension: `https://robohash.org/hash.jpg`
|
||||
|
||||
- **Size Control**: From destroying skyscrapers to nanobots, we've got you covered.
|
||||
`https://robohash.org/hash?size=200x200`
|
||||
|
||||
- **Robot Sets**: Choose your preferred mechanical beings:
|
||||
`https://robohash.org/hash?set=set2` (set1-set5 available, or "any")
|
||||
|
||||
- **Backgrounds**: Our robots like to travel. Add a background as part of the hash:
|
||||
`https://robohash.org/hash?bgset=bg1` (bg1-bg2 available, or "any")
|
||||
|
||||
- **Gravatar Integration**: For Gravatar enthusiasts, you can ask Robohash to use a Gravatar if one is available:
|
||||
`https://robohash.org/user@example.com?gravatar=yes`
|
||||
or for pre-hashed emails: `https://robohash.org/hash?gravatar=hashed`
|
||||
|
||||
- **Directory Style Parameters**: We also accept commands via directory structure:
|
||||
`https://robohash.org/set_set3/bgset_bg1/3.14159?size=500x500`
|
||||
|
||||
- **Extension Handling**: Want to hash the whole URL including extension? Use:
|
||||
`https://robohash.org/hash.png?ignoreext=false`
|
||||
|
||||
**Important Notes:**
|
||||
|
||||
- Robohash.org is a best-effort service, not a commercial offering
|
||||
- Our robots stay speedy due to caching modules and CDN usage
|
||||
- If you receive errors or "too many requests" responses, please back off exponentially
|
||||
@ -156,13 +152,18 @@ with open("path/to/new/file.png", "wb") as f:
|
||||
|
||||
## Robosets
|
||||
|
||||
RoboHash comes with five distinct sets of mechanical/biological entities:
|
||||
RoboHash comes with distinct sets of mechanical/biological entities:
|
||||
|
||||
- **set1**: Classic robots created by Zikri Kader. The original robotic workforce.
|
||||
- **set2**: Monsters created by Hrvoje Novakovic. A whole slew of random monsters.
|
||||
- **set3**: Robot heads created by Julian Peter Arias. New, suave, disembodied heads. That's sexy. Like a robot.
|
||||
- **set4**: Cats created by David Revoy. Hydroponically grown beautiful kittens.
|
||||
- **set5**: Human avatars created by Pablo Stanley. For those afraid of the robocalypse, you can also generate human technicians to mind the robot army.
|
||||
| Set | Name | Author | Description | License |
|
||||
|------|----------------|-----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|--------------------------------------|
|
||||
| set1 | Classic robots | Zikri Kader | The original robotic workforce | CC-BY-3.0, CC-BY-4.0 |
|
||||
| set2 | Monsters | Hrvoje Novakovic | A whole slew of random monsters | CC-BY-3.0 |
|
||||
| set3 | Robot heads | Julian Peter Arias | New, suave, disembodied heads. That's sexy. Like a robot | CC-BY-3.0 |
|
||||
| set4 | Cats | [David Revoy](https://www.peppercarrot.com/extras/html/2016_cat-generator/) | Hydroponically grown beautiful kittens | CC-BY-4.0 |
|
||||
| set5 | Human avatars | [Pablo Stanley](https://avataaars.com/) | For those afraid of the robocalypse, you can also generate human technicians to mind the robot army | Free for personal and commercial use |
|
||||
| set6 | Cosmic apes | [OceanSlim](https://github.com/0ceanSlim) | Monkeying around with the fabric of space-time itself | CC0 (Public Domain) |
|
||||
|
||||
Note **set6**: This set uses additional symbolic links to implement weighted rarity distribution as the creator originally intended. Apes with laser eyes and tear drop tattoos are exceptionally rare.
|
||||
|
||||
Specify which set you want in the `assemble()` method or through URL parameters. Alternatively, specify the string "any", and RoboHash will pick an image set for you, based on the provided hash.
|
||||
|
||||
@ -174,18 +175,6 @@ The Python Code is available under the MIT/Expat license. See the `LICENSE.txt`
|
||||
|
||||
Feel free to embed the Robohash images, host your own instance of Robohash, or integrate them into your own project. If you do, please just mention where they came from :) Example wording might be "Robots lovingly delivered by Robohash.org" or similar.
|
||||
|
||||
### Image Sets Attribution
|
||||
|
||||
Robohash contains art from various talented creators:
|
||||
|
||||
- The "set1" artwork (and robohash backgrounds) were created by Zikri Kader. They are available under CC-BY-3.0 or CC-BY-4.0 license.
|
||||
- The "set2" artwork was created by Hrvoje Novakovic. They are available under CC-BY-3.0 license.
|
||||
- The "set3" artwork was created by Julian Peter Arias. They are available under CC-BY-3.0 license.
|
||||
- The Cats/"set4" were created by David Revoy, used under CC-BY-4.0 https://www.peppercarrot.com/extras/html/2016_cat-generator/
|
||||
- The avatars used in "set5" were created by Pablo Stanley, for https://avataaars.com/. They are "Free for personal and commercial use. 😇"
|
||||
|
||||
You are free to embed robots under the terms of the CC-BY license. Example wording might be "Robots lovingly delivered by Robohash.org" or something similarly respectful of our robotic overlords.
|
||||
|
||||
## Continuous Integration and Deployment
|
||||
|
||||
This project uses GitHub Actions for continuous integration and deployment:
|
||||
@ -210,4 +199,4 @@ If you find Robohash useful, I encourage you to fork it and adapt it to your nee
|
||||
|
||||
OK, I'll admit I'm a crappy programmer. Compounding this, I wrote this code initially to be internal-only. It's ugly, and could be a LOT nicer.
|
||||
|
||||
Sorry about that.
|
||||
Sorry about that.
|
||||
|
54
pyproject.toml
Normal file
@ -0,0 +1,54 @@
|
||||
[build-system]
|
||||
requires = ["setuptools>=61.0"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "robohash"
|
||||
version = "2.0"
|
||||
description = "One of the leading robot-based hashing tools on the web"
|
||||
readme = "README.md"
|
||||
license = {text = "MIT"}
|
||||
authors = [
|
||||
{name = "e1ven", email = "robo@robohash.org"}
|
||||
]
|
||||
keywords = ["robots", "avatar", "identicon"]
|
||||
classifiers = [
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.8",
|
||||
"Programming Language :: Python :: 3.9",
|
||||
"Programming Language :: Python :: 3.10",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Programming Language :: Python :: 3.12",
|
||||
"Development Status :: 5 - Production/Stable",
|
||||
"Intended Audience :: Developers",
|
||||
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
|
||||
"Topic :: Multimedia :: Graphics",
|
||||
"Topic :: Software Development :: Libraries :: Python Modules",
|
||||
"Topic :: Utilities",
|
||||
]
|
||||
requires-python = ">=3.8"
|
||||
dependencies = [
|
||||
"pillow>=9.1.1",
|
||||
"natsort>=8.1.0"
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
web = ["tornado>=6.1"]
|
||||
|
||||
[project.urls]
|
||||
Homepage = "https://github.com/e1ven/Robohash"
|
||||
Repository = "https://github.com/e1ven/Robohash"
|
||||
"Docker Images" = "https://github.com/e1ven/Robohash/pkgs/container/robohash"
|
||||
|
||||
[tool.setuptools.packages.find]
|
||||
include = ["robohash*"]
|
||||
|
||||
[tool.setuptools.package-data]
|
||||
robohash = [
|
||||
"sets/set1/*/*/*",
|
||||
"sets/set2/*/*",
|
||||
"sets/set3/*/*",
|
||||
"sets/set4/*/*",
|
||||
"sets/set5/*/*",
|
||||
"backgrounds/*/*",
|
||||
]
|
@ -2,6 +2,6 @@
|
||||
# To regenerate, run:
|
||||
# pip-compile requirements.in
|
||||
#
|
||||
pillow==9.1.1
|
||||
tornado==6.1
|
||||
natsort==8.1.0
|
||||
pillow==10.3.0
|
||||
tornado==6.5.1
|
||||
|
@ -65,7 +65,7 @@ class Robohash:
|
||||
# We'll remove them from the string before hashing.
|
||||
# This ensures that /Bear.png and /Bear.bmp will send back the same image, in different formats.
|
||||
|
||||
if string.lower().endswith(('.png','.gif','.jpg','.bmp','.jpeg','.ppm','.datauri')):
|
||||
if string.lower().endswith(('.png','.gif','.jpg','.bmp','.jpeg','.ppm','.datauri','.webp')):
|
||||
format_str = string[string.rfind('.') + 1:]
|
||||
if format_str.lower() == 'jpg':
|
||||
format_str = 'jpeg'
|
||||
|
BIN
robohash/sets/set6/000#00BG/1.png
Normal file
After Width: | Height: | Size: 158 KiB |
BIN
robohash/sets/set6/000#00BG/2.png
Normal file
After Width: | Height: | Size: 70 KiB |
BIN
robohash/sets/set6/000#00BG/3.png
Normal file
After Width: | Height: | Size: 658 KiB |
BIN
robohash/sets/set6/000#00BG/4.png
Normal file
After Width: | Height: | Size: 437 KiB |
BIN
robohash/sets/set6/000#00BG/5.png
Normal file
After Width: | Height: | Size: 592 KiB |
BIN
robohash/sets/set6/000#00BG/6.png
Normal file
After Width: | Height: | Size: 616 KiB |
1
robohash/sets/set6/000#01Fur/blue-1.png
Symbolic link
@ -0,0 +1 @@
|
||||
blue.png
|
1
robohash/sets/set6/000#01Fur/blue-2.png
Symbolic link
@ -0,0 +1 @@
|
||||
blue.png
|
1
robohash/sets/set6/000#01Fur/blue-3.png
Symbolic link
@ -0,0 +1 @@
|
||||
blue.png
|
BIN
robohash/sets/set6/000#01Fur/blue.png
Normal file
After Width: | Height: | Size: 100 KiB |
1
robohash/sets/set6/000#01Fur/brown-1.png
Symbolic link
@ -0,0 +1 @@
|
||||
brown.png
|
1
robohash/sets/set6/000#01Fur/brown-2.png
Symbolic link
@ -0,0 +1 @@
|
||||
brown.png
|
1
robohash/sets/set6/000#01Fur/brown-3.png
Symbolic link
@ -0,0 +1 @@
|
||||
brown.png
|
1
robohash/sets/set6/000#01Fur/brown-4.png
Symbolic link
@ -0,0 +1 @@
|
||||
brown.png
|
BIN
robohash/sets/set6/000#01Fur/brown.png
Normal file
After Width: | Height: | Size: 100 KiB |
1
robohash/sets/set6/000#01Fur/gray-1.png
Symbolic link
@ -0,0 +1 @@
|
||||
gray.png
|
1
robohash/sets/set6/000#01Fur/gray-2.png
Symbolic link
@ -0,0 +1 @@
|
||||
gray.png
|
1
robohash/sets/set6/000#01Fur/gray-3.png
Symbolic link
@ -0,0 +1 @@
|
||||
gray.png
|
1
robohash/sets/set6/000#01Fur/gray-4.png
Symbolic link
@ -0,0 +1 @@
|
||||
gray.png
|
BIN
robohash/sets/set6/000#01Fur/gray.png
Normal file
After Width: | Height: | Size: 93 KiB |
1
robohash/sets/set6/000#01Fur/green-1.png
Symbolic link
@ -0,0 +1 @@
|
||||
green.png
|
1
robohash/sets/set6/000#01Fur/green-2.png
Symbolic link
@ -0,0 +1 @@
|
||||
green.png
|
1
robohash/sets/set6/000#01Fur/green-3.png
Symbolic link
@ -0,0 +1 @@
|
||||
green.png
|
BIN
robohash/sets/set6/000#01Fur/green.png
Normal file
After Width: | Height: | Size: 97 KiB |
1
robohash/sets/set6/000#01Fur/orange-1.png
Symbolic link
@ -0,0 +1 @@
|
||||
orange.png
|
1
robohash/sets/set6/000#01Fur/orange-2.png
Symbolic link
@ -0,0 +1 @@
|
||||
orange.png
|
BIN
robohash/sets/set6/000#01Fur/orange.png
Normal file
After Width: | Height: | Size: 63 KiB |
1
robohash/sets/set6/000#01Fur/pink-1.png
Symbolic link
@ -0,0 +1 @@
|
||||
pink.png
|
BIN
robohash/sets/set6/000#01Fur/pink.png
Normal file
After Width: | Height: | Size: 96 KiB |
1
robohash/sets/set6/000#01Fur/purple-1.png
Symbolic link
@ -0,0 +1 @@
|
||||
purple.png
|
1
robohash/sets/set6/000#01Fur/purple-2.png
Symbolic link
@ -0,0 +1 @@
|
||||
purple.png
|
BIN
robohash/sets/set6/000#01Fur/purple.png
Normal file
After Width: | Height: | Size: 100 KiB |
1
robohash/sets/set6/000#01Fur/red-1.png
Symbolic link
@ -0,0 +1 @@
|
||||
red.png
|
1
robohash/sets/set6/000#01Fur/red-2.png
Symbolic link
@ -0,0 +1 @@
|
||||
red.png
|
1
robohash/sets/set6/000#01Fur/red-3.png
Symbolic link
@ -0,0 +1 @@
|
||||
red.png
|
BIN
robohash/sets/set6/000#01Fur/red.png
Normal file
After Width: | Height: | Size: 81 KiB |
BIN
robohash/sets/set6/000#01Fur/white.png
Normal file
After Width: | Height: | Size: 88 KiB |
1
robohash/sets/set6/000#01Fur/yellow-1.png
Symbolic link
@ -0,0 +1 @@
|
||||
yellow.png
|
BIN
robohash/sets/set6/000#01Fur/yellow.png
Normal file
After Width: | Height: | Size: 74 KiB |
1
robohash/sets/set6/001#02Eyes/blue-1.png
Symbolic link
@ -0,0 +1 @@
|
||||
blue.png
|
1
robohash/sets/set6/001#02Eyes/blue-2.png
Symbolic link
@ -0,0 +1 @@
|
||||
blue.png
|
1
robohash/sets/set6/001#02Eyes/blue-3.png
Symbolic link
@ -0,0 +1 @@
|
||||
blue.png
|
BIN
robohash/sets/set6/001#02Eyes/blue.png
Normal file
After Width: | Height: | Size: 17 KiB |
1
robohash/sets/set6/001#02Eyes/brown-1.png
Symbolic link
@ -0,0 +1 @@
|
||||
brown.png
|
1
robohash/sets/set6/001#02Eyes/brown-2.png
Symbolic link
@ -0,0 +1 @@
|
||||
brown.png
|
1
robohash/sets/set6/001#02Eyes/brown-3.png
Symbolic link
@ -0,0 +1 @@
|
||||
brown.png
|
1
robohash/sets/set6/001#02Eyes/brown-4.png
Symbolic link
@ -0,0 +1 @@
|
||||
brown.png
|
BIN
robohash/sets/set6/001#02Eyes/brown.png
Normal file
After Width: | Height: | Size: 17 KiB |
1
robohash/sets/set6/001#02Eyes/green-1.png
Symbolic link
@ -0,0 +1 @@
|
||||
green.png
|
1
robohash/sets/set6/001#02Eyes/green-2.png
Symbolic link
@ -0,0 +1 @@
|
||||
green.png
|
1
robohash/sets/set6/001#02Eyes/green-3.png
Symbolic link
@ -0,0 +1 @@
|
||||
green.png
|
BIN
robohash/sets/set6/001#02Eyes/green.png
Normal file
After Width: | Height: | Size: 17 KiB |
1
robohash/sets/set6/001#02Eyes/grey-1.png
Symbolic link
@ -0,0 +1 @@
|
||||
grey.png
|
1
robohash/sets/set6/001#02Eyes/grey-2.png
Symbolic link
@ -0,0 +1 @@
|
||||
grey.png
|
1
robohash/sets/set6/001#02Eyes/grey-3.png
Symbolic link
@ -0,0 +1 @@
|
||||
grey.png
|
BIN
robohash/sets/set6/001#02Eyes/grey.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
robohash/sets/set6/001#02Eyes/nopupil.png
Normal file
After Width: | Height: | Size: 17 KiB |
1
robohash/sets/set6/001#02Eyes/orange-1.png
Symbolic link
@ -0,0 +1 @@
|
||||
orange.png
|
1
robohash/sets/set6/001#02Eyes/orange-2.png
Symbolic link
@ -0,0 +1 @@
|
||||
orange.png
|
BIN
robohash/sets/set6/001#02Eyes/orange.png
Normal file
After Width: | Height: | Size: 17 KiB |
1
robohash/sets/set6/001#02Eyes/pink-1.png
Symbolic link
@ -0,0 +1 @@
|
||||
pink.png
|
1
robohash/sets/set6/001#02Eyes/pink-2.png
Symbolic link
@ -0,0 +1 @@
|
||||
pink.png
|
BIN
robohash/sets/set6/001#02Eyes/pink.png
Normal file
After Width: | Height: | Size: 17 KiB |
1
robohash/sets/set6/001#02Eyes/purple-1.png
Symbolic link
@ -0,0 +1 @@
|
||||
purple.png
|
1
robohash/sets/set6/001#02Eyes/purple-2.png
Symbolic link
@ -0,0 +1 @@
|
||||
purple.png
|
BIN
robohash/sets/set6/001#02Eyes/purple.png
Normal file
After Width: | Height: | Size: 17 KiB |
1
robohash/sets/set6/001#02Eyes/red-1.png
Symbolic link
@ -0,0 +1 @@
|
||||
red.png
|
1
robohash/sets/set6/001#02Eyes/red-2.png
Symbolic link
@ -0,0 +1 @@
|
||||
red.png
|
BIN
robohash/sets/set6/001#02Eyes/red.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
robohash/sets/set6/001#02Eyes/swirleye.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
robohash/sets/set6/001#02Eyes/xeye.png
Normal file
After Width: | Height: | Size: 17 KiB |
1
robohash/sets/set6/001#02Eyes/yellow-1.png
Symbolic link
@ -0,0 +1 @@
|
||||
yellow.png
|
1
robohash/sets/set6/001#02Eyes/yellow-2.png
Symbolic link
@ -0,0 +1 @@
|
||||
yellow.png
|
BIN
robohash/sets/set6/001#02Eyes/yellow.png
Normal file
After Width: | Height: | Size: 17 KiB |
1
robohash/sets/set6/002#03Bloodshot/no-1.png
Symbolic link
@ -0,0 +1 @@
|
||||
no.png
|
1
robohash/sets/set6/002#03Bloodshot/no-2.png
Symbolic link
@ -0,0 +1 @@
|
||||
no.png
|
1
robohash/sets/set6/002#03Bloodshot/no-3.png
Symbolic link
@ -0,0 +1 @@
|
||||
no.png
|
1
robohash/sets/set6/002#03Bloodshot/no-4.png
Symbolic link
@ -0,0 +1 @@
|
||||
no.png
|
1
robohash/sets/set6/002#03Bloodshot/no-5.png
Symbolic link
@ -0,0 +1 @@
|
||||
no.png
|
1
robohash/sets/set6/002#03Bloodshot/no-6.png
Symbolic link
@ -0,0 +1 @@
|
||||
no.png
|
1
robohash/sets/set6/002#03Bloodshot/no-7.png
Symbolic link
@ -0,0 +1 @@
|
||||
no.png
|
1
robohash/sets/set6/002#03Bloodshot/no-8.png
Symbolic link
@ -0,0 +1 @@
|
||||
no.png
|
1
robohash/sets/set6/002#03Bloodshot/no-9.png
Symbolic link
@ -0,0 +1 @@
|
||||
no.png
|
BIN
robohash/sets/set6/002#03Bloodshot/no.png
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
robohash/sets/set6/002#03Bloodshot/yes.png
Normal file
After Width: | Height: | Size: 15 KiB |
1
robohash/sets/set6/003#Mouth/cigar-1.png
Symbolic link
@ -0,0 +1 @@
|
||||
cigar.png
|
BIN
robohash/sets/set6/003#Mouth/cigar.png
Normal file
After Width: | Height: | Size: 21 KiB |
1
robohash/sets/set6/003#Mouth/cigarette-1.png
Symbolic link
@ -0,0 +1 @@
|
||||
cigarette.png
|
BIN
robohash/sets/set6/003#Mouth/cigarette.png
Normal file
After Width: | Height: | Size: 13 KiB |
1
robohash/sets/set6/003#Mouth/grin-1.png
Symbolic link
@ -0,0 +1 @@
|
||||
grin.png
|
1
robohash/sets/set6/003#Mouth/grin-2.png
Symbolic link
@ -0,0 +1 @@
|
||||
grin.png
|
1
robohash/sets/set6/003#Mouth/grin-3.png
Symbolic link
@ -0,0 +1 @@
|
||||
grin.png
|
1
robohash/sets/set6/003#Mouth/grin-4.png
Symbolic link
@ -0,0 +1 @@
|
||||
grin.png
|
BIN
robohash/sets/set6/003#Mouth/grin.png
Normal file
After Width: | Height: | Size: 16 KiB |