Skip to main content

PyStand打包命令行工具

Project description

PyStand-cli

This tool packages a Python project into a standalone executable using PyStand and embeddable Python. It supports excluding specific directories and files, and provides a progress bar for file copying.


Installation

  1. Install:

    pip install pystand-cli
    
  2. Upgrade:

    pip install --upgrade pystand-cli
    

Usage

Basic Command

pystand-cli entry_script.py [OPTIONS]

Options

Option Description
--project-dir The project directory (optional).
--exclude-dirs Folders to exclude (optional, can be specified multiple times).
--exclude-files Files to exclude (optional, can be specified multiple times).
--output-dir The output directory (optional, default is dist).
--noconsole Run the application without a console window (optional).
--python-repo The Python FTP repository URL (optional, default is https://www.python.org/ftp/python).

Examples

  1. Package a project with an entry script:

    pystand-cli entry_script.py --project-dir /path/to/project
    
  2. Exclude specific directories and files:

    pystand-cli entry_script.py --project-dir /path/to/project --exclude-dirs node_modules --exclude-files .gitignore
    
  3. Run without a console window:

    pystand-cli entry_script.py --project-dir /path/to/project --noconsole
    
  4. Custom output directory:

    pystand-cli entry_script.py --project-dir /path/to/project --output-dir /path/to/output
    

Output Structure

The output directory will contain the following structure:

output_dir/
├── runtime/                # Embeddable Python runtime
├── site-packages/          # Python site packages
├── main.exe                # PyStand executable
├── main.py                 # Entry script
└── ...                     # Other files and directories

Notes

  • Embeddable Python: The tool downloads the embeddable Python runtime from the official Python FTP repository.
  • PyStand: PyStand is used to create a standalone executable from the entry script.
  • Exclusion: Excluded directories and files are not copied to the output directory.
  • GUI Applications: Use the --noconsole option to run the application without a console window. CLI applications should not use this option.

License

This project is licensed under the MIT License. See the LICENSE file for details.


Contributing

Please open an issue or submit a pull request.


Acknowledgments

  • PyStand by skywind3000.
  • Click for command-line interface support.

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

pystand_cli-0.1.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

pystand_cli-0.1.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file pystand_cli-0.1.0.tar.gz.

File metadata

  • Download URL: pystand_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pystand_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cc0f52678233075c16e88416957d8826b887e28e167190a4b7ef3a1d3f418e2b
MD5 dc67ffcae25d0968d07593d443da2021
BLAKE2b-256 65e95152961458de0754539663c752a5dd42c39f4a1f6659fbfd27f1502cc0b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pystand_cli-0.1.0.tar.gz:

Publisher: python-publish.yml on ASTWY/PyStand-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pystand_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pystand_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pystand_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 71ace064fa9d9e425cbfb6cd0aa10c6994467fb33f3fd47b3fc68227da179ffb
MD5 3800739d1b673da59a3d7ba4e2208208
BLAKE2b-256 ec1b0117cabc0c2e56353ad00203de315bb7a7373c427b695ce9c6356afdbf6c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pystand_cli-0.1.0-py3-none-any.whl:

Publisher: python-publish.yml on ASTWY/PyStand-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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