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.0

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.0
File Size Uploaded
convbase-1.1.0.tar.gz 3.3 kB Details

Built distribution (wheel)

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

Total release size: 6.9 kB

Release files / convbase-1.1.0.tar.gz

Download URL convbase-1.1.0.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
96e47886fa233ecedcf71ad124098cc9f327c817564048ae55f76b811723247e
BLAKE2b-256 checksum
How to use checksums
075dba4a3462b54bea3dd549706dddced18dad31d1f98f9c30d5c9dc9c4de780
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 3, 2026.

Transparency log

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

Download URL convbase-1.1.0-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4418fc0a62148c4c69bbe05105797991717ba085b04186bf228a06d7153f965a
BLAKE2b-256 checksum
How to use checksums
4db9a7d2b656bda93df97634cb03c525a24c16f653277eb1c3967c6c71950678
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 3, 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