Skip to main content

In arithmetic operations, the corresponding physical quantity is automatically generated and the corresponding coherent unit is selected

Project description


The Physical Quantities Calculating class library is developed in the Python 3.8.5 environment and is a class library that handles the calculating of physical quantities and the conversion of the measurement units. This library is fully close to the concept of physical quantity, and emphasizes the relationship between physical quantities. Automatically generate a new quantity after calculation, which is closer to the domain knowledge of quantity calculation. It can also handle unit conversion between SI unit.


  • There is only a simple interface for the arithmetic calculation of physical quantities and the selection of measurement units.
  • New types of physical quantities are automatically generated for calculation and automatic unit conversion.
  • It can handle most of the SI unit system units and non-SI unit system units selected by the SI unit system. For example, the minute, hour, day, month, and year of time, etc.
  • By simply subclassing the base class method, new physical quantities and their units of measurement can be easily generated for easy expansion.
  • Use Identity to express the concept of unitless quantity


install from PyPi

pip install quantities

download source from github



current version: 0.1.0




import quantities as pq
l = pq.Length(33)
t = pq.Time(11)
v = l / t

a = v / t

The results after running the program are as follows:

('m/s', 'm/s')

('m\\cdot s^{-2}', 'm·s<sup>-2</sup>')

('km\\cdot s^{-2}', 'km·s<sup>-2</sup>')

('MN\\cdot m', 'MN·m')
('Mkg\\cdot m^{2}\\cdot s^{-2}', 'Mkg·m<sup>2</sup>·s<sup>-2</sup>')

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

Physical Quantity calculating-0.1.0.tar.gz (15.2 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page