Skip to main content

Dat,temperature, distance, mace conversion tool

Project description

Python Package Exercise

Package Description

This package allows for users to easily convert values to different units, for data, distance, mass, and temperature.

Python package CI

PyPI Page

Link Needs to be updated

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, "KB", "MB"))
print(convert_distance(1, "mile", "km"))
print(convert_mass(10, "kg", "lb"))
print(convert_temperature(32, "F", "C"))

Example File

Example

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unit_convert_swe_nyu-1.0.0.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

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

unit_convert_swe_nyu-1.0.0-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file unit_convert_swe_nyu-1.0.0.tar.gz.

File metadata

  • Download URL: unit_convert_swe_nyu-1.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

Hashes for unit_convert_swe_nyu-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ca787e2bdf3c46d36c682ddff1919f7ff5f36b456886862b3f2673fe4fa4087b
MD5 f86db501709ac0ee7fa415e7a5a5b8b2
BLAKE2b-256 ca5f1bd8229d49d24799b2032ee4d377d8138c1a87d6d77b872980c1f782d00e

See more details on using hashes here.

File details

Details for the file unit_convert_swe_nyu-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for unit_convert_swe_nyu-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 acb0332dd4e4b2ba5dc4d8e0c97f63306a849105168d63815a879a6f2e98e93e
MD5 16c1aee4cbf190067005998edf9631d0
BLAKE2b-256 16699c0815fc8cedbcc84af20e6f053f87d59a96ae465b8d1bae6d690fa73ade

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