datasette-render-local-images
Render local images in the system using datasette plugin
Installation
Install this plugin in the same environment as Datasette.
$ datasette install datasette-render-local-images
Usage
Render local system images in the datasette displayed HTML.
The plugin reads the image and adds the base64 encoded data to src attribute,
the cell looks like <img src="data:image/png;base64,A.." height="-1" width="-1">
By default plugin will figure out image and render with default height and width of the image.
To modify the image size and width, pass the configuration via metadata.json
{
"plugins": {
"datasette-render-local-images": {
"height": 150,
"width": 150
}
}
}
When the local image path is missing or no image specified in the path, the plugin will not render the value.
Note: While running datasette command don't forget to pass the metadata file
using -m option like datasette dataset.db -m metadata.json.
Below screenshoot is from the sample table.
Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd datasette-render-local-images
python3 -mvenv venv
source venv/bin/activate
Or if you are using pipenv:
pipenv shell
Now install the dependencies and tests:
pip install -e '.[test]'
To run the tests:
pytest
Metadata
Release files for datasette-render-local-images 0.0.8
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-local-images-0.0.8.tar.gz | 251.6 kB | Without provenance | Details for datasette-render-local-images-0.0.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| datasette_render_local_images-0.0.8-py3-none-any.whl | Python 3 | none | any | Details for datasette_render_local_images-0.0.8-py3-none-any.whl |
Total release size: 259.1 kB
Release files / datasette-render-local-images-0.0.8.tar.gz
| Download URL | datasette-render-local-images-0.0.8.tar.gz |
|---|---|
| Size | 251.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0b0c57504924c5471673b2bb129ae113ee1a41d1241902189e64abe731211db0
|
|
BLAKE2b-256 checksum How to use checksums |
2e01c7be6b4f28b99a21c44b9754d4bf9cfb0f9b14ae5b7b505e66b7e38297b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0
|
Release files / datasette_render_local_images-0.0.8-py3-none-any.whl
| Download URL | datasette_render_local_images-0.0.8-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
27676256808f5d36589e1bbf05935ea10a888d0f5a51a8db74cf0bc216e96b8a
|
|
BLAKE2b-256 checksum How to use checksums |
b7d3ba80961346dbae51b2ccca09701beeca02ed1819c7f7fd79bcfbde9c5be8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0
|
Security for datasette-render-local-images 0.0.8
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.