Skip to main content

Overview

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.

Feature

  • 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

install from PyPi

pip install quantities

download source from github

Quantities

Version

current version: 0.1.0

Documentation

Documentation

Usage

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

print()
a = v / t
print(a.value)
print(a.current_unit.express_by_SI_base())

The results after running the program are as follows:

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

0.2727272727272727
('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>')

Metadata

Release files for Physical-Quantity-calculating 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Physical-Quantity-calculating 0.1.0
File Size Uploaded
Physical Quantity calculating-0.1.0.tar.gz 15.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Physical-Quantity-calculating 0.1.0
File Interpreter ABI Platform
Physical_Quantity_calculating-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 52.9 kB

Release files / Physical Quantity calculating-0.1.0.tar.gz

Download URL Physical Quantity calculating-0.1.0.tar.gz
Size 15.2 kB
Tags Source
SHA-256 checksum
How to use checksums
68b6e80334fb8b23a2a523254d1a6630dc193d0b411d2024141dbcd40ecd3cb1
BLAKE2b-256 checksum
How to use checksums
f8a9e3c5508f540693646f975de5e054d60aaf513a079f21bcc6c5ebcd94fc8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.5

Release files / Physical_Quantity_calculating-0.1.0-py3-none-any.whl

Download URL Physical_Quantity_calculating-0.1.0-py3-none-any.whl
Size 37.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a363df2909d12b2e4d95bf5b5d4f58d6af97896865fc74e50eeca42a5d1761b1
BLAKE2b-256 checksum
How to use checksums
b8d65af57caabc9f3db4969ea367a89255289a13d590c549696ef5c104473410
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page