Skip to main content

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

Project description

Make runnable desktop/cmd apps from your python scripts!

Downloads PyPI

Install

pip install pyvan

or download pyvan.py file.

Usage

Using the command line:

pyvan main.py

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": [],
  "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": "",
}

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
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_location TODO for now pyvan will create a .bat file which links the main_file_name with python.exe in the future will add something that will convert the .bat to .exe and you will be able to set it an icon too

Thanks to silvandeleemput for extending the available options and adding support for CLI commands.

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

For creating a .exe with a custom icon checkout bellow repos:

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 .bat file between python(w).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!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyvan-1.0.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyvan-1.0.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file pyvan-1.0.0.tar.gz.

File metadata

  • Download URL: pyvan-1.0.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/51.3.3 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5

File hashes

Hashes for pyvan-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0a42ec76a0c1eaf561e0d89c95991ba2bb34b9ddfdc999222265077f97b8480c
MD5 0623250f1271c3cdaa5601c325bb5d1c
BLAKE2b-256 4cb4c99c6288c0e00d1f23d47aec0e8cb6d3a865a699530da9cecd36f1204c0f

See more details on using hashes here.

File details

Details for the file pyvan-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pyvan-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/51.3.3 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5

File hashes

Hashes for pyvan-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f58c016bb4237e9d020d5de200b57d6b37ca5ac177ec71c85deb169734474562
MD5 231ee6cc7d4ec865a315d3fb8f5712c7
BLAKE2b-256 ed85b7491100751a336403623a37b6700e242a0d1d5738a36a94e816a936e244

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page