Skip to main content

Library of Python functions to converts units

Project description

pyunitconverter

Description

pyunitconverter is a Python library of functions for unit conversions.

Modules

  • pyunitconverter.energy: conversion of energy units
  • pyunitconverter.length: conversion of length units
  • pyunitconverter.mass: conversion of mass units
  • pyunitconverter.prefixes: prefixes for units of the International System (ie: kilo, mega, ...)
  • pyunitconverter.speed: conversion of speed units
  • pyunitconverter.temperature: conversion of temperature units
  • pyunitconverter.time: conversion of time units
  • pyunitconverter.volume: conversion of volume units

Installation

python -m pip install pyunitconverter

Usage

Example 1

from pyunitconverter.mass import ounces_to_kilograms

mass = 10

print(f"{mass} ounces = {ounces_to_kilograms(mass)} kg")

Example 2

from pyunitconverter.prefixes import PREFIX_KILO

length = 5.2

print(f"{length} km = {PREFIX_KILO*length} m")

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

pyunitconverter-0.5.1.tar.gz (6.0 kB view hashes)

Uploaded Source

Built Distribution

pyunitconverter-0.5.1-py3-none-any.whl (10.9 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