Skip to main content

Project Logo

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/.

The Lupaxa Project Footer

Release files for lupaxa-convert-size 0.1.1

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

Source distribution (sdist)

Source distribution for lupaxa-convert-size 0.1.1
File Size Uploaded
lupaxa_convert_size-0.1.1.tar.gz 6.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lupaxa-convert-size 0.1.1
File Interpreter ABI Platform
lupaxa_convert_size-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 14.7 kB

Release files / lupaxa_convert_size-0.1.1.tar.gz

Download URL lupaxa_convert_size-0.1.1.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1ac9542cd657493f43c1b894e05dd472608c6b3bb61a444f0eb82f49f3c9a9f0
BLAKE2b-256 checksum
How to use checksums
8578b1b089b4b692f0a6b55d004ada98a256589cb5efaa70fa0d0696a9cb81c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 23, 2026.

Transparency log

Release files / lupaxa_convert_size-0.1.1-py3-none-any.whl

Download URL lupaxa_convert_size-0.1.1-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5c00e21d2401d885dace81b398d8aea9d70ee5a7f31286f2f7bffcc8e4b139c0
BLAKE2b-256 checksum
How to use checksums
a3d3e2ab5fc2ee26a61b36633780c1e2a34b847b81fd5ad0f5adebb3d1b3bf6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 23, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.2

2 release files

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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