Skip to main content

A simple unit converter for chemical engineering

Project description

z-units

A simple unit-converter for chemical engineers

Feature

  • Gauge pressure (MPag, kPag, psig, ...) can be used
  • Friendly to HYSYS user

Install

pip install z-units

Usage

from z_units import quantity as q
# pick a quantity
f = q.MolarFlow(3)
# to base unit
f.to_base()
# convert
f.to('kmol/s')
# list available units
print(f.units)
# get value
value, unit = f.value, f.unit
# gauge pressure
p = q.Pressure(5, 'bar').to('MPag')
# change local atmospheric pressure (default: 101325 Pa)
from z_units import config
config.set_local_atmospheric_pressure(50e3)
q.Pressure(100, 'kPa').to('kPag')
# change standard temperature (default: 20 degC)
# affect standard cubic meter "Sm**3"
config.set_standard_temperature(15)
q.Substance(100, 'Nm3').to('Sm3')
# formatting
# with unit in styles, format spec starts with "u"
format(q.MolarEntropy(100), 'u')
# '100 kJ/kmol-C' (quick-style)
format(q.MolarEntropy(100), 'up')
# '100 kJ/(kmol*C)' (expression-style)

Predefined Quantities

  • Length
  • Area
  • Volume
  • Time
  • Mass
  • Force
  • Substance
  • Energy
  • Velocity
  • Temperature
  • DeltaTemperature
  • Pressure
  • VolumeFlow
  • MassDensity
  • HeatFlow
  • MolarFlow
  • MassFlow
  • MolarDensity
  • MolarHeatCapacity
  • MolarEntropy
  • MolarHeat
  • ThermalConductivity
  • Viscosity
  • SurfaceTension
  • MassHeatCapacity
  • MassEntropy
  • MassHeat
  • StandardGasFlow
  • KinematicViscosity
  • MolarVolume
  • Fraction
  • Dimensionless

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

z_units-0.1.2.tar.gz (14.5 kB view hashes)

Uploaded Source

Built Distribution

z_units-0.1.2-py3-none-any.whl (12.1 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