Number base conversion library with Roman numeral support
Project description
cbases
A powerful Python library for number base conversion (2-62) with Roman numeral support.
Features
- Convert numbers between bases 2-62
- Support for Roman numerals (conversion to/from decimal)
- Easy-to-use API with both functional and OOP approaches
- Comprehensive error handling
Installation
pip install cbases
##USAGE:
#Functional approach:
from cbases import convert
result = convert("FF", 16, 10) # "255"
result = convert("255", 10, 2) # "11111111"
#Object-oriented approach:
from cbases import EquBase
num = EquBase("FF", 16)
print(num.b10()) # "255"
print(num.b2()) # "11111111"
print(num.bn(11)) # "212"
#Roman numerals
roman_num = EquBase("XIV", "roman")
print(roman_num.b10()) # "14"
num = EquBase("10", 10)
print(num.roman()) #"X"
#Str function:
num = EquBase("FF", 16)
print(num) #"The number contained in the called object is FF which is in base 16."
roman_num = EquBase("X", "roman")
print(roman_num) #"The number contained in the called object is X (stocked as 10 for calculations) which is in base roman (converted to base 10 for operations)."
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
cbases-1.0.0.tar.gz
(6.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cbases-1.0.0.tar.gz.
File metadata
- Download URL: cbases-1.0.0.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd23a6dda0e396781393fcb4a8814b846b2a3995cd24b4587991d13d72f66a0b
|
|
| MD5 |
827c84742f8de113b3da9c29dec08ef3
|
|
| BLAKE2b-256 |
2980c43f86b8eddaf52666ae663efb76c803e563fb548d90bc1d9a6e9d225b5f
|
File details
Details for the file cbases-1.0.0-py3-none-any.whl.
File metadata
- Download URL: cbases-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47a363012ce26c8099d5d1eb2d25c3997108844b3164c7fdbe8695437182778b
|
|
| MD5 |
6712f496ca193e05bd51aab7a1498026
|
|
| BLAKE2b-256 |
526ab093b47a1460b579da1e32b648fc9f8df885437a21f7b4244543dc95c120
|