Skip to main content

Unibox is a tool that aims to provide a unified interface for various common daily operations

Project description

unibox

Python Python PyPI Version Code style: black License: MIT

unibox provides unified interface for common file operations.

Features

The package is designed to be running with python 3.10, but targets 3.8+ for compatibility:

CLI:

  • unibox resize <dir>: resizes a directory of images using either pillow or libvips
    • customizable size / quality / encoding (png / webp / jpeg)
  • unibox copy <dir>: an awscli-like tool for copying files with certain suffix to a new dir, keeping the same directory structure.
    • bypasses windows explorer so it's much faster.
  • unibox move <dir>: like copy, but moves instead

utils:

  • UniLogger: uniformed logger class (logger = unibox.UniLogger(), and use logger.info(...))
  • UniLoader: uniformed data loader class (unibox.loads(<filename>))
  • UniSaver: uniformed data saver class (unibox.saves(<data>, <filename>))
  • UniTraverser: uniformed directory traverser class, with callbacks in multiple stages
  • UniResizer: uniformed image resizer class, with callbacks in multiple stages

callables:

  • unibox.traverses(dir, include, exclude, relative_unix): traverse a directory using specified exclude / include extensions, and return a list of files
  • unibox.loads(filepath): load arbitrary data from a file into suitable formats, with automatic detection of file type
    • supported formats: see UniLoader class implementation
  • unibox.saves(data, filepath): save arbitrary data to a file, with automatic detection of file type

Install

install from pypi:

pip install unibox

build from source:

git clone https://github.com/trojblue/unibox

# pip install poetry
poetry install
poetry build
pip install dist/unibox-<version number>.whl

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

unibox-0.3.4.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

unibox-0.3.4-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

Details for the file unibox-0.3.4.tar.gz.

File metadata

  • Download URL: unibox-0.3.4.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for unibox-0.3.4.tar.gz
Algorithm Hash digest
SHA256 32423e7f5c29ea9922aaa72d00c579195aff3fcd55aff19bf10ee44833c2a8e6
MD5 c96cb6d45d8bede7c7be297aba415049
BLAKE2b-256 99bbb7e59b6454bd53bf9bd45c1368b8b2f53b1b6747f79aee9ab1ba961c8a06

See more details on using hashes here.

File details

Details for the file unibox-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: unibox-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 21.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for unibox-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b6392d47b9ab15aaf663a084ef3aa28fb867885487b5f0dff4b4e4635709a2dc
MD5 1de5911b06fbea55d4164682e75220a7
BLAKE2b-256 d6c5e4eb7cf3cbfe287a3b1396eac32cda3107c0e1a1fd05f7eb36df02f08b7c

See more details on using hashes here.

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