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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

duconv-1.0.2rc1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file duconv-1.0.2rc1.tar.gz.

File metadata

  • Download URL: duconv-1.0.2rc1.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for duconv-1.0.2rc1.tar.gz
Algorithm Hash digest
SHA256 ec91282a33dac6e723a7e81153e850bf74aa7b4e7995d1348b6cfb020e1db401
MD5 4d178fb62d19422e41930d35af3e7d65
BLAKE2b-256 b454ec26f1c405127077a78a3943ef777b3b63ed78ddd3b356ac138269b2f451

See more details on using hashes here.

File details

Details for the file duconv-1.0.2rc1-py3-none-any.whl.

File metadata

  • Download URL: duconv-1.0.2rc1-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for duconv-1.0.2rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 b593f2c1fb7cf60289d06e846fed8589d937fb9937854004c54f262c7b7eb31c
MD5 4df1b3293be4132a607220f11bc98cf1
BLAKE2b-256 489cc782d603f1c2cbada969d8c9b162f4d4b7a81c95654296a3420cb444314b

See more details on using hashes here.

Supported by

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