All Projects → semente → python-baseconv

semente / python-baseconv

Licence: other
Python module to convert numbers from base 10 integers to base X strings and back again.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to python-baseconv

exponential-moving-average
Calculate an exponential moving average from an array of numbers.
Stars: ✭ 41 (+2.5%)
Mutual labels:  math, numbers
Quaternion.js
A JavaScript Quaternion library
Stars: ✭ 86 (+115%)
Mutual labels:  math, numbers
SurrealNumbers.jl
Implementation of Conway's Surreal Numbers
Stars: ✭ 30 (-25%)
Mutual labels:  math, numbers
ChangeNumbersJs
Tiny Library for change number from a language in other language.
Stars: ✭ 14 (-65%)
Mutual labels:  numbers, number-converter
kalker
Kalker/kalk is a calculator with math syntax that supports user-defined variables and functions, complex numbers, and estimation of derivatives and integrals
Stars: ✭ 1,237 (+2992.5%)
Mutual labels:  math
Ta Rs
Technical analysis library for Rust language
Stars: ✭ 248 (+520%)
Mutual labels:  math
Fouriertalkoscon
Presentation Materials for my "Sound Analysis with the Fourier Transform and Python" OSCON Talk.
Stars: ✭ 244 (+510%)
Mutual labels:  math
Julia Set Playground
A Swift playground that generates beautiful Julia set fractal images.
Stars: ✭ 236 (+490%)
Mutual labels:  math
mathcore
Advanced .NET math library (.NET Standard).
Stars: ✭ 24 (-40%)
Mutual labels:  math
nim-mathexpr
Tiny math expression evaluator library implemented in pure Nim
Stars: ✭ 58 (+45%)
Mutual labels:  math
MathImprove
Modify and Improve math expressions.
Stars: ✭ 13 (-67.5%)
Mutual labels:  math
Polyhedra Viewer
Explore the relationships between convex regular-faced polyhedra.
Stars: ✭ 253 (+532.5%)
Mutual labels:  math
dsa
data structure and algorithm - examples and implementations
Stars: ✭ 13 (-67.5%)
Mutual labels:  base-conversion
Mathnet Spatial
Math.NET Spatial
Stars: ✭ 246 (+515%)
Mutual labels:  math
basex-rdf
RDF parsing for BaseX
Stars: ✭ 16 (-60%)
Mutual labels:  basex
Xaos
Real-time interactive fractal zoomer
Stars: ✭ 239 (+497.5%)
Mutual labels:  math
cpc
Text calculator with support for units and conversion
Stars: ✭ 89 (+122.5%)
Mutual labels:  math
zerolib-flixel
Some helper classes for HaxeFlixel that I like to use ✨
Stars: ✭ 28 (-30%)
Mutual labels:  math
tacent
A C++ library implementing linear algebra, text and file IO, UTF-N conversions, containers, image loading/saving, image quantization/filtering, command-line parsing, etc.
Stars: ✭ 43 (+7.5%)
Mutual labels:  math
livebook
Automate code & data workflows with interactive Elixir notebooks
Stars: ✭ 3,402 (+8405%)
Mutual labels:  math

baseconv

https://travis-ci.org/semente/python-baseconv.svg?branch=master https://coveralls.io/repos/semente/python-baseconv/badge.png?branch=master

Copyright (c) 2010, 2011, 2012, 2015, 2017 Guilherme Gondim. All rights reserved.

Copyright (c) 2009 Simon Willison. All rights reserved.

Copyright (c) 2002 Drew Perttula. All rights reserved.

Description:
Python module to convert numbers from base 10 integers to base X strings and back again.
Author(s):
Drew Perttula, Simon Willison, Guilherme Gondim
License:
Python Software Foundation License version 2
Project website:
https://github.com/semente/python-baseconv
References:
http://www.djangosnippets.org/snippets/1431/ ; http://code.activestate.com/recipes/111286/

Install and Usage Instructions

You can use pip to install baseconv module:

$ pip install python-baseconv

Example usage:

>>> from baseconv import base2, base16, base36, base56, base58, base62, base64
>>> base2.encode(1234)
'10011010010'
>>> base2.decode('10011010010')
'1234'
>>> base64.encode(100000000000000000000000000000000000L)
'4q9XSiTDWYk7Z-W00000'
>>> base64.decode('4q9XSiTDWYk7Z-W00000')
'100000000000000000000000000000000000'

>>> from baseconv import BaseConverter
>>> myconv = BaseConverter('MyOwnAlphabet0123456')
>>> repr(myconv)
"BaseConverter('MyOwnAlphabet0123456', sign='-')"
>>> myconv.encode('1234')
'wy1'
>>> myconv.decode('wy1')
'1234'
>>> myconv.encode(-1234)
'-wy1'
>>> myconv.decode('-wy1')
'-1234'
>>> altsign = BaseConverter('abcd-', sign='$')
>>> repr(altsign)
"BaseConverter('abcd-', sign='$')"
>>> altsign.encode(-1000000)
'$cc-aaaaaa'
>>> altsign.decode('$cc-aaaaaa')
'-1000000'

License information

See the file "LICENSE" for terms & conditions for usage, and a DISCLAIMER OF ALL WARRANTIES.

This baseconv distribution contains no GNU General Public Licensed (GPLed) code, just like prior baseconv distributions.

All trademarks referenced herein are property of their respective holders.

Django

The Django Project includes a copy of this module on django.utils.baseconv.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].