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.2.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.2-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cbases-1.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 2aa5f197106e5c7096456f4b4567870dc527898c02b08e03f367678db183e7c4
MD5 d7475030cc35b93f4f438d422f9d0a72
BLAKE2b-256 06c12e8151ecadbf29dba61f8fbbfbb40c2c3e1c2f0c19a51bc43889d82ad784

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cbases-1.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d03c74ba7684fabde6c6258f131b82c85bbb47f5e1689635a9653b26aeaf5025
MD5 32177a211a4b4c7d88ba242bde9eacda
BLAKE2b-256 4234ea45f238db1e0bd4e93f4aa6d1396239619b7cd8890973ec844edf8706de

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