Skip to main content

Classes to help with common types of measurements

Project description

Measuring Tools

A Python Module to help deal with measurments in an object oriented way.


An Object can be converted from one measurment to another.

from measuring_tools.length import Length

# Convert From One Length To Another
length1 = Length(value=1, measurement='yard')
length2 = length1.to_meter()

print(length2)

# Output
Length(value=0.9144, measurement='meter')

Two objects are designed to interact with one another even if measurments are different.

Example:

from measuring_tools.length import Length

# Two Lengths - One In Meters, One In Yards
length1 = Length(value=1, measurement='meter')
length2 = Length(value=1, measurement='yard')

print(length1 + length2)

# Output
Length(value=1.9144, measurement='meter')

In the example above, length two is converted from yard to meter and then added to length1. The output is a new object separate from length1 and length2.


Inplace operations are also available.

from measuring_tools.length import Length

# Inplace Subtraction
football_field = Length(value=100, measurement='yard')
football_field -= 25

print(football_field)

# Output
Length(value=75, measurement='yard')

In the example above, the value of football_field is modified directly. The output is the same as object.


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

measuring-tools-0.6.0.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

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

measuring_tools-0.6.0-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file measuring-tools-0.6.0.tar.gz.

File metadata

  • Download URL: measuring-tools-0.6.0.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for measuring-tools-0.6.0.tar.gz
Algorithm Hash digest
SHA256 6c2a5306c65cba829e5edd214a63a318b318130c2690b45434331a123c1e68ba
MD5 6d447c0cd29ff7b80a46af2023f1fe60
BLAKE2b-256 b894c853983a71d499931037b89b3419e6b36f74b6c3aa5e1d91c3722d149aa4

See more details on using hashes here.

File details

Details for the file measuring_tools-0.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for measuring_tools-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 320d5a916ffdbbfb264e786b842ab1c83b0c6ed8b9e63c7766e3dcbbb0cde417
MD5 e3f4a57619347d5b36f3b9f8c9fb133d
BLAKE2b-256 7afce7ec9e204d646a54148b9f9c91b70e7f3c172df14f9398d2a53f05c98654

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