Skip to main content

Number Base Converter

Project description

Number Base Converter by v01d

Converts string representation from one base to another


From PyPI (recommended)

Via pip

$ pip install --user nbc

Via pipenv

$ pipenv install nbc

From GitLab

$ git clone
$ cd number-base-converter
$ python install --user


convert(number, to_base, from_base)
number: from_base whole number (as String) to convert
to_base: New base [2; 36]
from_base: Old base [2; 36] (default 10)
return: to_base number as a String

Wrong to_base/from_base range raises ValueError
Int number raises TypeError
Unexpected symbols in number raise ValueError


from nbc import convert

convert('15', 2)  # '1111'
convert('10F', to_base=8, from_base=16)  # '417'
convert('1', 30)  # '1'

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for nbc, version 1.1.3
Filename, size File type Python version Upload date Hashes
Filename, size nbc-1.1.3.tar.gz (2.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page