Create thumbnails from Git folders
Project description
thumbnails-readme --- Create thumbnails
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 and show thumbnails in the README file of that Git folder.
How it works?
First step: program finds graphical material in your directories
- ['fig1.pdf', 'fig2.pdf', 'fig3.pdf', 'fig4.pdf']
Second step: program generates thumbnails for each material identified in folders
Third step: program appends thumbnails into README
![Thumbnail](/image_thumbnails/PDFpismenka-interval_thumb.png)
Installation
pip install 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 users can install poppler-utils from the main repositories.
Example
# 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
# 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.generate_thumbnails(path, path_to_thumbnails_folder, path_to_readme, MAX_SIZE, pdf_quality, skiplist)
License
This package is distributed under the MIT License. This license can be found online at http://www.opensource.org/licenses/MIT.
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!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for thumbnails_readme-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3000608868e424c09156b6adb7346a6310b6e67aa43971dc9f5b8c4fc9421872 |
|
MD5 | 2e756a5e6952297c71b15a1bab30d2da |
|
BLAKE2b-256 | 189ba49863a7700e1c648251dbe40f20afc64b8cf915817e46a76c05ac8c62dd |