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 .\test.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.2.tar.gz (5.4 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.2-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: praestans-0.1.2.tar.gz
  • Upload date:
  • Size: 5.4 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.2.tar.gz
Algorithm Hash digest
SHA256 1a44c3cf99cef082cc77bc79bbf87d1d50a5d64c5290c4cab6c8307631bb0cc1
MD5 9733ffd2da607a1649d279f82b8cd1c1
BLAKE2b-256 315d20429239161a9281656bc1591a8ed1b48bd9a77905e2a08d2fcd9aac9732

See more details on using hashes here.

File details

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

File metadata

  • Download URL: praestans-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.2 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0d4f55085bd11992087a27a8f24b4175740ed4e5874d195ddf7c964faed63f9e
MD5 355c46f21032ac8d0005e28d63b21b90
BLAKE2b-256 65e507503cee73cf7140f03efdce132253447b04223c43d803e199f121666ae3

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