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): saves 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.17.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

unibox-0.3.17-py3-none-any.whl (27.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for unibox-0.3.17.tar.gz
Algorithm Hash digest
SHA256 7af061d27233593c7d099394a5b3b56de214db6a5496deb58b7cdbef2cbf0a35
MD5 71f681426b260261e381a6750d70e9b6
BLAKE2b-256 662c96c5da2b761e6b03c3473f3974380333a2bf43bc5cc19e428af817392c87

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for unibox-0.3.17-py3-none-any.whl
Algorithm Hash digest
SHA256 c6b7bf16cedf0968e4d1ecf43f8ded213558d5df3092e7be6a37170c8209de09
MD5 c45be4013a3c61f490c5804ee3b77885
BLAKE2b-256 4b83660cb8da14755b64bf749068796c94c4fc0fb76b7c90572ad0658bf3a5f9

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