file-thumbnailer


Namefile-thumbnailer JSON
Version 0.0.9 PyPI version JSON
download
home_pagehttps://github.com/Salamek/file-thumbnailer
SummaryFile thumbnailer for images, pdfs and more
upload_time2022-12-13 18:53:31
maintainer
docs_urlNone
authorAdam Schubert
requires_python>=3.4
licenseLGPL-3.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # File thumbnailer
File thumbnailer is "saner" file thumbnailer with as little weird depedencies as possible

[![Tox tests](https://github.com/Salamek/file-thumbnailer/actions/workflows/python-test.yml/badge.svg)](https://github.com/Salamek/file-thumbnailer/actions/workflows/python-test.yml)

## Supported file formats

Supported file formats are all images supported by Pillow OOTB and all files supported by PyMuPDF (if installed)

## Installation

### PIP (pip3 on some distros)
```bash
$ pip install file-thumbnailer
$ pip install file-thumbnailer[pdf] # for PyMuPDF support
```



### Repository
You can also use these repositories maintained by me
#### Debian and derivates

Add repository by running these commands

```
$ wget -O- https://repository.salamek.cz/deb/salamek.gpg | sudo tee /usr/share/keyrings/salamek-archive-keyring.gpg
$ echo "deb     [signed-by=/usr/share/keyrings/salamek-archive-keyring.gpg] https://repository.salamek.cz/deb/pub all main" | sudo tee /etc/apt/sources.list.d/salamek.cz.list
```

And then you can install a package python3-file-thumbnailer

```
$ apt update && apt install python3-file-thumbnailer
```

## Usage

```python
from file_thumbnailer.ConverterManager import ConverterManager
from file_thumbnailer.models.Dimensions import Dimensions

converter_manager = ConverterManager()
with open('my_file.pdf', 'rb') as read_file:
    converter = converter_manager.from_data(read_file
    thumbnail = converter.to_image_bytes(Dimensions())
    with open('my_file_thumbnail.jpg', 'wb') as thumbnail_file:
        thumbnail_file.write(thumbnail)

```
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Salamek/file-thumbnailer",
    "name": "file-thumbnailer",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.4",
    "maintainer_email": "",
    "keywords": "",
    "author": "Adam Schubert",
    "author_email": "adam.schubert@sg1-game.net",
    "download_url": "https://files.pythonhosted.org/packages/92/e8/307a41679e2b0cc6453a8c00b80697c09fb8130fa6cd6356cb2970d1f9d7/file-thumbnailer-0.0.9.tar.gz",
    "platform": null,
    "description": "# File thumbnailer\nFile thumbnailer is \"saner\" file thumbnailer with as little weird depedencies as possible\n\n[![Tox tests](https://github.com/Salamek/file-thumbnailer/actions/workflows/python-test.yml/badge.svg)](https://github.com/Salamek/file-thumbnailer/actions/workflows/python-test.yml)\n\n## Supported file formats\n\nSupported file formats are all images supported by Pillow OOTB and all files supported by PyMuPDF (if installed)\n\n## Installation\n\n### PIP (pip3 on some distros)\n```bash\n$ pip install file-thumbnailer\n$ pip install file-thumbnailer[pdf] # for PyMuPDF support\n```\n\n\n\n### Repository\nYou can also use these repositories maintained by me\n#### Debian and derivates\n\nAdd repository by running these commands\n\n```\n$ wget -O- https://repository.salamek.cz/deb/salamek.gpg | sudo tee /usr/share/keyrings/salamek-archive-keyring.gpg\n$ echo \"deb     [signed-by=/usr/share/keyrings/salamek-archive-keyring.gpg] https://repository.salamek.cz/deb/pub all main\" | sudo tee /etc/apt/sources.list.d/salamek.cz.list\n```\n\nAnd then you can install a package python3-file-thumbnailer\n\n```\n$ apt update && apt install python3-file-thumbnailer\n```\n\n## Usage\n\n```python\nfrom file_thumbnailer.ConverterManager import ConverterManager\nfrom file_thumbnailer.models.Dimensions import Dimensions\n\nconverter_manager = ConverterManager()\nwith open('my_file.pdf', 'rb') as read_file:\n    converter = converter_manager.from_data(read_file\n    thumbnail = converter.to_image_bytes(Dimensions())\n    with open('my_file_thumbnail.jpg', 'wb') as thumbnail_file:\n        thumbnail_file.write(thumbnail)\n\n```",
    "bugtrack_url": null,
    "license": "LGPL-3.0",
    "summary": "File thumbnailer for images, pdfs and more",
    "version": "0.0.9",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "dcde3a05b208fac7d684c51b557c3386",
                "sha256": "c19a8621b48ec34153b34b887e78d8cb7dfbc254a9e274809955099d32a4a1fc"
            },
            "downloads": -1,
            "filename": "file-thumbnailer-0.0.9.tar.gz",
            "has_sig": false,
            "md5_digest": "dcde3a05b208fac7d684c51b557c3386",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.4",
            "size": 240639,
            "upload_time": "2022-12-13T18:53:31",
            "upload_time_iso_8601": "2022-12-13T18:53:31.093678Z",
            "url": "https://files.pythonhosted.org/packages/92/e8/307a41679e2b0cc6453a8c00b80697c09fb8130fa6cd6356cb2970d1f9d7/file-thumbnailer-0.0.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-13 18:53:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "Salamek",
    "github_project": "file-thumbnailer",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "file-thumbnailer"
}
        
Elapsed time: 0.05629s