Skip to main content

My Python Project: a command-line tool to create a Python project

Project description

PyPI version

My Python Project

Description

A simple tool to create a project with Python, an executable and an installer.

It's only for Windows, but future versions will make it independent of the operating system.

Installation

mpp can be installed using the pip package manager:

$ pip install mpp

Usage

Let's create a project together:

$ mkdir mpp_tuto
$ cd mpp_tuto

Setup your project easily

Just answer the questions, where the default values are between square brackets:

$ mpp setup
What is your project name? [mpp_tuto] MPP Tuto
What is your author name? [username] Name

The project's version is 0.0.0.
The project's icon can be found here: resources/images/icon.ico.
The `main.py` file can now be edited.

Use `mpp --help` to display all possible commands.
Use `mpp <command> -h` to display the help for a command.
Use `mpp config --list` to show your project settings.

Environment

After setuping your environment, some folders and files are created:

mpp_tuto/
    resources/
        images/
            icon.ico
    src/
    .mpp_config
    main.py
  • resources/: contains your project's files;
  • src/: contains the sources of your project;
  • .mpp_config: stores yout project's settings;
  • main.py: main python file.

mpp will create 2 more folders after freezing and generating an installer:

mpp_tuto/
    installer/
    target/
  • installer/: contains the specification files needed to freeze and generate an installer;
  • target/: contains the created executable and installer;

Show your configuration

$ mpp config --list
 -→ name = MPP Tuto
 -→ author = Name
 -→ version = 0.0.0
 -→ console = True
 -→ icon = resources/images/icon.ico
 -→ hidden-imports = []

Edit your configuration

$ mpp config author version
What is your author name? [Name] John
What is the new version? [0.0.0] 0.0.1

Are you sure of your modifications (y/n)? y

Process your project version

Show your project version:

$ mpp version
Project 0.0.0

Increment the version:

$ mpp version +
Project 0.0.1

$ mpp version ++
Project 0.1.0

$ mpp version +
Project 0.1.1

$ mpp version +++
Project 1.0.0

Freeze your project with PyInstaller

If PyInstaller is not installed, mpp asks if it can do it for you:

$ mpp freeze
It seems that PyInstaller is not installed.
Please, consider using `pip install PyInstaller`.
Current pip is path/to/pip.
Do you want to install it now (y/n)? [y]
[pip output]

[PyInstaller outpout]

Executable can be found here: target/Project/Project.exe

If you want to generate only the specification file:

$ mpp freeze --spec

Create an installer for your project with NSIS

If ShellExecAsUSer.dll is not in the installer folder, mpp asks if it can download it for you:

$ mpp installer
NSIS needs "ShellExecAsUser" in order to create the installer.
Do you want to download it (y/n)? [y]

Downloading... Done
[NSIS output]

Installer can be found here: target/Project_setup.exe

If you want to generate only the specification file:

$ mpp installer --spec

Credits

This project was originally inspired from fbs.

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

mpp-0.1.5.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

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

mpp-0.1.5-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

Details for the file mpp-0.1.5.tar.gz.

File metadata

  • Download URL: mpp-0.1.5.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.1

File hashes

Hashes for mpp-0.1.5.tar.gz
Algorithm Hash digest
SHA256 0801c199182440b09cd6c22f09af22f7ce5cd95f9ca33c8623433a52ef859a67
MD5 db79103e29d19c88d3e123cfe7639038
BLAKE2b-256 29d24b54345d66d9708416d99c151d071f8cc70cc963261b61ad29002bb02056

See more details on using hashes here.

File details

Details for the file mpp-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: mpp-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 22.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.1

File hashes

Hashes for mpp-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f87f1a72bb9da78871ae5df2735bdea23fde98f6a97534c5e9ea0669cec0f4e9
MD5 c13208b4154d9cc50a52b72c54ccfbc0
BLAKE2b-256 f919c9ab8f9488fa8f8e13e653693b11d90e060943b70dce3a3d5ed1b5d13c3e

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