Skip to main content

Pymetro

Pymetro is a python library that allows you to incorporate scientific notations using symbols into your program. It provides functions that force a specific notation on a variable as specified by the user and includes a function that automatically formats any given numbers to a standard index form. Note that all of the returns given by any functions in this module are Strings.

Usage

Manual

To use Pymetro, it is first imported to the Python workspace like any other library as:

>> import pymetro

You can then call one of the many functions provided in order to format the desired number. For manual formatting functions, the function is called from the library and provided with either an integer or a float. The following is an example of raising the number 2314.124 to a notation of kilo:

>> pymetro.kilo(2314.124)
2.314124k

You can also specify the number of digits after the decimal point by providing another integer to the function representing the number of places required after the decimal point:

>> pymetro.kilo(2314.124, 3)
2.314k

If no integer is provided to specify the rounding place, the function would simply default to not rounding the number at all.

Auto

The auto function on the other hand automatically formats the number based on the standard index form, to illustrate, these are the results of passing two different numbers into the auto function:

>> pymetro.auto(2145.235)
2.145235k
>> pymetro.auto(0.032523)
32.523m

As you can see, both numbers were automatically formatted to the recommended notation. This is helpful when the user cannot predict what numbers are going to be generated or inputted in their program. Similarly, the auto function is also capable of accepting a specific number of integers following the decimal point to round, the result is as follows:

>> pymetro.auto(2145.235, 3)
2.145k
>> pymetro.auto(0.032523, 2)
32.52m

Functions

Notation Symbol Function
Atto a atto()
Femto f femto()
Pico p pico()
Nano n nano()
Micro µ micro()
Milli m milli()
Kilo k kilo()
Mega M Mega()
Giga G giga()
Tera T tera()
Peta peta peta()
Exa E exa()
Zetta Z zetta()
Yotta Y yotta()

Metadata

Release files for pymetro 0.27

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

Source distribution (sdist)

Source distribution for pymetro 0.27
File Size Uploaded Provenance Actions
pymetro-0.27.tar.gz 3.4 kB Without provenance Details for pymetro-0.27.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pymetro 0.27
File Interpreter ABI Platform Actions
pymetro-0.27-py3-none-any.whl Python 3 none any Details for pymetro-0.27-py3-none-any.whl

Total release size: 19.6 kB

Release files / pymetro-0.27.tar.gz

Download URL pymetro-0.27.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
54d2bf49b9094fd4f97d994b37cc9a2bde2266d3c50d28202387518a9e2fd299
BLAKE2b-256 checksum
How to use checksums
02e01f1d6c9e590cb6be0bdb4fafa152c25fd0fc90753f836d07ffefa063ee00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.5

Release files / pymetro-0.27-py3-none-any.whl

Download URL pymetro-0.27-py3-none-any.whl
Size 16.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c838f41e2d916d85f725c234cc8f491a5c20030a21a02fc5d4a2a9dc0a8cb13
BLAKE2b-256 checksum
How to use checksums
9c331e1289d81e4e1ca605a4ff5b0029a5cbd876b594987bce692068f099a7f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.5

Security for pymetro 0.27

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.27 This release

2 release files No provenance

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