Skip to main content

Convert data to varios types

Project description

DUConv

A Python3 Module that helps convert digital data units such as Bytes, KB, MB, GB, and TB.
This module can be run from the cli to help make fast data conversion.

PyPI - License PyPI PyPI - Python Version Static Badge Static Badge

Installation

Install with pip:

To use as a module or a cli application you can create a virtual environment and install
DUConv via pip (Not recommended to be install systemwide).

pip install duconv

Install with pipx:

If the intended use is only as a cli application, run:

pipx install duconv

Usage

As a Module

from duconv import bytesconvert  
from duconv import convert  

bytesconvert.bytes_converter(b)  
bytesconvert.data_to_bytes(d, un)  

convert.to_kb(d, un)  
convert.to_mb(d, un)  
convert.to_gb(d, un)  
convert.to_tb(d, un)  

b:  an integer or a float  
d:  an integer or a float  
un: a string of one character representing a data unit  

As a cli Application

From the cli run: duconv -b VAL

duconv -d VAL [k|m|g|t]

duconv [-kmgt] VAL [k|m|g|t]

duconv -b 5000  

duconv -d 5000 k  

duconv -m 5000 k  

License

This project is licensed under the terms of the 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

duconv-1.0.2rc1.tar.gz (6.4 kB view hashes)

Uploaded Source

Built Distribution

duconv-1.0.2rc1-py3-none-any.whl (5.8 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