Pick photos following a given strategy and upload them to various destinations
Project description
# Photos Picker
[![Build Status](https://travis-ci.org/l-vo/photos-picker.svg?branch=master)](https://travis-ci.org/l-vo/photos-picker)
[![codecov](https://codecov.io/gh/l-vo/photos-picker/branch/master/graph/badge.svg)](https://codecov.io/gh/l-vo/photos-picker)
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 works and is tested with Python 2.7. Other Python versions are not tested yet.
## Install
```bash
$ 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
from photospicker.picker.last_photos_picker import LastPhotosPicker
from photospicker.uploader.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 Exception as err:
if err.message:
print err.message
else:
raise err
```
Since picking and uloading may take a while, progress events are dispatched.
You can see a more complex example which displays work progress [here](examples/example.py).
### Pickers:
* `LastPhotosPicker`: pick the *n* lastest photos.
* `RandomPicker`: pick randomly *n* photos.
More details [here](doc/pickers.md)
### 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](doc/filters.md)
### 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](doc/uploaders.md)
## Contributing
Other pickers, filters and uploaders will come along the time. If you need a specific picker, filter or uploader, post an issue. Or better, submit a pull request :)
If you submit a pull request, be sure that the PEP8 standards are respected and the tests are not broken launching the following command:
```bash
$ make validate
```
[![Build Status](https://travis-ci.org/l-vo/photos-picker.svg?branch=master)](https://travis-ci.org/l-vo/photos-picker)
[![codecov](https://codecov.io/gh/l-vo/photos-picker/branch/master/graph/badge.svg)](https://codecov.io/gh/l-vo/photos-picker)
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 works and is tested with Python 2.7. Other Python versions are not tested yet.
## Install
```bash
$ 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
from photospicker.picker.last_photos_picker import LastPhotosPicker
from photospicker.uploader.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 Exception as err:
if err.message:
print err.message
else:
raise err
```
Since picking and uloading may take a while, progress events are dispatched.
You can see a more complex example which displays work progress [here](examples/example.py).
### Pickers:
* `LastPhotosPicker`: pick the *n* lastest photos.
* `RandomPicker`: pick randomly *n* photos.
More details [here](doc/pickers.md)
### 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](doc/filters.md)
### 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](doc/uploaders.md)
## Contributing
Other pickers, filters and uploaders will come along the time. If you need a specific picker, filter or uploader, post an issue. Or better, submit a pull request :)
If you submit a pull request, be sure that the PEP8 standards are respected and the tests are not broken launching the following command:
```bash
$ make validate
```
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
photos-picker-0.3.1.tar.gz
(9.9 kB
view hashes)
Built Distribution
Close
Hashes for photos_picker-0.3.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5afb99b1103264c80bf7b5310860c598cfec2174124746907cb42ad89384ee30 |
|
MD5 | b55f1bbd4b3b64a65e34af6e9dca4434 |
|
BLAKE2b-256 | 75be225a2ee510a8387e532d010ec97e9bcec7b7f998572cc3a32532e1db37de |