Python-baseconv is a lightweight Python module designed to convert numbers from base 10 integers to base X strings and vice versa. It provides predefined converters for common bases like binary, hexadecimal, and Base64, as well as the ability to define custom alphabets. The current version is 1.2.2, with its last release in April 2019, suggesting a maintenance-focused release cadence.
Install & Compatibility
Where this runs
tested against v1.2.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.2MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 2.6s · import 0.000s · 20MB
17MB installed
● package 17MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Predefined converters are directly imported from the `baseconv` package, not as submodules of `baseconv` itself.
from baseconv import base2, base16, base36, base56, base58, base62, base64
from baseconv import BaseConverter
This quickstart demonstrates how to use the predefined base converters and how to create a custom BaseConverter with your own alphabet for encoding and decoding integers.
from baseconv import base62, BaseConverter
# Using a predefined converter (e.g., Base62)
encoded_value = base62.encode(1234567890)
print(f"Encoded to Base62: {encoded_value}")
decoded_value = base62.decode(encoded_value)
print(f"Decoded from Base62: {decoded_value}")
# Creating a custom converter
my_alphabet = '0123456789ABCDEF'
my_hex_converter = BaseConverter(my_alphabet)
custom_encoded = my_hex_converter.encode(255)
print(f"Custom Hex Encoded: {custom_encoded}")
custom_decoded = my_hex_converter.decode(custom_encoded)
print(f"Custom Hex Decoded: {custom_decoded}")
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.