Skip to main content

python module that enables easy conversions between number systems

Project description

praestans

veni2

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.

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 .\tst.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

praestans-0.1.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

praestans-0.1.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file praestans-0.1.0.tar.gz.

File metadata

  • Download URL: praestans-0.1.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for praestans-0.1.0.tar.gz
Algorithm Hash digest
SHA256 78f46d70731f62035cd2310ec49f7f0b0ce79649a293a243951e72ce5293e0af
MD5 d1e7bfcc44d84979cd9dfd9f397dcef8
BLAKE2b-256 7b8e98b3b5a3b597726aa23a6986f0730f23481661b3eb3d2990ab94e4fa1549

See more details on using hashes here.

File details

Details for the file praestans-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: praestans-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for praestans-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aaad2f51dfe2d279904bc0cd1054d245aa38500bcf71524eb771259602b1cadc
MD5 72f8bdd95a8172b0cd26625c0398a5c9
BLAKE2b-256 99af73cba78f14722be049379d164b0651c7c0e7937d8f82f252ba3e5fbff3db

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page