Description
A CLI tool to convert numbers between bases, with as little typing as possible.
$ bs FFFE
[from hexadecimal]
decimal 65534
binary 1111111111111110
octal 177776
$ bs -t d F
15
Installation
This is a Python 3 script, installed from PyPI using pip.
pip3 install baseconvertcli
Hasn't been tested on Windows.
Examples
If you don't specify a base, it does all common conversions.
$ bs 0
[from decimal]
binary 0
hexadecimal 0
octal 0
[from binary]
<clipped output here>
Specifying base through a flag.
$ bs --from hex F
[from hexadecimal]
decimal 15
binary 1111
octal 17
From base-6.
$ bs --from 6 54
[from base-6]
decimal 34
binary 100010
hexadecimal 22
octal 42
To base-7.
$ bs --to 7 54
[from decimal]
base-7 105
[from hexadecimal]
base-7 150
[from octal]
base-7 62
Specifying both input and output bases.
$ bs --from hex --to dec F
15
Shorthand for lazy people.
$ bs -f h -t d F
15
Aaaaand input through a pipe.
$ echo '5+10' | bc | bs -t h
[from decimal]
hexadecimal F
[from octal]
hexadecimal D
Contributing
Feel free to submit tweaks. To run tests, install tox via pip3 install tox and then run the tox command from the base directory.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file base-convert-cli-1.0.0.tar.gz.
File metadata
- Download URL: base-convert-cli-1.0.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a3b7cd73199bc2a117c113fbbfd0bddc3c64f8d05468d14d0bf3638e6a89bf5
|
|
| MD5 |
8e2709c7750ef0a98ef09106ca6ab4a7
|
|
| BLAKE2b-256 |
464940bfcdd66b4fadaef7b66dbe300a26be6285deaddbd33bc88aefa417f1d5
|
File details
Details for the file base_convert_cli-1.0.0-py3-none-any.whl.
File metadata
- Download URL: base_convert_cli-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ecee3eaaf725fc1539740601cd4d0ac635dd174bb0428477eabc200c6e1bc13
|
|
| MD5 |
33f335628e512c4b5f8217299113eccf
|
|
| BLAKE2b-256 |
f37fb8b845fa55305d2bb10bf26b84e60fc2f294beeb63a0b491078ce76d615a
|