README
Motivation
Synchronize a CSV database and PNG/JPEG files to add #hashtag in image description. Then, you can synchronize all files with Google drive and search image with tags. Google set the metadata of the file from the 'description' metadata in graphic file.
Synopsis
Google drive use only the description meta-data to index an image.
After this synchronisation it's possible to search an image with
"type:image a_hashtag".
type:image apple
This tool use Exiftool
$ sudo apt-get install exiftool # Debian
$ sudo brew install exiftool # Mac
$ sudo yum install perl-Image-ExifTool # CentOS
...
...
You can update the tags inside the description in your CSV file, or use some others tools like XnView and extract tags to CSV and descriptions.
By default, this tool merge the tags from CSV and files.
$ # Merge tags from descriptions.csv and selected files, and save all tags in tags.txt
$ tag_images_for_google_drive -v --db descriptions.csv '**/*.png' '**/*.jpg' \
--tagfile tags.txt
But it's possible to apply tags from database or files only
$ tag_images_for_google_drive -v --from-db --db descriptions.csv '**/*.png' '**/*.jpg'
$ tag_images_for_google_drive -v --from-file --db descriptions.csv '**/*.png' '**/*.jpg'
To add a specific tag for all images in a directory, add it in command line.
$ tag_images_for_google_drive -v --db descriptions.csv -t myimages '**/*.png' '**/*.jpg'
The, you can filter theses specifics images with type:image myimages ....
For more informations
$ tag_images_for_google_drive --help
To synchronize the google files, you can use different tools.
In the proposed Docker image, we use the google-drive-ocamlfuse.
The latest version
Clone the git repository (see upper button)
Installation
Different solutions is possible.
For windows
Use chcp 16001 (utf-8), before use this tools.
Installation from one executable
- Copy the file 'tag_images_for_google_drive.${OS}' to local directory
- Rename this file to 'tag_images_for_google_drive'
- And run-it
$ tag_images_for_google_drive --help
Installation from PIP
- In virtualenv or conda env, use
$ pip install tag_images_for_google_drive
- Then, run-it
$ tag_images_for_google_drive --help
Installtion in Docker
- From the source code, use
make Dockerfile - WARNING, this image have the credential for manipulate all yours Google files
- Eventually, create a dedicated volume for the GDrive cache
> docker volume create --name tag_image_for_google_drive
- Create the container with custom parameters
$ docker build \
-f Dockerfile \
--build-arg OS_VERSION="latest" \
--build-arg GDRIVE_ROOT_FOLDER="/Images" \
--build-arg GDRIVE_TEAM_DRIVE_ID="" \
--build-arg PARAMS="'**/*.png' '**/*.jpg'" \
--build-arg CRON_FREQUENCE="* */12 * * *" \
-t "$(USER)/tag_image_for_google_drive:latest" .
- Start the container
$ docker run --detach --cpus=0.5 \
--privileged \
-v tag_image_for_google_drive:/cache
-i "$(USER)/tag_image_for_google_drive:latest"
Inside the container, a google-drive-ocamlfuse is installed to synchronize the google files
from GDRIVE_ROOT_FOLDER in the cache, and a crontab is periodically executed (see CRON_REQUENCE)
to invoke tag_image_for_google_drive with PARAMS.
Installation from source
Go inside the directory and
$ make configure
$ conda activate tag_images_for_google_drive
$ make install
Tests
To test the project
$ make test
To validate the typing
$ make typing
To validate all the project
$ make validate
Project Organization
├── Makefile <- Makefile with commands like `make data` or `make train`
├── README.md <- The top-level README for developers using this project.
├── docs <- A default Sphinx project; see sphinx-doc.org for details
├── setup.py <- makes project pip installable (pip install -e .[tests])
│ so sources can be imported and dependencies installed
├── tag_images_for_google_drive <- Source code for use in this project
└── tests <- Unit and integrations tests ((Mark directory as a sources root).
Metadata
Release files for tag-images-for-google-drive 1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tag_images_for_google_drive-1.1.tar.gz | 2.5 MB | Without provenance | Details for tag_images_for_google_drive-1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tag_images_for_google_drive-1.1-py3-none-any.whl | Python 3 | none | any | Details for tag_images_for_google_drive-1.1-py3-none-any.whl |
Total release size: 2.5 MB
Release files / tag_images_for_google_drive-1.1.tar.gz
| Download URL | tag_images_for_google_drive-1.1.tar.gz |
|---|---|
| Size | 2.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b9b82592a74035f56bd4b3c20369b58d9693646508fd3a65e302e39501cc237e
|
|
BLAKE2b-256 checksum How to use checksums |
efe54807eca653601fa846f08b3db06d8ca3d548f282afdf6b3b9fc3f965afea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.7.13
|
Release files / tag_images_for_google_drive-1.1-py3-none-any.whl
| Download URL | tag_images_for_google_drive-1.1-py3-none-any.whl |
|---|---|
| Size | 21.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d659417fdaa92d89ea2858d9f0b9e3381cd1a5a3a3b58b698a2b7a847f23cd27
|
|
BLAKE2b-256 checksum How to use checksums |
947423d304b700d1efd8e1f52ff53c0e2ea9374e974bf38adf19a7d265a34a5c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.7.13
|
Security for tag-images-for-google-drive 1.1
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.