logscale
This Python package provides a single function, order_of_magnitude(), which
computes and returns the order of magnitude of a given number in a standardized
string format.
The order of magnitude gives a compact representation of a number as a product of a coefficient and a power of 10, where the coefficient is constrained to lie within the interval [1/√10, √10). For more information, see the wikipedia article on orders of magnitude.
Installation
If you are using uv, you can install the package from PyPI with:
uv pip install logscale
Alternatively, with regular pip:
pip install logscale
Examples
from logscale import order_of_magnitude
order_of_magnitude(129) # "1.3e2"
order_of_magnitude(0.0001) # "1.0e-4"
order_of_magnitude(456) # "0.46e3"
order_of_magnitude(70.2) # "0.70e2"
order_of_magnitude(0) # "0.0e0"
Release files for logscale 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| logscale-0.1.5.tar.gz | 23.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| logscale-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.0 kB
Release files / logscale-0.1.5.tar.gz
| Download URL | logscale-0.1.5.tar.gz |
|---|---|
| Size | 23.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bdfdd96fedfac535334cecc34a08f72c0e9080e76fae9bd1ccd893fd67696461
|
|
BLAKE2b-256 checksum How to use checksums |
3a5eaf449242922dfd116074d8547fbd4ef55fc1890e5d6e05fff5d6b43d115e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 2, 2026.
Transparency logRelease files / logscale-0.1.5-py3-none-any.whl
| Download URL | logscale-0.1.5-py3-none-any.whl |
|---|---|
| Size | 16.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ece127764bd593f6f05e3a47a33cfcf1d76e00eebf3d2fb3ddbca00838b25722
|
|
BLAKE2b-256 checksum How to use checksums |
7d828e32be6585b81b3c19c06264084713e3e863a5c830ab1294085057aed391
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 2, 2026.
Transparency log