Compare commits

..

No commits in common. "main" and "v2.0a" have entirely different histories.
main ... v2.0a

266 changed files with 181 additions and 376 deletions

View File

@ -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

View File

@ -20,7 +20,7 @@ WORKDIR /app
# Copy the application code
COPY robohash/ /app/robohash/
COPY pyproject.toml .
COPY setup.py .
COPY README.md .
# Install the application in development mode

View File

@ -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/).
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
@ -152,18 +156,13 @@ with open("path/to/new/file.png", "wb") as f:
## 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 | 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.
- **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.
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.
### 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:
@ -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.
Sorry about that.
Sorry about that.

View File

@ -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/*/*",
]

View File

@ -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

View File

@ -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','.webp')):
if string.lower().endswith(('.png','.gif','.jpg','.bmp','.jpeg','.ppm','.datauri')):
format_str = string[string.rfind('.') + 1:]
if format_str.lower() == 'jpg':
format_str = 'jpeg'

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 658 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 437 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 592 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 616 KiB

View File

@ -1 +0,0 @@
blue.png

View File

@ -1 +0,0 @@
blue.png

View File

@ -1 +0,0 @@
blue.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

View File

@ -1 +0,0 @@
brown.png

View File

@ -1 +0,0 @@
brown.png

View File

@ -1 +0,0 @@
brown.png

View File

@ -1 +0,0 @@
brown.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

View File

@ -1 +0,0 @@
gray.png

View File

@ -1 +0,0 @@
gray.png

View File

@ -1 +0,0 @@
gray.png

View File

@ -1 +0,0 @@
gray.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

View File

@ -1 +0,0 @@
green.png

View File

@ -1 +0,0 @@
green.png

View File

@ -1 +0,0 @@
green.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

View File

@ -1 +0,0 @@
orange.png

View File

@ -1 +0,0 @@
orange.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

View File

@ -1 +0,0 @@
pink.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

View File

@ -1 +0,0 @@
purple.png

View File

@ -1 +0,0 @@
purple.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

View File

@ -1 +0,0 @@
red.png

View File

@ -1 +0,0 @@
red.png

View File

@ -1 +0,0 @@
red.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

View File

@ -1 +0,0 @@
yellow.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

View File

@ -1 +0,0 @@
blue.png

View File

@ -1 +0,0 @@
blue.png

View File

@ -1 +0,0 @@
blue.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

View File

@ -1 +0,0 @@
brown.png

View File

@ -1 +0,0 @@
brown.png

View File

@ -1 +0,0 @@
brown.png

View File

@ -1 +0,0 @@
brown.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

View File

@ -1 +0,0 @@
green.png

View File

@ -1 +0,0 @@
green.png

View File

@ -1 +0,0 @@
green.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

View File

@ -1 +0,0 @@
grey.png

View File

@ -1 +0,0 @@
grey.png

View File

@ -1 +0,0 @@
grey.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

View File

@ -1 +0,0 @@
orange.png

View File

@ -1 +0,0 @@
orange.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

View File

@ -1 +0,0 @@
pink.png

View File

@ -1 +0,0 @@
pink.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

View File

@ -1 +0,0 @@
purple.png

View File

@ -1 +0,0 @@
purple.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

View File

@ -1 +0,0 @@
red.png

View File

@ -1 +0,0 @@
red.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

View File

@ -1 +0,0 @@
yellow.png

View File

@ -1 +0,0 @@
yellow.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

View File

@ -1 +0,0 @@
no.png

View File

@ -1 +0,0 @@
no.png

View File

@ -1 +0,0 @@
no.png

View File

@ -1 +0,0 @@
no.png

View File

@ -1 +0,0 @@
no.png

View File

@ -1 +0,0 @@
no.png

View File

@ -1 +0,0 @@
no.png

View File

@ -1 +0,0 @@
no.png

View File

@ -1 +0,0 @@
no.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

View File

@ -1 +0,0 @@
cigar.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

View File

@ -1 +0,0 @@
cigarette.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

View File

@ -1 +0,0 @@
grin.png

View File

@ -1 +0,0 @@
grin.png

View File

@ -1 +0,0 @@
grin.png

View File

@ -1 +0,0 @@
grin.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Some files were not shown because too many files have changed in this diff Show More