thumbnails-readme


Namethumbnails-readme JSON
Version 0.4.1 PyPI version JSON
download
home_pagehttps://github.com/firefly-cpp/thumbnails-readme
SummaryCreate thumbnails from Git folders
upload_time2023-12-04 12:32:14
maintainer
docs_urlNone
authorRok Kukovec
requires_python>=3.9,<4.0
license
keywords thumbnails readme
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # thumbnails-readme --- Create thumbnails

## Create thumbnails for raster and vector images in parent and its subdirectories and append them to the README.md file

---
![PyPI Version](https://img.shields.io/pypi/v/thumbnails-readme.svg)
![PyPI - Downloads](https://img.shields.io/pypi/dm/thumbnails-readme.svg)
[![Downloads](https://pepy.tech/badge/thumbnails-readme)](https://pepy.tech/project/thumbnails-readme)
![GitHub repo size](https://img.shields.io/github/repo-size/firefly-cpp/thumbnails-readme?style=flat-square)
[![GitHub license](https://img.shields.io/github/license/firefly-cpp/thumbnails-readme.svg)](https://github.com/firefly-cpp/thumbnails-readme/blob/master/LICENSE)
![GitHub commit activity](https://img.shields.io/github/commit-activity/w/firefly-cpp/thumbnails-readme.svg)
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/firefly-cpp/thumbnails-readme.svg)](http://isitmaintained.com/project/firefly-cpp/thumbnails-readme "Average time to resolve an issue")
[![Percentage of issues still open](http://isitmaintained.com/badge/open/firefly-cpp/thumbnails-readme.svg)](http://isitmaintained.com/project/firefly-cpp/thumbnails-readme "Percentage of issues still open")
[![Packaging status](https://repology.org/badge/tiny-repos/python:thumbnails-readme.svg)](https://repology.org/project/python:thumbnails-readme/versions)

<p align="center">
  <img alt="logo" width="300" src=".github/images/logo_background.png">
</p>


## Description 📋
The "thumbnails-readme" package is a simple library devoted to automatically generating thumbnails from a directory. It is explicitly designed to create thumbnails from Git folders. The thumbnails are shown in the README file of that Git folder. 📁🌐📸

### Multi-pages PDFs are turned into .gif thumbnails 🔄

Current supported filetype extensions are: ".bmp", ".gif", ".ico", "jpeg", ".jpg", ".png", ".tga", ".tiff", ".webp", ".pdf" and ".svg"

## GitHub action 🚀

See also the associated GitHub action in the following repository: [thumbnails-readme-action](https://github.com/KukovecRok/thumbnails-readme-action).

## How does it work? 💡

In the first step the program finds graphical material in your directories:
* ['fig1.pdf', 'fig2.pdf', 'fig3.pdf', 'fig4.pdf']

In the second step the program generates thumbnails for each material identified in folders.

![2023-01-05 10_54_06-000245](https://user-images.githubusercontent.com/33880044/212469322-e4fe49af-404d-40cd-85f8-63fd3eee162d.png)

In the third step the program appends thumbnails to the README file.

![thumbnails-readme-md-image](https://user-images.githubusercontent.com/33880044/224533101-11618c49-61b5-4b6a-bccd-5a1164430bca.png)

## Installation 📦
Install thumbnails-readme with pip:

```sh
pip install thumbnails-readme
```

In case you want to install directly from the source code, use:

```sh
$ git clone https://github.com/firefly-cpp/thumbnails-readme.git
$ cd thumbnails-readme
$ poetry build
$ python setup.py install
```

To install thumbnails-readme on Alpine Linux, please use:

```sh
$ apk add py3-thumbnails-readme
```

To install thumbnails-readme on Arch Linux, please use an [AUR helper](https://wiki.archlinux.org/title/AUR_helpers):

```sh
$ yay -Syyu python-thumbnails-readme
```

## Additional dependencies

### Windows
Windows users have to download poppler for Windows. Add poppler
path in your Python file (see the main example).

``` poppler_path = path/to/your/poppler/bin/ ```

for example: ```poppler_path = C:/Program Files/poppler-0.68.0/bin```

### Linux
Linux's users can install poppler-utils from the main repositories.

### Example

``` python
# Maximum thumbnail size - lower the number, smaller the thumbnail
MAX_SIZE = (128, 128)

# PDF quality, lower the number, lower the quality
pdf_quality = 15

# Skiplist - which directories to ignore
skiplist = (
    ".git",
    )


# Path to your directory
path = os.getcwd()
path = os.path.dirname(path)

# Path to the folder, you want new thumbnails to be placed in
path_to_thumbnails_folder = Path(path + "/image_thumbnails")

# Path to README.md file to be written to
path_to_readme = Path(path + "/README.md")
```

## Run the script

``` python
# Prepare thumbnails folder (check if exists, delete old thumbnails and create new ones)
thumbnails_readme.prepare_thumbnails_folder(path_to_thumbnails_folder)

# Prepare README.md file (check if exists, delete last modifications and place newly generated ones)
thumbnails_readme.prepare_readme(path_to_readme)

# Generate thumbnails
thumbnails_readme.crawl(path, path_to_readme, path_to_thumbnails_folder, MAX_SIZE, pdf_quality, skiplist, poppler_path)
```
## Use Cases

[https://github.com/firefly-cpp/figures](https://github.com/firefly-cpp/figures)

[https://github.com/firefly-cpp/posters](https://github.com/firefly-cpp/posters)

## License

This package is distributed under the BSD-3-Clause license. This license can be found online at <http://www.opensource.org/licenses/bsd-3-clause/>.

## Disclaimer

This framework is provided as-is, and there are no guarantees that it fits your purposes or that it is bug-free. Use it at your own risk!

# Thumbnails
[![example-long](/image_thumbnails/pdf_animation_example-long.gif)](tests/example-long.pdf)
[![example-pdf](/image_thumbnails/pdf_example-pdf_thumb.png)](tests/example-pdf.pdf)
[![example-svg](/image_thumbnails/svg_example-svg_thumb.png)](tests/example-svg.svg)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/firefly-cpp/thumbnails-readme",
    "name": "thumbnails-readme",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<4.0",
    "maintainer_email": "",
    "keywords": "thumbnails,README",
    "author": "Rok Kukovec",
    "author_email": "rok.kukovec@um.si",
    "download_url": "https://files.pythonhosted.org/packages/04/dc/6ff234ec407d8e9e0e0cf4413fb8d284768f65e33a5afaf1a7282624aaad/thumbnails_readme-0.4.1.tar.gz",
    "platform": null,
    "description": "# thumbnails-readme --- Create thumbnails\n\n## Create thumbnails for raster and vector images in parent and its subdirectories and append them to the README.md file\n\n---\n![PyPI Version](https://img.shields.io/pypi/v/thumbnails-readme.svg)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/thumbnails-readme.svg)\n[![Downloads](https://pepy.tech/badge/thumbnails-readme)](https://pepy.tech/project/thumbnails-readme)\n![GitHub repo size](https://img.shields.io/github/repo-size/firefly-cpp/thumbnails-readme?style=flat-square)\n[![GitHub license](https://img.shields.io/github/license/firefly-cpp/thumbnails-readme.svg)](https://github.com/firefly-cpp/thumbnails-readme/blob/master/LICENSE)\n![GitHub commit activity](https://img.shields.io/github/commit-activity/w/firefly-cpp/thumbnails-readme.svg)\n[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/firefly-cpp/thumbnails-readme.svg)](http://isitmaintained.com/project/firefly-cpp/thumbnails-readme \"Average time to resolve an issue\")\n[![Percentage of issues still open](http://isitmaintained.com/badge/open/firefly-cpp/thumbnails-readme.svg)](http://isitmaintained.com/project/firefly-cpp/thumbnails-readme \"Percentage of issues still open\")\n[![Packaging status](https://repology.org/badge/tiny-repos/python:thumbnails-readme.svg)](https://repology.org/project/python:thumbnails-readme/versions)\n\n<p align=\"center\">\n  <img alt=\"logo\" width=\"300\" src=\".github/images/logo_background.png\">\n</p>\n\n\n## Description \ud83d\udccb\nThe \"thumbnails-readme\" package is a simple library devoted to automatically generating thumbnails from a directory. It is explicitly designed to create thumbnails from Git folders. The thumbnails are shown in the README file of that Git folder. \ud83d\udcc1\ud83c\udf10\ud83d\udcf8\n\n### Multi-pages PDFs are turned into .gif thumbnails \ud83d\udd04\n\nCurrent supported filetype extensions are: \".bmp\", \".gif\", \".ico\", \"jpeg\", \".jpg\", \".png\", \".tga\", \".tiff\", \".webp\", \".pdf\" and \".svg\"\n\n## GitHub action \ud83d\ude80\n\nSee also the associated GitHub action in the following repository: [thumbnails-readme-action](https://github.com/KukovecRok/thumbnails-readme-action).\n\n## How does it work? \ud83d\udca1\n\nIn the first step the program finds graphical material in your directories:\n* ['fig1.pdf', 'fig2.pdf', 'fig3.pdf', 'fig4.pdf']\n\nIn the second step the program generates thumbnails for each material identified in folders.\n\n![2023-01-05 10_54_06-000245](https://user-images.githubusercontent.com/33880044/212469322-e4fe49af-404d-40cd-85f8-63fd3eee162d.png)\n\nIn the third step the program appends thumbnails to the README file.\n\n![thumbnails-readme-md-image](https://user-images.githubusercontent.com/33880044/224533101-11618c49-61b5-4b6a-bccd-5a1164430bca.png)\n\n## Installation \ud83d\udce6\nInstall thumbnails-readme with pip:\n\n```sh\npip install thumbnails-readme\n```\n\nIn case you want to install directly from the source code, use:\n\n```sh\n$ git clone https://github.com/firefly-cpp/thumbnails-readme.git\n$ cd thumbnails-readme\n$ poetry build\n$ python setup.py install\n```\n\nTo install thumbnails-readme on Alpine Linux, please use:\n\n```sh\n$ apk add py3-thumbnails-readme\n```\n\nTo install thumbnails-readme on Arch Linux, please use an [AUR helper](https://wiki.archlinux.org/title/AUR_helpers):\n\n```sh\n$ yay -Syyu python-thumbnails-readme\n```\n\n## Additional dependencies\n\n### Windows\nWindows users have to download poppler for Windows. Add poppler\npath in your Python file (see the main example).\n\n``` poppler_path = path/to/your/poppler/bin/ ```\n\nfor example: ```poppler_path = C:/Program Files/poppler-0.68.0/bin```\n\n### Linux\nLinux's users can install poppler-utils from the main repositories.\n\n### Example\n\n``` python\n# Maximum thumbnail size - lower the number, smaller the thumbnail\nMAX_SIZE = (128, 128)\n\n# PDF quality, lower the number, lower the quality\npdf_quality = 15\n\n# Skiplist - which directories to ignore\nskiplist = (\n    \".git\",\n    )\n\n\n# Path to your directory\npath = os.getcwd()\npath = os.path.dirname(path)\n\n# Path to the folder, you want new thumbnails to be placed in\npath_to_thumbnails_folder = Path(path + \"/image_thumbnails\")\n\n# Path to README.md file to be written to\npath_to_readme = Path(path + \"/README.md\")\n```\n\n## Run the script\n\n``` python\n# Prepare thumbnails folder (check if exists, delete old thumbnails and create new ones)\nthumbnails_readme.prepare_thumbnails_folder(path_to_thumbnails_folder)\n\n# Prepare README.md file (check if exists, delete last modifications and place newly generated ones)\nthumbnails_readme.prepare_readme(path_to_readme)\n\n# Generate thumbnails\nthumbnails_readme.crawl(path, path_to_readme, path_to_thumbnails_folder, MAX_SIZE, pdf_quality, skiplist, poppler_path)\n```\n## Use Cases\n\n[https://github.com/firefly-cpp/figures](https://github.com/firefly-cpp/figures)\n\n[https://github.com/firefly-cpp/posters](https://github.com/firefly-cpp/posters)\n\n## License\n\nThis package is distributed under the BSD-3-Clause license. This license can be found online at <http://www.opensource.org/licenses/bsd-3-clause/>.\n\n## Disclaimer\n\nThis framework is provided as-is, and there are no guarantees that it fits your purposes or that it is bug-free. Use it at your own risk!\n\n# Thumbnails\n[![example-long](/image_thumbnails/pdf_animation_example-long.gif)](tests/example-long.pdf)\n[![example-pdf](/image_thumbnails/pdf_example-pdf_thumb.png)](tests/example-pdf.pdf)\n[![example-svg](/image_thumbnails/svg_example-svg_thumb.png)](tests/example-svg.svg)\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Create thumbnails from Git folders",
    "version": "0.4.1",
    "project_urls": {
        "Homepage": "https://github.com/firefly-cpp/thumbnails-readme",
        "Repository": "https://github.com/firefly-cpp/thumbnails-readme"
    },
    "split_keywords": [
        "thumbnails",
        "readme"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "71e8e60ee90ae1f317c5b7a97b2bc50d1d1c40d2748c920619053c349e7855a8",
                "md5": "3b583daec187aa5c187e3d952ab6245b",
                "sha256": "e01c33983c3570e027b4e38e6f16733eb659ab153cc3c20f862bcbe9d8c3f7cf"
            },
            "downloads": -1,
            "filename": "thumbnails_readme-0.4.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3b583daec187aa5c187e3d952ab6245b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4.0",
            "size": 7224,
            "upload_time": "2023-12-04T12:32:12",
            "upload_time_iso_8601": "2023-12-04T12:32:12.320336Z",
            "url": "https://files.pythonhosted.org/packages/71/e8/e60ee90ae1f317c5b7a97b2bc50d1d1c40d2748c920619053c349e7855a8/thumbnails_readme-0.4.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "04dc6ff234ec407d8e9e0e0cf4413fb8d284768f65e33a5afaf1a7282624aaad",
                "md5": "cf9f5bd98c0bfec6892748055adf0c54",
                "sha256": "a1d7e78e270a9cc34008b2277c7cdaad9105f1465d3a03d4d565c60d8e93fbe0"
            },
            "downloads": -1,
            "filename": "thumbnails_readme-0.4.1.tar.gz",
            "has_sig": false,
            "md5_digest": "cf9f5bd98c0bfec6892748055adf0c54",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<4.0",
            "size": 6909,
            "upload_time": "2023-12-04T12:32:14",
            "upload_time_iso_8601": "2023-12-04T12:32:14.130692Z",
            "url": "https://files.pythonhosted.org/packages/04/dc/6ff234ec407d8e9e0e0cf4413fb8d284768f65e33a5afaf1a7282624aaad/thumbnails_readme-0.4.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-04 12:32:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "firefly-cpp",
    "github_project": "thumbnails-readme",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "thumbnails-readme"
}
        
Elapsed time: 0.14690s