Skip to main content

convbase

PyPI - Status PyPI - Version PyPI - License PyPI - Python Version CI

A command-line utility for converting integers between binary, octal, decimal, and hexadecimal bases.

Installation

pip install convbase

Or with uv:

uv tool install convbase

Commands

Command Output base
bin Binary (0b)
oct Octal (0o)
dec Decimal
hex Hexadecimal (0x)

Input formats

All commands accept VALUE in any of the following formats:

Format Prefix Example
Decimal (none) 10
Binary 0b 0b1010
Octal 0o 0o12
Hexadecimal 0x 0xA

Examples

$ bin 10
0b1010
$ bin 0xFF
0b11111111

$ oct 0b1010
0o12
$ oct 0xA
0o12

$ dec 0b1010
10
$ dec 0xFF
255

$ hex 10
0xa
$ hex 0b11111111
0xff

Error handling

Passing a value that cannot be parsed as an integer exits with a non-zero status and prints an error:

$ bin hello
Error: Invalid value for 'VALUE': invalid integer: 'hello'

Development

git clone https://github.com/jkomalley/convbase
cd convbase
just install
just check     # format, lint, type-check, and test

License

MIT

Metadata

Release files for convbase 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for convbase 1.1.1
File Size Uploaded
convbase-1.1.1.tar.gz 4.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for convbase 1.1.1
File Interpreter ABI Platform
convbase-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 8.8 kB

Release files / convbase-1.1.1.tar.gz

Download URL convbase-1.1.1.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8f643904519de0b80d21bde47d959c42a2680a754dfe77133df9d3d25419ea7d
BLAKE2b-256 checksum
How to use checksums
f8f94e06e0ec8f02f35fa50acb67baea901683e20c7d359474f5e4869b33ed3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.

Transparency log

Release files / convbase-1.1.1-py3-none-any.whl

Download URL convbase-1.1.1-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4adce246a240a8e1c60c6176546a10acbd94a37b45bf0f0ec0d3851fda4d723
BLAKE2b-256 checksum
How to use checksums
94fb9afa929264fbef2fb040a445ddea01233e0825716db53fa41240e9d4595b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page