Quark.py is a super lightweight Python framework made for packaging HTML, CSS, and JS codes into simple very desktop applications.
- HTML, CSS and JS packed into desktop apps.
- About 65% lighter than Electron in file size.
- Very light and uses Python.
- Does not packs Chromium inside the apps.
- Faster startup than other frameworks and quite optimized.
- Caching strategies implemented for improved performance.
- Easy distribution of apps.
-
Optimize asset sizes: The application bundle was reduced using PyInstaller's binary and size optimization flags.
- Problem: Normally unoptimized build command looks like this
python -m PyInstaller --name "myapp" quark.py, which leads to formation of lots of DLLs and tons of dependencies along with the exe. - Solution: Using the optimization flags (--clean, --onefile etc.) on the build command fixes it all and slap everything by removing debug symbols, caches, temp files etc. and the finished command looks something like this
python -m PyInstaller --onefile --noconsole --name "name of your app" --clean --add-data "web;web" quark.py --icon "icon.ico" - Proof: Everything turned into a single file and about 45% app size reduction.
- Problem: Normally unoptimized build command looks like this
-
Lazy loading: Uses a super low code loader screen on app launch and slow transition to the app main content and lazy loads the unseen JS codes until the user clicks or perform any action.
-
Problem: Everything loads at start which utilises resources heavily and certain lazy loading techniques mentioned above can be used to reduce that issue.
-
Solution: Creating a loader.html to load the app first on low resource and gradually using resource when only required, and JS can be easily loaded later only when users require it. And loading="lazy" was set to lots of HTML tags too.
-
Proof: After optimization, ~29% fewer requests, ~39% smaller transfers, ~44% less resource usage and lot slower content loading. Before vs After Optimization:
-
- Can I make apps for Linux and Mac too? Ans: For now it's not possible but I will consider in future.
- How small is it in file size compared to other frameworks? Ans: Quark.py apps are about 60% more smaller than other framework apps.
- Will it work across all Windows OS? Ans: You must have a well-updated version of Windows 10/11 with latest Webview2 (comes with Edge).
- Click here to download directly or Clone the repo.
- Install dependencies:
pip install -r requirements.txt- Edit the files inside the
/webandquark.pyaccording to your needs. - Build your
.exeapp:
python -m PyInstaller --onefile --noconsole --name "name of your app" --clean --add-data "web;web" quark.py --icon "icon.ico"
OS: Windows 10 Home, 22H2
No AI has been used to type any part of the README file.