Skip to main content

Multi purpose unit conversion package

Project description

Maßlos unit conversion library

coverage version MIT License

Set of functions to convert between different units including metric and imperial

< Add an optional screenshot of your project below >

Table of Contents

Installation

On macOS and Linux:

$ python -m pip install masslos

On Windows:

PS> python -m pip install masslos

Execution / Usage

Here are a few examples of using the masslos library in your code:

from masslos import Distance, Speed, Weight
...
# without specifying the decimal digits (default = 2)
w = Weight()
s = Speed()
d = Distance()

dist_in_meter = d.convert(10, "yd", "m")
weight_in_kg = w.convert(11, "lbs", "kg")

print("Speed units:")
print(s.list_units())
# with specifying the decimal digits
w = Weight()
s = Speed()
d = Distance()

dist_in_meter = d.convert(value=10, from_unit="yd", to_unit="m", ndigits=3)
weight_in_kg = w.convert(value=11, from_unit="lbs", to_unit="kg", ndigits=3)

For more examples, please refer to the project's Wiki or documentation page.

Technologies

masslos uses the following technologies and tools:

Features

masslos currently has the following set of features:

  • Converting distances including
    • metric
    • imperial
    • astronomical
  • Converting weights including
    • metric
    • imperial
  • Converting speeds

Author

Andreas Haberl – # – develop@haberl-info.de

Change log

  • 0.2.1
    • feat: add Speed class
    • feat: changing to class based API
      BREAKING CHANGE: use instance methods instead of function calls
    • feat: add function "list_units"
    • test: updates
    • docs: update README.md
  • 0.2.0
    • feat: argument for precision of conversion
  • 0.1.0
    • First working version

License

masslos is distributed under the MIT license. See LICENSE for more details.

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

masslos-0.2.1.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

masslos-0.2.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file masslos-0.2.1.tar.gz.

File metadata

  • Download URL: masslos-0.2.1.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for masslos-0.2.1.tar.gz
Algorithm Hash digest
SHA256 d76e8b04667245d7330ba806da4199b8b3051f9a30988378f800ba060271ceb8
MD5 662dba4b81f74466c842403637cb38cd
BLAKE2b-256 515a2a5121d345641cb8cf09ff703b311aff708af681ff0e91e3e62bcb6b379b

See more details on using hashes here.

File details

Details for the file masslos-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: masslos-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for masslos-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3f4c9b00082b44a1e3bcb6cd167f00432726fc5297a5ddaadeb4d29aa6053eae
MD5 18671b92561e1507f35c36ceb3b0cd2d
BLAKE2b-256 56ce489a6ce25ff88dcd90d3b4b0ac6caf58dcd4fa407c93901902c5436bbf4e

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