Module Expr Str ClassDef bases NameLoad body Assign NameStore Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call NameLoad Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If CompareEq SubscriptLoad Call NameLoad NameLoad Index Num Str body Assign NameStore SubscriptLoad Call NameLoad NameLoad Slice Num Assign NameStore Num orelse Assign NameStore Num Assign NameStore Num For NameStore Call NameLoad NameLoad body Assign NameStore BinOpAdd BinOpMult NameLoad Call NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad If CompareEq NameLoad Num body Assign NameStore SubscriptLoad NameLoad Index Num orelse Assign NameStore Str While CompareGt NameLoad Num body Assign NameStore BinOpMod NameLoad Call NameLoad NameLoad Assign NameStore BinOpAdd SubscriptLoad NameLoad Index NameLoad NameLoad Assign NameStore Call NameLoad BinOpDiv NameLoad Call NameLoad NameLoad If NameLoad body Assign NameStore BinOpAdd Str NameLoad Return NameLoad decorator_list Assign NameStore Call NameLoad NameLoad decorator_list Assign NameStore Call NameLoad Str Assign NameStore Call NameLoad Str Assign NameStore Call NameLoad Str
N/A N/A 
Convert numbers from base 10 integers to base X strings and back again.

Original: http://www.djangosnippets.org/snippets/1431/

Sample usage:

>>> base20 = BaseConverter('0123456789abcdefghij')
>>> base20.from_decimal(1234)
'31e'
>>> base20.to_decimal('31e')
1234
 BaseConverter N/A object N/A N/A decimal_digits 0123456789 __init__ N/A N/A self digits N/A N/A N/A N/A self digits digits N/A from_decimal N/A N/A self i N/A N/A N/A N/A N/A self convert i N/A self decimal_digits N/A self digits N/A to_decimal N/A N/A self s N/A N/A N/A N/A int N/A N/A self convert s N/A self digits N/A self decimal_digits N/A convert N/A N/A number fromdigits todigits N/A N/A N/A N/A N/A N/A str number N/A 0 - N/A N/A number N/A N/A str number N/A 1 N/A neg 1 N/A N/A neg 0 N/A x 0 N/A digit N/A str number N/A N/A x N/A N/A x N/A len fromdigits N/A N/A fromdigits index digit N/A N/A x 0 N/A N/A res N/A todigits N/A 0 N/A N/A res N/A N/A x 0 N/A N/A digit N/A x N/A len todigits N/A res N/A N/A todigits N/A digit res N/A x N/A int N/A x N/A len todigits N/A neg N/A N/A res N/A - res N/A res N/A N/A convert N/A staticmethod convert N/A N/A bin N/A BaseConverter 01 N/A hexconv N/A BaseConverter 0123456789ABCDEF N/A base62 N/A BaseConverter ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz