• Stars
    star
    138
  • Rank 264,508 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created over 5 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Make runnable desktop apps from your python scripts more easily with pyvan!

Make runnable desktop/cmd apps from your python scripts!

Downloads PyPI

Install

pip install pyvan

Make sure you have Python 3.8 or above.

Usage

Using the command line:

pyvan main.py 

For a gui application add --no-console flag:

pyvan main.py --no-console

You can see available flags with:

pyvan --help

Or

Make a "van.py" file next to the "main.py" file (entry point of your program)

Paste the code bellow:

import pyvan

OPTIONS = {
  "main_file_name": "main.py",
  "show_console": False,
  "use_existing_requirements": True,
  "extra_pip_install_args": [],
  "python_version": None,
  "use_pipreqs": False,
  "install_only_these_modules": [],
  "exclude_modules": [],
  "include_modules": [],
  "path_to_get_pip_and_python_embedded_zip": "",
  "build_dir": "dist",
  "pydist_sub_dir": "pydist",
  "source_sub_dir": "",
  "icon_file": None,
}

pyvan.build(**OPTIONS)

 

Configurations

Option Default Description
main_file_name required the entry point of the application
show_console True show console window or not (for a service or GUI app)
use_existing_requirements True if True pyvan will use an existing requirements.txt file instead of generating one using the: `use_pipreqs
extra_pip_install_args [] pyvan will append the provided arguments to the pip install command during installation of the stand-alone distribution.The arguments should be specified as a list of strings
python_version None pyvan will attempt use the specified Python distribution for creating the stand-alone application, 3.8.x, 3.9.1, or x.x.x are valid formats
use_pipreqs True pipreqs tries to minimize the size of your app by looking at your imports (best way is to use a virtualenv to ensure a smaller size
install_only_these_modules [] pyvan will install only the modules mentioned here
exclude_modules [] modules to exclude from bundle
include_modules [] modules to include in the bundle
path_to_get_pip_and_python_embedded_zip '' by default is the Download path (path to 'get-pip.py' and 'python-x.x.x-embed-amdxx.zip' files)
build_dir dist the directory in which pyvan will create the stand-alone distribution
pydist_sub_dir pydist a sub directory relative to build_dir where the stand-alone python distribution will be installed
source_sub_dir '' a sub directory relative to build_dir where the to execute python files will be installed
input_dir '.' the directory to get the main_file_name file from
icon_file None path to icon file to use for your application executable, doesn't use one by default

Thanks to silvandeleemput for extending the available options, adding support for CLI commands, automating the download of get-pip.py, embedded python zip and making possible the generation of an executable file!

I think pyvan is the only python bundler which makes possible shipping a python application along with a modifiable source code.

If pyvan didn't manage to install all the modules needed go in dist/Scripts folder and install them manually with pip install module

Since Mac and Linux have already Python installed pyvan focuses only on Windows.

Why pyvan?

pyvan it's just one file which takes the embedded python version, installs the modules you need and makes a link using a .exe file between python.exe and your main.py script.
It's easy if something goes wrong for whatever reason you can just go in the dist folder and solve the issue the python way (because there is just python and your scripts :).

Submit any questions/issues you have! Fell free to fork it and improve it!

More Repositories

1

flaskwebgui

Create desktop applications with Flask/Django/FastAPI!
Python
680
star
2

fastapi-mongo-caddy2-vue-react-svelte

JavaScript
14
star
3

fiberwebgui

Create cross-platform desktop apps using Fiber and GO!
Go
13
star
4

PFASimplu

Aplicatie/soft pentru cei care tin contabilitatea in partida simpla (PFA/II, etc)
HTML
10
star
5

Local-Remote-Developer-Jobs-Aggregator

Customizable remote jobs aggregator.
JavaScript
9
star
6

vue-mithril-comparison

A comparison between Vue and Mithril.
JavaScript
9
star
7

pandas-dataframe-to-sqlite3-database

This file can be used to save to database all existing excel/txt files from a given folder
Jupyter Notebook
5
star
8

pywebview-flask-boilerplate-for-python-desktop-apps

Boilerplate for pywebview + flask medium size apps
Python
5
star
9

pyrobogui

Wrapper around pyautogui - plus some new functions. Ideal for doing robotic process automation.
Jupyter Notebook
5
star
10

kerground

Stupid simple background worker based on python.
Python
4
star
11

react-mithril-comparison

A comparison between React and Mithril.
JavaScript
4
star
12

htmgem

Generate HTML with Python.
Python
3
star
13

py7zip

Unzipping password protected files with 7zip and python fast!
Python
3
star
14

tkinter-boilerplate

tkinter boilerplate with progress bar/ status bar/ percentage indicator / fields inputs / labels
Python
3
star
15

simple-server-monitor

Monitor your web apps with a simple chrome extension. Get notified on events you consider important.
JavaScript
3
star
16

simple-firebase

Firebase made a little bit easier.
HTML
2
star
17

svelte-mithril-comparison

A comparison between Svelte and Mithril
JavaScript
2
star
18

sales-assistant-react-golang-sql

TypeScript
1
star
19

bunjucks

Create custom static websites fast!
CSS
1
star
20

vamp-theme-notepad

Dark theme for notepad++
1
star
21

dsjs

Snippets for doing data science stuff with Javascript in the browser
JavaScript
1
star
22

gobadrepo

Useful CRUD funcs over sqlx go package
Go
1
star
23

Python-reverse-binary-from-files

Reverse binary from files given
Python
1
star