binarycalc
Number base conversion, text ↔ binary, Morse code, and LCM / GCF / factors for Python. It is the same Rust engine that runs BinaryCalc, a set of free online converters that show their steps. The engine is compiled to WebAssembly and runs through wasmtime.
pip install binarycalc
import binarycalc as bc
bc.convert("42", 10)["values"] # {'2': '101010', '8': '52', '10': '42', '16': '2A'}
bc.text_to_binary("Hi")["binary"] # '01001000 01101001'
bc.binary_to_text("01001000 01101001")["text"] # 'Hi'
bc.text_to_morse("SOS")["morse"] # '... --- ...'
bc.lcm("4, 6")["lcm"] # '12'
bc.gcf("12 18")["gcf"] # 6
bc.factors("12")["factors"] # [1, 2, 3, 4, 6, 12]
Every function returns a dict. When ok is False, error holds a readable message.
Functions
| Function | What it does | Online version |
|---|---|---|
convert(number, base=10) |
Converts between bases 2, 8, 10 and 16, with two's complement and steps | Binary converter |
text_to_binary(text, separator="space") |
UTF-8 text to 8-bit binary | Text to binary |
binary_to_text(binary, separator="space") |
8-bit binary back to text | Binary to text |
text_to_morse(text) / morse_to_text(morse) |
International Morse code | Morse code translator |
lcm(numbers) |
Least common multiple, with steps | LCM calculator |
gcf(numbers) |
Greatest common factor, with steps | GCF calculator |
factors(numbers) |
Factors, prime factors and factor pairs | Factor calculator |
group_digits(text, size) |
group_digits("101010", 4) returns '10 1010' |
separator is "none", "space" or "newline". The functions are safe to call from more than one thread.
License
MIT
Metadata
Release files for binarycalc 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| binarycalc-0.1.0.tar.gz | 48.8 kB | Without provenance | Details for binarycalc-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| binarycalc-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for binarycalc-0.1.0-py3-none-any.whl |
Total release size: 97.8 kB
Release files / binarycalc-0.1.0.tar.gz
| Download URL | binarycalc-0.1.0.tar.gz |
|---|---|
| Size | 48.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c3bf3f751680d67acfc6003f50d798c52df62513845baaede56052242440fc03
|
|
BLAKE2b-256 checksum How to use checksums |
da9f6f49b607f51e6fd9f946e69f852f3ae1993672d80bff2b388baf91a7566c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.0
|
Release files / binarycalc-0.1.0-py3-none-any.whl
| Download URL | binarycalc-0.1.0-py3-none-any.whl |
|---|---|
| Size | 49.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d838d8b3eb466a0400fa836f85541103551b120fc796650b7621dfcc5f828084
|
|
BLAKE2b-256 checksum How to use checksums |
8b1b6316a2b6682503ae8c33fb99b82429c3e222791b496e87f7d29894ae2248
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.0
|
Security for binarycalc 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.