Skip to content

python module that enables easy conversions between number systems

License

Notifications You must be signed in to change notification settings

apotursun963/Praestans

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Praestans

Sürüm Dil Dil

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 = "AE221"
binary_res = hexa_to_binary(hexa)
print(f"hexa: {hexa} -> binary: {binary_res}")

Project Structure

praestans/
├── praestans/                    # Main Python module (same name as the project)
│   ├── __init__.py               
│   ├── bin.py                    
│   ├── dec.py                    
│   ├── err.py                    
│   ├── hex.py                    
│   ├── oct.py                
├── ceaser.jpg                    # Image file
├── LICENSE                       # License information
├── README.md                     # Project description
├── setup.py                      # Script for package installation
└── test.py                       # Test file

Running test

python .\test.py

About

python module that enables easy conversions between number systems

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages