Skip to main content

Photos Picker

Build Status codecov

This libary allows to pick photos in a folder according to a given strategy (last photos, random photos...) and copy them to a destination (another system folder, Dropbox or Google drive folder...)

Compatibility

This library currently works with Python 2.7, Python 3.4, Python 3.5, Python 3.6 and Python 3.7.

Install

$ pip install photos-picker

Usage

The main class PhotosPicker accepts a "picker", a tuple of "filters" and an "uploader" as arguments. The picker allows to select photos while the filters modify them. At the end of the process, the uploader copy transformed (or not) photos to a given destination. Below the simplest example which copy the 50 lastest photos to another directory:

# Python 2.7 example
from photospicker.exception.abstract_exception import AbstractException
from photospicker.picker.pickers.last_photos_picker import LastPhotosPicker
from photospicker.uploader.uploaders.filesystem_uploader import FilesystemUploader
from photospicker.photos_picker import PhotosPicker

if __name__ == '__main__':
    try:
        picker = LastPhotosPicker('/pictures', 50)
        uploader = FilesystemUploader('/destination')

        photos_picker = PhotosPicker(picker, (), uploader)
        photos_picker.run()
    except AbstractException as err:
        print err.message

Since picking and uloading may take a while, progress events are dispatched. You can see a more complex example which displays work progress here.

Pickers:

  • LastPhotosPicker: pick the n lastest photos.
  • RandomPicker: pick randomly n photos.
  • SmartPicker: pick randomy n photos. Recent photos have more chance to be picked than old ones. It results by a picking of a majority of recent photos and a few old ones.

More details here

Note you can also create your own picker extending the base class AbstractPicker.

Filters:

  • ResizeFilter: resize the photos with the given width and height. The final photos size are computed for avoiding distortion.
  • RotateFilter: Rotate the photos according to EXIF data.

More details here

Note you can also create your own filter extending the base class AbstractFilter.

Uploaders:

Note that uploaders don't append new photos. Either the directory must be empty or the uploader clear it before copying files.

  • FilesystemUploader: copy the photos to a given directory. This directory must exist and be empty.
  • DropBoxUploader: upload the photos to Dropbox. Note that you should limit your token access to application. Creating a full access token is not needed and may induce security issues.
  • GDriveUploader upload the photos to Google Drive.

More details here

Note you can also create your own uploader extending the base class AbstractUploader.

Contributing

The project is currenlty currently shipped with many pickers, filters or uploaders. But others can be developed, you may post an issue for that. Or better, read how to post a pull request :)

Metadata

Release files for photos-picker 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for photos-picker 1.0.0
File Size Uploaded Provenance Actions
photos-picker-1.0.0.tar.gz 11.8 kB Without provenance Details for photos-picker-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for photos-picker 1.0.0
File Interpreter ABI Platform Actions
photos_picker-1.0.0-py2-none-any.whl Python 2 none any Details for photos_picker-1.0.0-py2-none-any.whl

Total release size: 76.6 kB

Release files / photos-picker-1.0.0.tar.gz

Download URL photos-picker-1.0.0.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
56bb6c89c306a12628e11623cfa7d8b1c6da9244e7200d020177890916cc34fc
BLAKE2b-256 checksum
How to use checksums
88d087dbda702b2d4dbc1c7498109c53ea194d92199bd00c35e0f72270246142
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/2.7.10

Release files / photos_picker-1.0.0-py2-none-any.whl

Download URL photos_picker-1.0.0-py2-none-any.whl
Size 64.8 kB
Tags Python 2
SHA-256 checksum
How to use checksums
ad4f1ddeb00605592f44ce8fc9f76d67638784a1aa67fb8b9fd47b5b2018779c
BLAKE2b-256 checksum
How to use checksums
4326ada6a1b4f655b1db78a14461b6bd82342969c30447ee74c3142d2437cfa6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/2.7.10

Security for photos-picker 1.0.0

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page