Skip to main content

Archive-To-Images is a Python CLI to transform archives into images and reverse.

Project description

Archive-To-Images

Build status Python Version Dependencies Status

Code style: black Security: bandit Pre-commit Semantic Versions License Coverage Report

Archive-To-Images is a Python CLI to transform archives into images and reverse.

Intro

Since some cloud providers offer free unlimited picture-only storage, the Archive-To-Images library allows to convert any collection of files into pictures to be uploaded without any additional cost.

Installation

The package can be easily installed via pip package manager:

$ pip install archive-to-images

Usage as CLI

Transform to images

$ archive-to-images transform --help

 Usage: archive-to-images transform [OPTIONS]                                                                           
                                                                                                                        
 Transforms an archive into multiple images.                                                                            
                                                                                                                        
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *  --path     -p      TEXT            Path containing data to be archived. [default: None] [required]                │
│ *  --name     -n      TEXT            Name of the archive. [default: None] [required]                                │
│    --size     -s      [0.5|1|2|5|10]  Maximum size of an image in MB. [default: 1]                                   │
│    --encrypt  -e                      Protect archive with password.                                                 │
│    --verbose  -v                      Enable verbose output.                                                         │
│    --help                             Show this message and exit.                                                    │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Create an image collection from data contained in multiple paths.

$ archive-to-images transform --path /home/alice/Desktop --path /home/alice/Documents --name ARCHIVE_ALICE

Set the maximum image size in MB (default: 1):

$ archive-to-images transform --path /home/alice/Desktop --path /home/alice/Documents --name ARCHIVE_ALICE -s 5

Encrypt data with a password:

$ archive-to-images transform --path /home/alice/Desktop --path /home/alice/Documents --name ARCHIVE_ALICE -s 5 -e

Restore from images

$ archive-to-images restore --help

 Usage: archive-to-images restore [OPTIONS]                                                                             
                                                                                                                        
 Restores an archive from multiple images.                                                                              
                                                                                                                        
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *  --path     -p      TEXT  Path containing images to be processed. [default: None] [required]                       │
│    --verbose  -v            Enable verbose output.                                                                   │
│    --help                   Show this message and exit.                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Restore the archives stored in image collections:

$ archive-to-images restore --path /home/alice/Downloads/Album1 --path /home/alice/Downloads/Album2

The library will automatically find all the archives stored in the images and will output a zip archive for each one.

Usage as docker

Run the docker image and bind the current folder to the workspace path inside the container:

$ docker run -it --rm -v $(pwd):/workspace peco602/archive_to_images:latest bash

then it is possible to use the CLI directly from the container bash.

Buy me a coffee

Do you like my work or did you find it useful?

Buy Me A Coffee

License

Copyright (c) 2022-present Giovanni Pecoraro

Licensed under MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

archive_to_images-1.0.0.tar.gz (9.9 kB view hashes)

Uploaded Source

Built Distribution

archive_to_images-1.0.0-py3-none-any.whl (9.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page