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.3.tar.gz (5.6 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.3-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cbases-1.0.3.tar.gz
  • Upload date:
  • Size: 5.6 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.3.tar.gz
Algorithm Hash digest
SHA256 56259ddb1dce9e48fce13de88c811af4fd1397117be936888a0b3e2aacb34fa2
MD5 7395aebbedf3f0909c32b4dbd5cea456
BLAKE2b-256 094863d16563255e89bb9c0fcefdb60fb4593e42bbb98e23c2bac278eb7c2923

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cbases-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.9 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 172c6af0fddc1a256903814abcfc2c39ccabcf22838606b6916d395a317acb44
MD5 763e49510394840770ad6034dd41fa40
BLAKE2b-256 34cb99f7cafb33a83faf766d1093e8a89fed9ac3901944b865d9492dd7f1c56c

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