praestans
This Python library allows you to easily convert between binary, octal, decimal, and hexadecimal number systems. You can perform conversions between different number systems quickly and accurately. Whether you're doing basic calculations or working on software projects that involve numbers, this library saves you time. It's an ideal tool for those looking for a simple and effective solution.
- Source code: https://github.com/apotursun963/praestans
Installation
pip install praestans
Example usage
This library offers a total of 12 different functions to convert between binary, octal, decimal, and hexadecimal number systems. Here are 4 examples of these functions:
from praestans.bin import binary_to_decimal
from praestans.dec import decimal_to_hexa
from praestans.oct import octal_to_decimal
from praestans.hex import hexa_to_binary
# Conversion from binary to decimal
binary = 1011
decimal_res = binary_to_decimal(binary)
print(f"binary: {binary} -> decimal: {decimal_res}")
# Conversion from octal to decimal
octal = 1771
decimal_res = octal_to_decimal(octal)
print(f"octal: {octal} -> decimal: {decimal_res}")
# Conversion from decimal to hexa
decimal = 255
hexa_res = decimal_to_hexa(decimal, "X")
print(f"decimal: {decimal} -> hexadecimal: {hexa_res}")
# Conversion from hexa to binary
hexa = "A32E"
binary_res = hexa_to_binary(hexa)
print(f"hexa: {hexa} -> binary: {binary_res}")
Running test
python .\test.py
Metadata
Release files for praestans 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| praestans-0.1.2.tar.gz | 5.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| praestans-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.6 kB
Release files / praestans-0.1.2.tar.gz
| Download URL | praestans-0.1.2.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1a44c3cf99cef082cc77bc79bbf87d1d50a5d64c5290c4cab6c8307631bb0cc1
|
|
BLAKE2b-256 checksum How to use checksums |
315d20429239161a9281656bc1591a8ed1b48bd9a77905e2a08d2fcd9aac9732
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.13.0
|
Release files / praestans-0.1.2-py3-none-any.whl
| Download URL | praestans-0.1.2-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0d4f55085bd11992087a27a8f24b4175740ed4e5874d195ddf7c964faed63f9e
|
|
BLAKE2b-256 checksum How to use checksums |
65e507503cee73cf7140f03efdce132253447b04223c43d803e199f121666ae3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.13.0
|