The Lupaxa Developers Toolbox
Part of The Lupaxa Project
lupaxa-convert-size
Convert file sizes between IEC (binary) and SI (decimal) units, including bits, nibbles, and bytes.
Built for scripts and tools used by The Lupaxa Project.
Features
- Convert between IEC units (
B,KiB, …QiB,bit,Kibit, …Qibit) using a 1024 scaler - Convert between SI units (
B,kB, …QB,bit,kbit, …Qbit) using a 1000 scaler - Convert between bits, nibbles, and bytes in the same family (8 bits = 2 nibbles = 1 byte)
- Look up the full name of a unit from its abbreviation
- Case-insensitive unit codes
- Fully typed, linted, formatted, and tested
Installation
From PyPI
pip install lupaxa-convert-size
From source (development mode)
pip install -e ".[dev]"
Requires Python 3.10+. No runtime dependencies.
Usage
from lupaxa.convert_size import convert_size, get_name_from_code
convert_size(1024, "B", "KiB")
# 1.0
convert_size(1, "GiB", "MiB")
# 1024.0
convert_size(2000, "B", "kB", si_units=True)
# 2.0
convert_size(1, "KiB", "Kibit")
# 8.0
convert_size(1, "B", "nibble")
# 2.0
get_name_from_code("MiB")
# "Mebibyte"
get_name_from_code("kB", si_units=True)
# "Kilobyte"
A walkthrough of the same API is in demo.py in the
source repository.
Development
Clone the repository and install with Make:
make init # first-time makefile-skills checkout
make python-install-dev # editable install with [dev]
make python-check # lint, type-check, and test
make mkdocs-serve # local docs site
Documentation: https://convert-size.thelupaxaproject.org/.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lupaxa_convert_size-0.1.0.tar.gz.
File metadata
- Download URL: lupaxa_convert_size-0.1.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de15e90ff80acfb72ee96859c354b613c04b7a7a54e48c37c6cbf0632f52b959
|
|
| MD5 |
52987bbe28eecdadab2cac5c2116b7b8
|
|
| BLAKE2b-256 |
9c8500438adb673c4d28a762f69302c27816cea6fd65810e0024329382f1b171
|
Provenance
The following attestation bundles were made for lupaxa_convert_size-0.1.0.tar.gz:
Publisher:
generate-release.yml on lupaxa-developers-toolbox/convert-size
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lupaxa_convert_size-0.1.0.tar.gz -
Subject digest:
de15e90ff80acfb72ee96859c354b613c04b7a7a54e48c37c6cbf0632f52b959 - Sigstore transparency entry: 2601332285
- Sigstore integration time:
-
Permalink:
lupaxa-developers-toolbox/convert-size@5a96cf72e38b7d328745881379c8f77a1690a3bc -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/lupaxa-developers-toolbox
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
generate-release.yml@5a96cf72e38b7d328745881379c8f77a1690a3bc -
Trigger Event:
push
-
Statement type:
File details
Details for the file lupaxa_convert_size-0.1.0-py3-none-any.whl.
File metadata
- Download URL: lupaxa_convert_size-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9996d092ea0b3e38b6c24011f8e2a566de164c47ed62115c81f37aafefa23265
|
|
| MD5 |
ea90a987f89521b2604debaf8b085f05
|
|
| BLAKE2b-256 |
a2b5599c730e334c70d510ad337b2a9f4ea59192f7177c5cf68e71ca0c7957f0
|
Provenance
The following attestation bundles were made for lupaxa_convert_size-0.1.0-py3-none-any.whl:
Publisher:
generate-release.yml on lupaxa-developers-toolbox/convert-size
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lupaxa_convert_size-0.1.0-py3-none-any.whl -
Subject digest:
9996d092ea0b3e38b6c24011f8e2a566de164c47ed62115c81f37aafefa23265 - Sigstore transparency entry: 2601332792
- Sigstore integration time:
-
Permalink:
lupaxa-developers-toolbox/convert-size@5a96cf72e38b7d328745881379c8f77a1690a3bc -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/lupaxa-developers-toolbox
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
generate-release.yml@5a96cf72e38b7d328745881379c8f77a1690a3bc -
Trigger Event:
push
-
Statement type: