Metadata-Version: 2.0
Name: python-radix
Version: 0.1.0
Summary: A tool for conversion numbers from one base to another
Home-page: https://github.com/valbub/python-radix
Author: valbub, yury-khrustalev
Author-email: UNKNOWN
License: MIT
Keywords: radix numbers
Platform: Any
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4

# 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'

