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

Uploaded Source

Built Distribution

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

z_units-0.1.2-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file z_units-0.1.2.tar.gz.

File metadata

  • Download URL: z_units-0.1.2.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.8.0a2 CPython/3.10.10

File hashes

Hashes for z_units-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8ba857cc38cb980d208fbe0ea3602e1193462a3e0ed46681c6ea6d431837d47f
MD5 44e827f062a247720f3776c5c8f0c386
BLAKE2b-256 3719f7e527fe99dc9f3f36d44ed72cd8a152e02f7e11d37eef498b5f37f188df

See more details on using hashes here.

File details

Details for the file z_units-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: z_units-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.8.0a2 CPython/3.10.10

File hashes

Hashes for z_units-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f41275acd0a21bb4e5cee44da62bf02b4212201c9920e0ba0dbb28be6bdd63cd
MD5 5018adc17900d71ec4a64ed9b295baa6
BLAKE2b-256 ff92515ac25f3a2d6f5e0c9cec8a0552d36af402303d174e6c4de87bb280c49f

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