<div align="center">
<h1 align="center">ggallery</h1>
</div>
[](https://creeston.github.io/ggallery)
`ggallery` is a Python tool that generates a static HTML photo gallery website from a YAML specification and from given renderer plugin. It allows you to create beautiful and customizable photo galleries with ease, using various data sources and storage providers.
## Features
- **Static HTML Generation using plugins**: Create a static HTML photo gallery that can be hosted on any web server, using a custom renderer plugin.
- **Multiple Data Sources**: Supports local file system and Azure Blob Storage as data sources.
- **Thumbnail Generation**: Automatically generate thumbnails for your images.
- **Docker image creation**: Create a Docker image (using nginx) with the generated gallery.
## Available Renderer Plugins
- https://github.com/creeston/ggallery-nanogallery2 - template built on top of nanogallery2 and bulma css framework. [Live Demo](https://creeston.github.io/ggallery-nanogallery2/)
## Usage
To install `ggallery`, you need to have Python with pip package manager in your system.
Then you can install the tool using the following command:
```sh
pip install ggallery
```
You can run the `ggallery` using the following commands:
```sh
python -m ggallery -f /path/to/your/gallery.yaml
```
or
```sh
ggallery -f /path/to/your/gallery.yaml
```
If you have the `gallery.yaml` file in the current directory, you can run the tool without specifying the file path:
```sh
ggallery
```
## Gallery Specification Examples
### Local Gallery with Docker Image
Photos and HTML files are stored in the same directory as the static website. It will procude a directory ready to be served by a web server.
1. Set environment variables (or create .env file)
- `LOCAL_PHOTOS_PATH`: Path to the directory containing photos.
- `DOCKER_HOST` Hostname of the Docker host. (e.g tcp://localhost:2375)
2. Create a `gallery.yaml` file with the following content:
```yaml
title: Local Gallery
subtitle: Gallery with photos stored in the same directory as static website.
thumbnail:
height: 400
template:
url: https://github.com/creeston/ggallery-nanogallery2
data_source:
type: local
path: "${LOCAL_PHOTOS_PATH}" # Path to the directory containing photos.
data_storage:
type: local # Store photos in the same directory as the static website.
albums:
- title: "Japan"
subtitle: "Photos from my trip to Japan"
source: "japan"
cover: "view on the Fuji.jpg"
- title: "Italy"
source: "italy"
cover: "colliseum.jpg"
photos:
- title: "View at the Colosseum at night"
source: "colliseum.jpg"
# Output directory for the generated gallery website.
output:
path: docs
index: index.html
# Docker image configuration
docker:
image_name: "username/my-photo-gallery"
image_version: "latest"
host: "${DOCKER_HOST}"
```
### Azure Blob Storage Example
Photos are stored in Azure Blob Storage. The generated gallery will contain links to the photos stored in Azure Blob Storage.
1. Set environment variables (or create .env file)
- `LOCAL_PHOTOS_PATH`: Path to the directory containing photos.
- `AZURE_CONTAINER`: Azure Blob Storage container name.
- `AZURE_CONNECTION_STRING`: Azure Blob Storage connection string.
2. Create a `gallery.yaml` file with the following content:
```yaml
title: Azure Gallery
subtitle: Gallery of photos stored in Azure Blob Storage
favicon:
type: fontawesome
name: camera-retro
thumbnail:
height: 400
template:
url: https://github.com/creeston/ggallery-nanogallery2
data_source:
type: local
path: "${LOCAL_PHOTOS_PATH}"
# Azure Blob Storage configuration, used to store photos and thumbnails.
data_storage:
type: azure-blob
container: "${AZURE_CONTAINER}"
connection_string: "${AZURE_CONNECTION_STRING}"
albums:
- title: "Japan"
subtitle: "Photos from my trip to Japan"
source: "japan"
cover: "view on the Fuji.jpg"
- title: "Italy"
source: "italy"
cover: "colliseum.jpg"
photos:
- title: "View at the Colosseum at night"
source: "colliseum.jpg"
output:
path: docs
index: index.html
```
## Implementing a Custom Template
ggallery doesn't contain any templates by default. You can create your own plugin by implementing `ggalllery.renderers.BaseRenderer` class. The plugin can be stored either locally or in a public github repository. URL to the repository should be provided in the `gallery.yaml` file in the `template.url` field.
Examples:
- https://github.com/creeston/ggallery-nanogallery2
## Contribution
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request on the [GitHub repository](https://github.com/creeston/ggallery).
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
Raw data
{
"_id": null,
"home_page": "https://github.com/creeston/ggallery",
"name": "ggallery",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "static html photo gallery generator",
"author": "Radzivon Chorny",
"author_email": "mityy2012@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/72/6b/2d87b423814a1884969cf9b6075eb276841a3eb13fafc35382fa1175c3c9/ggallery-1.1.1.tar.gz",
"platform": null,
"description": "<div align=\"center\">\r\n <h1 align=\"center\">ggallery</h1>\r\n</div>\r\n\r\n\r\n[](https://creeston.github.io/ggallery)\r\n\r\n`ggallery` is a Python tool that generates a static HTML photo gallery website from a YAML specification and from given renderer plugin. It allows you to create beautiful and customizable photo galleries with ease, using various data sources and storage providers.\r\n\r\n## Features\r\n\r\n- **Static HTML Generation using plugins**: Create a static HTML photo gallery that can be hosted on any web server, using a custom renderer plugin.\r\n- **Multiple Data Sources**: Supports local file system and Azure Blob Storage as data sources.\r\n- **Thumbnail Generation**: Automatically generate thumbnails for your images.\r\n- **Docker image creation**: Create a Docker image (using nginx) with the generated gallery.\r\n\r\n## Available Renderer Plugins\r\n\r\n- https://github.com/creeston/ggallery-nanogallery2 - template built on top of nanogallery2 and bulma css framework. [Live Demo](https://creeston.github.io/ggallery-nanogallery2/)\r\n\r\n## Usage\r\n\r\nTo install `ggallery`, you need to have Python with pip package manager in your system. \r\nThen you can install the tool using the following command:\r\n\r\n```sh\r\npip install ggallery\r\n```\r\n\r\nYou can run the `ggallery` using the following commands:\r\n\r\n```sh\r\npython -m ggallery -f /path/to/your/gallery.yaml\r\n```\r\n\r\nor\r\n\r\n```sh\r\nggallery -f /path/to/your/gallery.yaml\r\n```\r\n\r\nIf you have the `gallery.yaml` file in the current directory, you can run the tool without specifying the file path:\r\n\r\n```sh\r\nggallery\r\n```\r\n\r\n## Gallery Specification Examples\r\n\r\n### Local Gallery with Docker Image\r\n\r\nPhotos and HTML files are stored in the same directory as the static website. It will procude a directory ready to be served by a web server.\r\n\r\n1. Set environment variables (or create .env file)\r\n\r\n- `LOCAL_PHOTOS_PATH`: Path to the directory containing photos.\r\n- `DOCKER_HOST` Hostname of the Docker host. (e.g tcp://localhost:2375)\r\n\r\n2. Create a `gallery.yaml` file with the following content:\r\n\r\n```yaml\r\ntitle: Local Gallery\r\nsubtitle: Gallery with photos stored in the same directory as static website.\r\n\r\nthumbnail:\r\n height: 400\r\n\r\ntemplate:\r\n url: https://github.com/creeston/ggallery-nanogallery2\r\n\r\ndata_source:\r\n type: local\r\n path: \"${LOCAL_PHOTOS_PATH}\" # Path to the directory containing photos.\r\n\r\ndata_storage:\r\n type: local # Store photos in the same directory as the static website.\r\n\r\nalbums:\r\n - title: \"Japan\"\r\n subtitle: \"Photos from my trip to Japan\"\r\n source: \"japan\"\r\n cover: \"view on the Fuji.jpg\"\r\n\r\n - title: \"Italy\"\r\n source: \"italy\"\r\n cover: \"colliseum.jpg\"\r\n photos:\r\n - title: \"View at the Colosseum at night\"\r\n source: \"colliseum.jpg\"\r\n\r\n# Output directory for the generated gallery website.\r\noutput:\r\n path: docs\r\n index: index.html\r\n\r\n# Docker image configuration\r\ndocker:\r\n image_name: \"username/my-photo-gallery\"\r\n image_version: \"latest\"\r\n host: \"${DOCKER_HOST}\"\r\n```\r\n\r\n### Azure Blob Storage Example\r\n\r\nPhotos are stored in Azure Blob Storage. The generated gallery will contain links to the photos stored in Azure Blob Storage.\r\n\r\n1. Set environment variables (or create .env file)\r\n\r\n- `LOCAL_PHOTOS_PATH`: Path to the directory containing photos.\r\n- `AZURE_CONTAINER`: Azure Blob Storage container name.\r\n- `AZURE_CONNECTION_STRING`: Azure Blob Storage connection string.\r\n\r\n2. Create a `gallery.yaml` file with the following content:\r\n\r\n```yaml\r\ntitle: Azure Gallery\r\nsubtitle: Gallery of photos stored in Azure Blob Storage\r\n\r\nfavicon:\r\n type: fontawesome\r\n name: camera-retro\r\n\r\nthumbnail:\r\n height: 400\r\n\r\ntemplate:\r\n url: https://github.com/creeston/ggallery-nanogallery2\r\n\r\ndata_source:\r\n type: local\r\n path: \"${LOCAL_PHOTOS_PATH}\"\r\n\r\n# Azure Blob Storage configuration, used to store photos and thumbnails.\r\ndata_storage:\r\n type: azure-blob\r\n container: \"${AZURE_CONTAINER}\"\r\n connection_string: \"${AZURE_CONNECTION_STRING}\"\r\n\r\nalbums:\r\n - title: \"Japan\"\r\n subtitle: \"Photos from my trip to Japan\"\r\n source: \"japan\"\r\n cover: \"view on the Fuji.jpg\"\r\n\r\n - title: \"Italy\"\r\n source: \"italy\"\r\n cover: \"colliseum.jpg\"\r\n photos:\r\n - title: \"View at the Colosseum at night\"\r\n source: \"colliseum.jpg\"\r\n\r\noutput:\r\n path: docs\r\n index: index.html\r\n```\r\n\r\n## Implementing a Custom Template\r\n\r\nggallery doesn't contain any templates by default. You can create your own plugin by implementing `ggalllery.renderers.BaseRenderer` class. The plugin can be stored either locally or in a public github repository. URL to the repository should be provided in the `gallery.yaml` file in the `template.url` field.\r\n\r\n\r\nExamples:\r\n- https://github.com/creeston/ggallery-nanogallery2\r\n\r\n\r\n## Contribution\r\n\r\nContributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request on the [GitHub repository](https://github.com/creeston/ggallery).\r\n\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\r\n",
"bugtrack_url": null,
"license": null,
"summary": "A tool to generate static HTML photo galleries from various data sources.",
"version": "1.1.1",
"project_urls": {
"Documentation": "https://github.com/creeston/ggallery",
"Homepage": "https://github.com/creeston/ggallery",
"Source": "https://github.com/creeston/ggallery",
"Tracker": "https://github.com/creeston/ggallery/issues"
},
"split_keywords": [
"static",
"html",
"photo",
"gallery",
"generator"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "324e28b5c220603fd3d0c2de1a720469a78e392e3dea6fd6a61085fc67099a15",
"md5": "1435c46bf086643f61eec6641264bda0",
"sha256": "290a4714ce91c03eb5358a6625ddd269844d1d8cc9efdaa77a25ab0c9686cf49"
},
"downloads": -1,
"filename": "ggallery-1.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1435c46bf086643f61eec6641264bda0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 17039,
"upload_time": "2025-03-21T17:11:45",
"upload_time_iso_8601": "2025-03-21T17:11:45.570779Z",
"url": "https://files.pythonhosted.org/packages/32/4e/28b5c220603fd3d0c2de1a720469a78e392e3dea6fd6a61085fc67099a15/ggallery-1.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "726b2d87b423814a1884969cf9b6075eb276841a3eb13fafc35382fa1175c3c9",
"md5": "ca9de11681b69606f05962b322949c20",
"sha256": "11815f762fd0c0254b6608424c0c52606c8a3c279f96344234b33a559d0e7d4b"
},
"downloads": -1,
"filename": "ggallery-1.1.1.tar.gz",
"has_sig": false,
"md5_digest": "ca9de11681b69606f05962b322949c20",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 14758,
"upload_time": "2025-03-21T17:11:46",
"upload_time_iso_8601": "2025-03-21T17:11:46.977027Z",
"url": "https://files.pythonhosted.org/packages/72/6b/2d87b423814a1884969cf9b6075eb276841a3eb13fafc35382fa1175c3c9/ggallery-1.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-03-21 17:11:46",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "creeston",
"github_project": "ggallery",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "annotated-types",
"specs": [
[
"==",
"0.7.0"
]
]
},
{
"name": "azure-core",
"specs": [
[
"==",
"1.32.0"
]
]
},
{
"name": "azure-storage-blob",
"specs": [
[
"==",
"12.24.1"
]
]
},
{
"name": "backports.tarfile",
"specs": [
[
"==",
"1.2.0"
]
]
},
{
"name": "build",
"specs": [
[
"==",
"1.2.2.post1"
]
]
},
{
"name": "certifi",
"specs": [
[
"==",
"2025.1.31"
]
]
},
{
"name": "cffi",
"specs": [
[
"==",
"1.17.1"
]
]
},
{
"name": "charset-normalizer",
"specs": [
[
"==",
"3.4.1"
]
]
},
{
"name": "colorama",
"specs": [
[
"==",
"0.4.6"
]
]
},
{
"name": "cryptography",
"specs": [
[
">=",
"44.0.1"
]
]
},
{
"name": "docker",
"specs": [
[
"==",
"7.1.0"
]
]
},
{
"name": "docutils",
"specs": [
[
"==",
"0.21.2"
]
]
},
{
"name": "id",
"specs": [
[
"==",
"1.5.0"
]
]
},
{
"name": "idna",
"specs": [
[
"==",
"3.10"
]
]
},
{
"name": "importlib_metadata",
"specs": [
[
"==",
"8.6.1"
]
]
},
{
"name": "isodate",
"specs": [
[
"==",
"0.7.2"
]
]
},
{
"name": "jaraco.classes",
"specs": [
[
"==",
"3.4.0"
]
]
},
{
"name": "jaraco.context",
"specs": [
[
"==",
"6.0.1"
]
]
},
{
"name": "jaraco.functools",
"specs": [
[
"==",
"4.1.0"
]
]
},
{
"name": "Jinja2",
"specs": [
[
"==",
"3.1.6"
]
]
},
{
"name": "keyring",
"specs": [
[
"==",
"25.6.0"
]
]
},
{
"name": "markdown-it-py",
"specs": [
[
"==",
"3.0.0"
]
]
},
{
"name": "MarkupSafe",
"specs": [
[
"==",
"3.0.2"
]
]
},
{
"name": "mdurl",
"specs": [
[
"==",
"0.1.2"
]
]
},
{
"name": "more-itertools",
"specs": [
[
"==",
"10.6.0"
]
]
},
{
"name": "nh3",
"specs": [
[
"==",
"0.2.20"
]
]
},
{
"name": "packaging",
"specs": [
[
"==",
"24.2"
]
]
},
{
"name": "pillow",
"specs": [
[
"==",
"11.1.0"
]
]
},
{
"name": "pycparser",
"specs": [
[
"==",
"2.22"
]
]
},
{
"name": "pydantic",
"specs": [
[
"==",
"2.10.6"
]
]
},
{
"name": "pydantic_core",
"specs": [
[
"==",
"2.27.2"
]
]
},
{
"name": "Pygments",
"specs": [
[
"==",
"2.19.1"
]
]
},
{
"name": "pyproject_hooks",
"specs": [
[
"==",
"1.2.0"
]
]
},
{
"name": "python-dotenv",
"specs": [
[
"==",
"1.0.1"
]
]
},
{
"name": "pywin32",
"specs": [
[
"==",
"308"
]
]
},
{
"name": "pywin32-ctypes",
"specs": [
[
"==",
"0.2.3"
]
]
},
{
"name": "PyYAML",
"specs": [
[
"==",
"6.0.2"
]
]
},
{
"name": "readme_renderer",
"specs": [
[
"==",
"44.0"
]
]
},
{
"name": "requests",
"specs": [
[
"==",
"2.32.3"
]
]
},
{
"name": "requests-toolbelt",
"specs": [
[
"==",
"1.0.0"
]
]
},
{
"name": "rfc3986",
"specs": [
[
"==",
"2.0.0"
]
]
},
{
"name": "rich",
"specs": [
[
"==",
"13.9.4"
]
]
},
{
"name": "six",
"specs": [
[
"==",
"1.17.0"
]
]
},
{
"name": "twine",
"specs": [
[
"==",
"6.1.0"
]
]
},
{
"name": "typing_extensions",
"specs": [
[
"==",
"4.12.2"
]
]
},
{
"name": "urllib3",
"specs": [
[
"==",
"2.3.0"
]
]
},
{
"name": "zipp",
"specs": [
[
"==",
"3.21.0"
]
]
}
],
"lcname": "ggallery"
}