3 horizontal lines, burger
3 horizontal lines, burger

3 horizontal lines, burger
Remove all
LOADING ...

Python library for converting numbers from one base to another

Clock
13.10.2026
/
Clock
13.10.2026
/
Icon of app type
Script
An eye
9
Hearts
0
Connected dots
0
Connected dots
0
Connected dots
0

Type of Script:
Single run

Description

Python library designed for parsing, validating, and converting numbers across different numerical bases (ranging from base 2 to base 36). It handles both integer and fractional components, supports signed numbers (+ or -), and parses inputs using custom character mappings.

How it works

When a BaseNumber object is created, the number - regardless of its original base - is first converted to base 10. The integer and fractional parts are calculated separately, as they require different approaches.
Why base 10? For one thing, it is more convenient for me to work with; however, the primary reason for this conversion is that it allows for easy conversion from base 10 to any other base without requiring complex, specialized calculations.
At the very beginning of the initialization process, the number is validated using regular expressions and the re module. These expressions are not stored statically but are evaluated individually for each base—though, in hindsight, pre-generating them might have improved performance.
Once the object has been successfully created, it is ready to be converted to any other base. This is handled by the convert_to method. De facto, this method consists of two sub-methods that calculate the integer and fractional parts separately. It does not rely on complex algorithms, but rather on the most basic and convenient method described in this article on base conversions.

About tests and more

A fair number of tests were conducted to verify the package's operation. Yet, come to think of it, there aren't actually that many. It’s just that running them required me to manually recalculate—and convert between—hundreds upon hundreds of numbers with various bases. In short, I’m now confident I can convert any number from any base to any other base in my head. That’s the level of mastery I’ve reached.
As for additional features, I’ll decide on those as I write utilities using this library. For now, it includes only the core functionality needed for my online base converter tool.

Similar tools

This online tool allows you to read and subscribe to RSS feeds for free and without limitation. You can also aggregate any number of feeds.

Django application for managing ad blocks from YAN

Creation date
09.10.2025
/
Update date
12.09.2026
/
Icon of app type
Django app
An eye
911
Hearts
0
Connected dots
0
Connected dots
2
Connected dots
0
Complete guide to installing and configuring Django Yandex Ad Manager for advanced advertising integration. Learn to implement banners, full-screen ads, carousels, and in-image ads with platform targeting, pagination support, and smart middleware injection. Step-by-step setup with code examples for optimal ad placement and monetization.

Django middleware for managing the BTCPay donation links

Creation date
13.03.2026
/
Update date
12.09.2026
/
Icon of app type
Django app
An eye
366
Hearts
0
Connected dots
0
Connected dots
0
Connected dots
0
This application helps manage all donation links generated on your own Bitcoin node, based on BTCPay Server. It has minimal installation requirements, is managed via database entries, and is easily hosted and placed on your website.

Do not forget to share, like and leave a comment :)

Reviews

(0)

captcha
Send
LOADING ...
It's empty now. Be the first (o゚v゚)ノ