Skip to main content

A tool for conversion numbers from one base to another

Project description

# python-radix

Python-radix library

The library contains tools for conversion numbers to a new base. Current version works with radixes from 2 to 36.

Python-radix usage examples

Python-radix has both procedural and object-oriented solutions.

Procedural way example

# to convert number 4 from base 10 to base 2

cast(4, 10, 2)

>>’100’

You can use both str and int types for the number you convert.

Object oriented way example

# create an object to convert numbers from one base to another (here it converts from base 10 to base 2)

new = Converter(10, 2)

new.convert(4)

>>’100’

This will work too:

new = Converter(10, 2)

new.convert(‘4’)

>>’100’

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

python-radix-0.1.1.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

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

python_radix-0.1.1-py2.py3-none-any.whl (4.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file python-radix-0.1.1.tar.gz.

File metadata

  • Download URL: python-radix-0.1.1.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for python-radix-0.1.1.tar.gz
Algorithm Hash digest
SHA256 483b5ff239d2f58c128ab9d737cd2cf86b413bdf64c3c68dbfc699cab2a7eeea
MD5 9f409eb78204a224afb63151a32d35f3
BLAKE2b-256 a0ff6f70f140aafbdd4a341ad259af925ea41e685ada27c71bca549433741cfc

See more details on using hashes here.

File details

Details for the file python_radix-0.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for python_radix-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 85c7119bebd19e5cf0475d60ebdfe3ef1bdc11690e8f3bef4c5894b2eee113a9
MD5 5964dd4ead4761392d0e315636b21b96
BLAKE2b-256 f33b301b2fae3f22d5aad5572a20b0316ca78ca74d171e39e44481801da88ee9

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