Dat,temperature, distance, mace conversion tool
Project description
Python Unit Converter
Package Description
This package allows for users to easily convert values to different units, for data, distance, mass, and temperature.
PyPI Page
How to Use
Setup
pip install unit-convert-swe-nyu
The package is now built!
Function Overview
convert_data(x: float, unit_from: UnitData, unit_to: UnitData)
Converts data units (KB, MB, GB, etc.)
convert_distance(x: float, unit_from: UnitDistance, unit_to: UnitDistance)
Converts distance units (meters, kilometers, miles, etc.)
convert_mass(x: float, unit_from: UnitMass, unit_to: UnitMass)
Converts mass units (grams, kilograms, pounds)
convert_temperature(x: float, unit_from: UnitTemperature, unit_to: UnitTemperature)
Converts temperature units (Celsius, Fahrenheit, Kelvin)
Example Usage
# Option 1:
# from unit_convert import *
# Option 2: explicit import
from unit_convert import (
convert_data,
convert_distance,
convert_mass,
convert_temperature,
UnitData,
UnitDistance,
UnitMass,
UnitTemperature,
)
print(convert_data(1024, UnitData.KB, UnitData.MB))
print(convert_distance(1, UnitDistance.MI, UnitDistance.KM))
print(convert_mass(10, UnitMass.K, UnitMass.P))
print(convert_temperature(32, UnitTemperature.F, UnitTemperature.C))
Example File
Run Example Locally
From the project root:
# using pipenv
pipenv run pip install -e .
pipenv run python example.py
Run Example in Another Project
Install from PyPI:
pip install unit-convert-swe-nyu
Create an example.py file in any folder, then run:
python example.py
How to Contribute
To contribute to this project you must fork the repository, then submit your changes via pull request and wait for it to be accepted.
Test the project using
pytest
before creating a pull request.
Team members
Aleks Nuzhnyi - GitHub Profile
Calvin Pun - GitHub Profile
Sunil Parab - GitHub Profile
Yash Pazhianur - GitHub Profile
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file unit_convert_swe_nyu-2.0.0.tar.gz.
File metadata
- Download URL: unit_convert_swe_nyu-2.0.0.tar.gz
- Upload date:
- Size: 20.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9a27cadad1fd5c610df40f6ef61530cd0725520e668deba45cd5b349c0bcf99
|
|
| MD5 |
4c622d9c293be7d0f50c73ca5d816980
|
|
| BLAKE2b-256 |
eee36abcb803a69b0b6feeebcb8ff9f164f0eb71be34a2f4a3331b8c5a554222
|
File details
Details for the file unit_convert_swe_nyu-2.0.0-py3-none-any.whl.
File metadata
- Download URL: unit_convert_swe_nyu-2.0.0-py3-none-any.whl
- Upload date:
- Size: 17.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a31841db7af40d2515a3c6aad73e7e753eae61ef05a7ce0aadc52c33a0c62051
|
|
| MD5 |
372012c6be445b43010c758082246d62
|
|
| BLAKE2b-256 |
16b76aad0a0b5bda24e80cfdd9349cf2040e58dde4c3b46894cbe456ded93abc
|