Skip to content
AhnafProPublic

About

Quark.py is a lightweight Python framework for packaging HTML, CSS, and JS code into simple desktop apps. It is about 65% lighter than Electron in file size and does not bloat with Chromium. My framework was carefully crafted with optimization techniques like lazy loading, memory management etc.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

47 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quark.py

PyPI version demo.webm

Quark.py is a super lightweight Python framework made for packaging HTML, CSS, and JS codes into simple very desktop applications.

Why use Quark.py instead of other frameworks like Electron?
  • 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.
Optimizations
  1. 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.
    Untitled design (70)
  2. 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:

      image image
FAQ
  • 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).
How to use:
  1. Click here to download directly or Clone the repo.
  2. Install dependencies:
   pip install -r requirements.txt
  1. Edit the files inside the /web and quark.py according to your needs.
  2. Build your .exe app:
   python -m PyInstaller --onefile --noconsole --name "name of your app" --clean --add-data "web;web" quark.py --icon "icon.ico"
Benchmark device specs:
image OS: Windows 10 Home, 22H2

No AI has been used to type any part of the README file.

About

Quark.py is a lightweight Python framework for packaging HTML, CSS, and JS code into simple desktop apps. It is about 65% lighter than Electron in file size and does not bloat with Chromium. My framework was carefully crafted with optimization techniques like lazy loading, memory management etc.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages