Skip to main content

YABI

Ever wanted to use braces instead of indentation in Python? No? Well, it's possible now!

Installing

pip install yabi-bython

Running

# run file
yabi file.by
# run module
yabi -m module
# run interactive console
yabi
# run code from command line
yabi -c "import os; try { os.remove('/') } except { print('Bruh') }"

Run yabi --help to see other options.

Is YABI better than other implementations?

  • Doesn't have problems with dicts
  • Has full import support (any .by file can be imported)
  • Has .pyc support (code is cached after translation)

It can have bugs though, I'd be glad if you opened an issue in case you encounter one.

If your condition contains { or lambda, remember to parenthesise it:

# Wrong
if x := {a for a in range(n)} { print("Hello") }
# Correct
if (x := {a for a in range(n)}) { print("Hello") }

Perfect for one-liners

Braces and semicolons allow to make any code a one-liner. But, like, why would you do that?

C-style preprocessing?!

In case braces aren't enough for you, there's an option to enable C-style preprocessing. You can do so by passing --enable-preprocessing as argument to YABI or putting #pragma pypp on into the code. YABI heavily relies on PWCP after all.

Converting Python files

You don't need to convert anything because .py files can be imported into .by. YABI provides yabi-convert in case you still want to convert. The output may be a little weird but should still be correct.

yabi-convert something.py > something.by

Acknowledgements

Inspired by https://github.com/mathialo/bython and my friend ByThon.

Metadata

Release files for yabi-bython 0.10.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 yabi-bython 0.10.0
File Size Uploaded
yabi_bython-0.10.0.tar.gz 11.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for yabi-bython 0.10.0
File Interpreter ABI Platform
yabi_bython-0.10.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 21.9 kB

Release files / yabi_bython-0.10.0.tar.gz

Download URL yabi_bython-0.10.0.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
827cec3d872ba832180fb7aa5ab806fa2741359f63f4b40f045226b92442d04f
BLAKE2b-256 checksum
How to use checksums
449d341344e80a16e7e39f2a1036882964f07376a72d7895919969d2a4979058
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 Aug 13, 2026.

Transparency log

Release files / yabi_bython-0.10.0-py2.py3-none-any.whl

Download URL yabi_bython-0.10.0-py2.py3-none-any.whl
Size 10.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
1a48f22657c8d41be8baf31c08434695753b6a119547c9909c7da7519f27bf3e
BLAKE2b-256 checksum
How to use checksums
9d99b1d9de649802ea91bb157685fd91570a2222fd2ac610443682c5e840bdd9
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 Aug 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.10.0 This release

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.3

2 release files

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