Compare commits
No commits in common. "main" and "v2.0a" have entirely different histories.
29
.github/workflows/gh-release.yml
vendored
@ -1,29 +0,0 @@
|
|||||||
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 the application code
|
||||||
COPY robohash/ /app/robohash/
|
COPY robohash/ /app/robohash/
|
||||||
COPY pyproject.toml .
|
COPY setup.py .
|
||||||
COPY README.md .
|
COPY README.md .
|
||||||
|
|
||||||
# Install the application in development mode
|
# Install the application in development mode
|
||||||
|
41
README.md
@ -17,31 +17,35 @@ 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/).
|
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:
|
Super Easy to use: Anytime you need a Robohash, just embed:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<img src="https://robohash.org/YOUR-TEXT.png" />
|
<img src="https://robohash.org/YOUR-TEXT.png">
|
||||||
```
|
```
|
||||||
|
|
||||||
**URL Parameters and Advanced Options:**
|
**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.
|
- **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`
|
Just change the extension: `https://robohash.org/hash.jpg`
|
||||||
|
|
||||||
- **Size Control**: From destroying skyscrapers to nanobots, we've got you covered.
|
- **Size Control**: From destroying skyscrapers to nanobots, we've got you covered.
|
||||||
`https://robohash.org/hash?size=200x200`
|
`https://robohash.org/hash?size=200x200`
|
||||||
|
|
||||||
- **Robot Sets**: Choose your preferred mechanical beings:
|
- **Robot Sets**: Choose your preferred mechanical beings:
|
||||||
`https://robohash.org/hash?set=set2` (set1-set5 available, or "any")
|
`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:
|
- **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")
|
`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:
|
- **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`
|
`https://robohash.org/user@example.com?gravatar=yes`
|
||||||
or for pre-hashed emails: `https://robohash.org/hash?gravatar=hashed`
|
or for pre-hashed emails: `https://robohash.org/hash?gravatar=hashed`
|
||||||
|
|
||||||
- **Directory Style Parameters**: We also accept commands via directory structure:
|
- **Directory Style Parameters**: We also accept commands via directory structure:
|
||||||
`https://robohash.org/set_set3/bgset_bg1/3.14159?size=500x500`
|
`https://robohash.org/set_set3/bgset_bg1/3.14159?size=500x500`
|
||||||
|
|
||||||
- **Extension Handling**: Want to hash the whole URL including extension? Use:
|
- **Extension Handling**: Want to hash the whole URL including extension? Use:
|
||||||
`https://robohash.org/hash.png?ignoreext=false`
|
`https://robohash.org/hash.png?ignoreext=false`
|
||||||
|
|
||||||
**Important Notes:**
|
**Important Notes:**
|
||||||
|
|
||||||
- Robohash.org is a best-effort service, not a commercial offering
|
- Robohash.org is a best-effort service, not a commercial offering
|
||||||
- Our robots stay speedy due to caching modules and CDN usage
|
- Our robots stay speedy due to caching modules and CDN usage
|
||||||
- If you receive errors or "too many requests" responses, please back off exponentially
|
- If you receive errors or "too many requests" responses, please back off exponentially
|
||||||
@ -152,18 +156,13 @@ with open("path/to/new/file.png", "wb") as f:
|
|||||||
|
|
||||||
## Robosets
|
## Robosets
|
||||||
|
|
||||||
RoboHash comes with distinct sets of mechanical/biological entities:
|
RoboHash comes with five distinct sets of mechanical/biological entities:
|
||||||
|
|
||||||
| Set | Name | Author | Description | License |
|
- **set1**: Classic robots created by Zikri Kader. The original robotic workforce.
|
||||||
|------|----------------|-----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|--------------------------------------|
|
- **set2**: Monsters created by Hrvoje Novakovic. A whole slew of random monsters.
|
||||||
| set1 | Classic robots | Zikri Kader | The original robotic workforce | CC-BY-3.0, CC-BY-4.0 |
|
- **set3**: Robot heads created by Julian Peter Arias. New, suave, disembodied heads. That's sexy. Like a robot.
|
||||||
| set2 | Monsters | Hrvoje Novakovic | A whole slew of random monsters | CC-BY-3.0 |
|
- **set4**: Cats created by David Revoy. Hydroponically grown beautiful kittens.
|
||||||
| set3 | Robot heads | Julian Peter Arias | New, suave, disembodied heads. That's sexy. Like a robot | CC-BY-3.0 |
|
- **set5**: Human avatars created by Pablo Stanley. For those afraid of the robocalypse, you can also generate human technicians to mind the robot army.
|
||||||
| 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.
|
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.
|
||||||
|
|
||||||
@ -175,6 +174,18 @@ 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.
|
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
|
## Continuous Integration and Deployment
|
||||||
|
|
||||||
This project uses GitHub Actions for continuous integration and deployment:
|
This project uses GitHub Actions for continuous integration and deployment:
|
||||||
@ -199,4 +210,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.
|
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.
|
@ -1,54 +0,0 @@
|
|||||||
[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:
|
# To regenerate, run:
|
||||||
# pip-compile requirements.in
|
# pip-compile requirements.in
|
||||||
#
|
#
|
||||||
|
pillow==9.1.1
|
||||||
|
tornado==6.1
|
||||||
natsort==8.1.0
|
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.
|
# 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.
|
# 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','.webp')):
|
if string.lower().endswith(('.png','.gif','.jpg','.bmp','.jpeg','.ppm','.datauri')):
|
||||||
format_str = string[string.rfind('.') + 1:]
|
format_str = string[string.rfind('.') + 1:]
|
||||||
if format_str.lower() == 'jpg':
|
if format_str.lower() == 'jpg':
|
||||||
format_str = 'jpeg'
|
format_str = 'jpeg'
|
||||||
|
Before Width: | Height: | Size: 158 KiB |
Before Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 658 KiB |
Before Width: | Height: | Size: 437 KiB |
Before Width: | Height: | Size: 592 KiB |
Before Width: | Height: | Size: 616 KiB |
@ -1 +0,0 @@
|
|||||||
blue.png
|
|
@ -1 +0,0 @@
|
|||||||
blue.png
|
|
@ -1 +0,0 @@
|
|||||||
blue.png
|
|
Before Width: | Height: | Size: 100 KiB |
@ -1 +0,0 @@
|
|||||||
brown.png
|
|
@ -1 +0,0 @@
|
|||||||
brown.png
|
|
@ -1 +0,0 @@
|
|||||||
brown.png
|
|
@ -1 +0,0 @@
|
|||||||
brown.png
|
|
Before Width: | Height: | Size: 100 KiB |
@ -1 +0,0 @@
|
|||||||
gray.png
|
|
@ -1 +0,0 @@
|
|||||||
gray.png
|
|
@ -1 +0,0 @@
|
|||||||
gray.png
|
|
@ -1 +0,0 @@
|
|||||||
gray.png
|
|
Before Width: | Height: | Size: 93 KiB |
@ -1 +0,0 @@
|
|||||||
green.png
|
|
@ -1 +0,0 @@
|
|||||||
green.png
|
|
@ -1 +0,0 @@
|
|||||||
green.png
|
|
Before Width: | Height: | Size: 97 KiB |
@ -1 +0,0 @@
|
|||||||
orange.png
|
|
@ -1 +0,0 @@
|
|||||||
orange.png
|
|
Before Width: | Height: | Size: 63 KiB |
@ -1 +0,0 @@
|
|||||||
pink.png
|
|
Before Width: | Height: | Size: 96 KiB |
@ -1 +0,0 @@
|
|||||||
purple.png
|
|
@ -1 +0,0 @@
|
|||||||
purple.png
|
|
Before Width: | Height: | Size: 100 KiB |
@ -1 +0,0 @@
|
|||||||
red.png
|
|
@ -1 +0,0 @@
|
|||||||
red.png
|
|
@ -1 +0,0 @@
|
|||||||
red.png
|
|
Before Width: | Height: | Size: 81 KiB |
Before Width: | Height: | Size: 88 KiB |
@ -1 +0,0 @@
|
|||||||
yellow.png
|
|
Before Width: | Height: | Size: 74 KiB |
@ -1 +0,0 @@
|
|||||||
blue.png
|
|
@ -1 +0,0 @@
|
|||||||
blue.png
|
|
@ -1 +0,0 @@
|
|||||||
blue.png
|
|
Before Width: | Height: | Size: 17 KiB |
@ -1 +0,0 @@
|
|||||||
brown.png
|
|
@ -1 +0,0 @@
|
|||||||
brown.png
|
|
@ -1 +0,0 @@
|
|||||||
brown.png
|
|
@ -1 +0,0 @@
|
|||||||
brown.png
|
|
Before Width: | Height: | Size: 17 KiB |
@ -1 +0,0 @@
|
|||||||
green.png
|
|
@ -1 +0,0 @@
|
|||||||
green.png
|
|
@ -1 +0,0 @@
|
|||||||
green.png
|
|
Before Width: | Height: | Size: 17 KiB |
@ -1 +0,0 @@
|
|||||||
grey.png
|
|
@ -1 +0,0 @@
|
|||||||
grey.png
|
|
@ -1 +0,0 @@
|
|||||||
grey.png
|
|
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 17 KiB |
@ -1 +0,0 @@
|
|||||||
orange.png
|
|
@ -1 +0,0 @@
|
|||||||
orange.png
|
|
Before Width: | Height: | Size: 17 KiB |
@ -1 +0,0 @@
|
|||||||
pink.png
|
|
@ -1 +0,0 @@
|
|||||||
pink.png
|
|
Before Width: | Height: | Size: 17 KiB |
@ -1 +0,0 @@
|
|||||||
purple.png
|
|
@ -1 +0,0 @@
|
|||||||
purple.png
|
|
Before Width: | Height: | Size: 17 KiB |
@ -1 +0,0 @@
|
|||||||
red.png
|
|
@ -1 +0,0 @@
|
|||||||
red.png
|
|
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 17 KiB |
@ -1 +0,0 @@
|
|||||||
yellow.png
|
|
@ -1 +0,0 @@
|
|||||||
yellow.png
|
|
Before Width: | Height: | Size: 17 KiB |
@ -1 +0,0 @@
|
|||||||
no.png
|
|
@ -1 +0,0 @@
|
|||||||
no.png
|
|
@ -1 +0,0 @@
|
|||||||
no.png
|
|
@ -1 +0,0 @@
|
|||||||
no.png
|
|
@ -1 +0,0 @@
|
|||||||
no.png
|
|
@ -1 +0,0 @@
|
|||||||
no.png
|
|
@ -1 +0,0 @@
|
|||||||
no.png
|
|
@ -1 +0,0 @@
|
|||||||
no.png
|
|
@ -1 +0,0 @@
|
|||||||
no.png
|
|
Before Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 15 KiB |
@ -1 +0,0 @@
|
|||||||
cigar.png
|
|
Before Width: | Height: | Size: 21 KiB |
@ -1 +0,0 @@
|
|||||||
cigarette.png
|
|
Before Width: | Height: | Size: 13 KiB |
@ -1 +0,0 @@
|
|||||||
grin.png
|
|
@ -1 +0,0 @@
|
|||||||
grin.png
|
|
@ -1 +0,0 @@
|
|||||||
grin.png
|
|
@ -1 +0,0 @@
|
|||||||
grin.png
|
|
Before Width: | Height: | Size: 16 KiB |