Skip to main content

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.1.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

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

cbases-1.0.1-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file cbases-1.0.1.tar.gz.

File metadata

  • Download URL: cbases-1.0.1.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

Hashes for cbases-1.0.1.tar.gz
Algorithm Hash digest
SHA256 b9daf6792d36bd200ad8a01904eced97b9d628a1271a4308056c01f4ab3c2d3b
MD5 08ea6c17246d52a978bf0916933c45de
BLAKE2b-256 e238a9ee7a4699f3e0ceaa12bde16bd5b898e1353659b27b97a15b738e9c9553

See more details on using hashes here.

File details

Details for the file cbases-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: cbases-1.0.1-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

Hashes for cbases-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cd504668e1815d1483e9e8ddfaf849d56922733e38c7735789449d8b5d57aa72
MD5 8109cf98ba90c4bd0a455eebdd0e019d
BLAKE2b-256 6a9fd796f8112e13f55580239b85a6710be75f42efb89afd6e12a3ffa55908a1

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