datasette-render-images
A Datasette plugin that renders binary blob images with data-uris, using the render_cell() plugin hook.
Installation
Install this plugin in the same environment as Datasette.
$ pip install datasette-render-images
Usage
If a database row contains binary image data (PNG, GIF or JPEG), this plugin will detect that it is an image (using the imghdr module and render that cell using an <img src="data:image/png;base64,..."> element.
Here's a demo of the plugin in action.
Creating a compatible database table
You can use the sqlite-utils insert-files command to insert image files into a database table:
$ pip install sqlite-utils
$ sqlite-utils insert-files gifs.db images *.gif
See Fun with binary data and SQLite for more on this tool.
Configuration
By default the plugin will only render images that are smaller than 100KB. You can adjust this limit using the size_limit plugin configuration option - for example, to increase the limit to 1MB (1000000 bytes) use the following in metadata.json:
{
"plugins": {
"datasette-render-images": {
"size_limit": 1000000
}
}
}
Metadata
Release files for datasette-render-images 0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| datasette-render-images-0.4.tar.gz | 3.4 kB | Without provenance | Details for datasette-render-images-0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| datasette_render_images-0.4-py3-none-any.whl | Python 3 | none | any | Details for datasette_render_images-0.4-py3-none-any.whl |
Total release size: 7.1 kB
Release files / datasette-render-images-0.4.tar.gz
| Download URL | datasette-render-images-0.4.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
384ea7b7acad8f015df246d2847d5f9d4e0b98dbb20bb011c9722d27f1f8c8d4
|
|
BLAKE2b-256 checksum How to use checksums |
5dfbb81a7b969764620f35f5a9720a0fe69bedde34e18bc3dd6382e5e9aff6cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / datasette_render_images-0.4-py3-none-any.whl
| Download URL | datasette_render_images-0.4-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
337a5871a126637d706a7a8db4b2939ff6fa4f337a9e8aaeb476aca3bdb8835b
|
|
BLAKE2b-256 checksum How to use checksums |
9a4dfcec9f11d81310772543a7709983a712295bfb69c9bf2b57dedd5ea9a160
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Security for datasette-render-images 0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.