Repository navigation
Releases
mojo-pyformat v0.2.2
mojo-pyformat-public v0.2.2
Released: 2026-11-08 · Commit: 60482a6 · Previous: v0.2.1
What it does
Python's format() for numbers in Mojo, with the same digits: {:.Nf}, thousands separators, g, e, and %, rounded on the double's exact binary value as CPython does.
Highlights
- Packaging only: the conda recipe pins
mojo-compilerto the minor the package was built with (<1.3.0a0), so it cannot be installed on a Mojo it does not load on.
Changes
Changed
recipe.yaml:mojo-compilerrun dependency pinned to the build's minor (<1.3.0a0).
Verified
| Check | Result |
|---|---|
pkg-conda dry run on the version commit (H1-H3,H6) |
PASS: mojo-pyformat-0.2.2-hb0f4dca_0.conda |
Known limits
- Packages are built on one Mojo minor only; see the package protocol.
Upgrade / run
None: no API change.
Commits
60482a6build: bump version to 0.2.287f5686build: recipe pins mojo-compiler to the build's minor
mojo-pyformat v0.2.1
mojo-pyformat-public v0.2.1
Released: 2026-11-07 · Tag: v0.2.1 · Previous: v0.2.0
What it does
Python's format() for numbers in Mojo, with the same digits: {:.Nf}, thousands separators, g, e, and %, rounded on the double's exact binary value as CPython does.
Highlights
- Docs only: CHANGELOG names no home path.
Changes
Changed
CHANGELOG.mdand the release notes name no home path.
Verified
| Check | Result |
|---|---|
mojo-lib-audit on this tree |
PASS |
gh-publish --check (ci-local) |
OK |
Known limits
- As in v0.2.0.
Upgrade / run
None: no code or API change.
Commits
git log v0.2.0..v0.2.1
mojo-pyformat v0.2.0
mojo-pyformat v0.2.0
Released: 2026-11-04 · Tag: v0.2.0 · Previous: v0.1.2
What it does
Python's format() for numbers in Mojo, with the same digits: {:.Nf}, thousands separators, g, e, and %, rounded on the double's exact binary value as CPython does.
Highlights
py_repr(x): Pythonrepr(float)digit for digit. Mojo 1.2's own float printing is not round-trip safe (it prints two different doubles as3.000000005061751e+16and writese+015); this is the fix when text must equal Python.
Changes
Added
py_repr, with 653reprrows in the oracle grid; whole numbers below 1e16 take an exact fast path.
Verified
| Check | Result |
|---|---|
scripts/ci.sh (15,511 lines vs Python 3.14 format and repr, every power of two included, plus 43,660 wide lines with 804 repr on random bits and subnormals) on Mojo 1.2.0; scripts/check.sh on 1.3.0.dev2026110305 |
PASS |
Known limits
py_reprtries up to 17 precisions withatoffor non-integral values, about 1 µs each; fine for output text, not for hot loops.
Upgrade / run
from pyformat import py_repr
Commits
- All commits from
v0.1.2to tagv0.2.0:git log v0.1.2..v0.2.0.
mojo-pyformat v0.1.2
mojo-pyformat-public v0.1.2
Released: 2026-11-04 · Commit: d3e641f · Previous: v0.1.1
What it does
Python's format() for numbers in Mojo, with the same digits: {:.Nf}, thousands separators, g, e, and %, rounded on the double's exact binary value as CPython does.
Highlights
py_sumkeeps infinities like CPython; a width or precision that overflows raises instead of misformatting.- README has one install block and one example; a conda recipe ships the package.
Changes
Added
recipe.yaml: a conda package recipe.- CI, latest-release and license badges in the README.
Changed
- README: one install and quickstart block, one example.
Fixed
py_sumkeepsinflike CPython.- A width or precision that overflows raises an error.
Verified
| Check | Result |
|---|---|
ci-local at d3e641f: the GitHub workflow in a clean Ubuntu 24.04 container, Mojo 1.2.0 |
PASS |
Known limits
- As in v0.1.1.
Upgrade / run
uv sync # installs Mojo 1.2.0
Commits
d3e641ffix(release): pyproject.toml, recipe.yaml, uv.lock say 0.1.271c7742build: conda recipeab83ec8docs: one example, one install blocka6cf040docs: install and quickstart block0c9b45dfix(format): py_sum keeps inf like CPython; width/precision overflow raisescce527cfix(release): pyproject and uv.lock say 0.1.1, the version of the latest tag0e22c27docs: CI, latest-release and license badges
mojo-pyformat v0.1.1
mojo-pyformat v0.1.1
Released: 2026-10-29 · Commit: dc266f0 · Previous: v0.1.0
What it does
Python's format() for numbers in Mojo, with the same digits: {:.Nf}, thousands separators, g, e, and %, rounded on the double's exact binary value as CPython does.
Highlights
- Builds and runs on the stable Mojo 1.2.0 release.
Changes
Changed
- The pin moves to Mojo 1.2.0 (
pyproject.toml,uv.lock); README and skill say Mojo 1.2.
Verified
| Check | Result |
|---|---|
ci-local: the GitHub workflow in a clean Ubuntu 24.04 container, Mojo 1.2.0 |
PASS |
Known limits
- As in v0.1.0.
Upgrade / run
uv sync # installs Mojo 1.2.0
Commits
dc266f0build: Mojo 1.2.01fdcf1adocs: NOTICE names the owner and contact
mojo-pyformat v0.1.0
mojo-pyformat v0.1.0
Released: 2026-10-21 · Commit: a66c107 · Previous: first release
What it does
Python's format() for numbers in Mojo, with the same digits: {:.Nf}, thousands separators, g, e, and %, rounded on the double's exact binary value as CPython does.
Highlights
- Identical to Python on 10,846 cases and on a wider 42,856-case set (random bit patterns, subnormals, precision up to 100, numbers to 1.8e308).
.2fis 5.9x faster than Python (1M values: 40 ms vs 234 to 242 ms);gandeabout 2x.format(2.675, '.2f')gives2.67, as Python does, because the stored double is just under 2.675.
Changes
First public release, no earlier version.
Verified
| Check | Result |
|---|---|
scripts/check.sh: 10,846 cases vs Python format() |
PASS all |
tools/oracle_wide.py in scripts/ci.sh: 42,856 cases |
identical |
scripts/ci.sh on a pristine Ubuntu 24.04.5 VM (Python 3.12.3) |
PASS all |
Known limits
- Specs outside the supported grammar raise:
+/space sign,0padding,#,_, upper-case types,,on a float. - Peak memory is the Mojo runtime's floor, about 2 MB above Python.
Upgrade / run
git clone https://github.com/amarbaro/mojo-pyformat && cd mojo-pyformat && uv sync
mojo run -I src examples/quickstart.mojo
Commits
a66c107docs(pyformat): README, api, design, agent skill, CI script and workflow14eeee6bench(pyformat): 1M values as .2f, g, .3e against Python format()968f2aafeat(pyformat): f, e, g, % and int commas, exact on the binary value9c415f2test(pyformat): Python format() oracle, 10,846 value x spec cases5dd7dfachore: repo layout, Apache-2.0, mojo>=1.1