Skip to content

⚑ Auto-JIT your Python code with Numba @njit + optional AOT compilation πŸš€ Numeric-heavy code, boosted fast 🏎️

License

Notifications You must be signed in to change notification settings

pro-grammer-SD/autonumba

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

autonumba πŸš€

Autonumba is an aggressive auto-JIT tool that scans Python code and injects @njit wherever it safely can, with optional ahead-of-time (AOT) compilation into native binaries.

Features ✨

  • ⚑ Automatic JIT and AOT compilation for instant native speed
  • πŸ“‚ Boost folders, single files, or installed libraries
  • 🏷️ @libname syntax for installed site-packages
  • ❌ exclude.txt support for skipping files
  • βš™οΈ Configurable Numba flags for cache, fastmath, parallel, nogil, boundscheck
  • πŸ–₯️ CLI-first, fast, clean workflow
  • πŸ›‘ Supports #nonumba comment to skip functions from JIT injection

Installation πŸ’»

pip install autonumba

or from source:

git clone https://github.com/pro-grammer-SD/autonumba.git
cd autonumba
python -m pip install --user .

or use the prebuilt binary in bin/ (bin/autonumba.exe)

Usage πŸ“

Boost a folder:

python -m autonumba src -c -f -p -n -b

Boost a single file:

python -m autonumba main.py -c -f

Boost an installed library:

python -m autonumba @mylib -c -f -p

Modify files in-place:

python -m autonumba src -i -c -f -p -n -b

Enable ahead-of-time compilation:

python -m autonumba src --aot

Disable Rich output (for Windows encoding issues):

python -m autonumba src -nr

Nuitka compile to EXE after boost:

python -m autonumba main.py -cm

CLI Flags 🏷️

Flag Description
-i, --inplace ✏️ Modify files in place
-c, --cache πŸ’Ύ Enable njit cache
-f, --fastmath ⚑ Enable fastmath
-p, --parallel πŸ”€ Enable parallel loops
-n, --nogil πŸ›  Release GIL
-b, --boundscheck πŸ“ Enable bounds checking
--aot πŸš€ Force ahead-of-time compilation into binaries
-cm, --compile πŸ–₯ Nuitka compile to EXE after boost
-nr, --no-rich ❌ Disable rich output / emojis

Flags are enabled by default. Pass flags to selectively override defaults.

Notes ⚠️

  • Designed for numeric-heavy code.
  • Dynamic Python features (strings, IO, objects) may not compile correctly.
  • Use responsibly. Native binaries are fast but can break dynamic behavior.
  • Functions with #nonumba comment on the definition line will be skipped from JIT injection.

GitHub Stats πŸ“Š

GitHub Repo Stats GitHub Stats

Badges πŸŽ‰

Python Version License ![Build Status](https://img.shields.io