nano-base
Tiny base converter (2..36) — ~1 KB, zero deps.
255 → FF (base 10→16), FF → 11111111 (16→2), negatives supported. Perfect for code-golf, minimal containers, or just for fun.
✨ Features
- ✅ Convert between any bases 2..36 (digits
0-9A-Z, case-insensitive) - ✅ Two forms:
<value> <to_base>(assumesfrom=10)<value> <from_base> <to_base>
- ✅ Handles negatives,
0
🚀 Usage
# Local (from repo)
python app_min.py 255 16 # FF
python app_min.py FF 16 2 # 11111111
python app_min.py -42 10 16 # -2A
After installing:
# CLI
pip install nano-base
nano-base 255 16 # -> FF
nano-base FF 16 2 # -> 11111111
nano-base -2A 16 10 # -> -42
🤓 Why so small?
- Uses int(s, base) + tiny loop to format in target base
- No bigint libs; Python int already arbitrary precision
- Single tiny file + tiny CLI: perfect for scripts, containers, CI.
🎉 Fun Ideas
- Hex table (0..255)
for i in $(seq 0 255); do printf "%3d -> %s\n" $i "$(nano-base $i 16)"; done
- Binary width (pad with printf)
printf "%08d\n" "$(nano-base 42 2)" # 000101010 (pad separately)
- Base36 IDs
nano-base 123456789 10 36 # -> 21I3V9
Note: Valid range is bases 2..36; input is case-insensitive (a..z ≡ A..Z).
📜 License
MIT © 2025
Metadata
Release files for nano-base 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 |
|---|---|---|---|---|
| nano_base-0.1.0.tar.gz | 3.2 kB | Without provenance | Details for nano_base-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nano_base-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for nano_base-0.1.0-py3-none-any.whl |
Total release size: 6.8 kB
Release files / nano_base-0.1.0.tar.gz
| Download URL | nano_base-0.1.0.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bcf63997b4877403a2825fb2c6fa80084b84db5a41dcda1fdc72a43b617b1db3
|
|
BLAKE2b-256 checksum How to use checksums |
6586f2e129a2bb5c943e808ab040ccabaa0c6dd6b7fa53d09a9d2ad1f12fdd24
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|
Release files / nano_base-0.1.0-py3-none-any.whl
| Download URL | nano_base-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9e914418e5ed9f065a334f8eaa1aebb1faa1a80fed1ea57c76c5455ca305fc4a
|
|
BLAKE2b-256 checksum How to use checksums |
95e848bcebed7f1f4b80b5a337b60d52dc1526b481c980265d64d7674b6849ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|
Security for nano-base 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.