Skip to main content

Easy Python Commands

Project description

bash

GitHub Release

ezpyc

Easy Python Commands allows you to execute your python scripts as if they were system commands.

Without ezpyc:

python mycommand.py
# or
python C:\Users\wintermute\dev\mycommand.py

With ezpyc:

mycommand

✅ Requirements

  • Python >=3.11
    • Add python.exe to PATH
  • Windows >=10

🖥️ How to install ezpyc for Windows

Clone repo and run python src/ezpyc.py install as administrator:

git clone https://github.com/itonx/ezpyc
cd ezpyc
python src/ezpyc.py install

Output:

└─ ...
▒ Setup done. Create a new python script at C:\Users\wintermute\.ezpyc and try to run it. If you cannot execute it, restart your terminal or open a new one.

Once the installation's done you'll be able to execute your python scripts as if they were simple windows commands. All scripts must be added to %USERPROFILE%\.ezpyc if don't want to type the full path of your scripts.

Installation details

The installation will make the next changes on your system:

  • Create .ezpyc folder: %USERPROFILE%\.ezpyc
  • Add .ezpyc folder to PATH environment variable for CURRENT_USER
  • Add .PY extension to PATHEXT environment variable for LOCAL_MACHINE
  • Add built-in ezpyc scripts

Built-in ezpyc scripts

%USERPROFILE%\.ezpyc
│   ezpyc.py
└───ezpyc
    __init__.py
    clipboard.py
    command_decorators.py
    env_variable.py
    file.py
    folder.py
    installation_wizard.py
    os_decorators.py
    output.py

Details:

  • %USERPROFILE%\.ezpyc\ezpyc is a python package which contains shared code for ezpyc.py.
  • ezpyc.py manages your ezpyc installation

ezpyc command accepts -h and --help args.

⚒️ Create your first script/command

This process is as simple as creating a new file with a print.

mycommand.py

print('mycommand works')

Magic happends once you place your scripts at %USERPROFILE%\.ezpyc.

%USERPROFILE%\.ezpyc
└───mycommand.py

Open a terminal and run the command using the name of your script (no need to type the full path or restart the terminal if you add new scripts to .ezpyc folder):

mycommand

If you want to know how to process command line arguments with click see documentation: https://click.palletsprojects.com/en/stable/.

🖥️ How to uninstall

Option 1: ezpyc_installer.py

Clone repo and run python src/ezpyc.py uninstall as administrator:

git clone https://github.com/itonx/ezpyc
cd ezpyc
python src/ezpyc.py uninstall

Output:

└─ ...
▒ ezpyc's been uninstalled. C:\Users\wintermute\.ezpyc needs to be deleted manually, don't forget to backup your scripts.

Method 2: built-in ezpyc command

This will work only if you installed ezpyc.

Run as administrator:

ezpyc uninstall

Output:

└─ ...
▒ ezpyc's been uninstalled. C:\Users\wintermute\.ezpyc needs to be deleted manually, don't forget to backup your scripts.

NOTE: Commands will be available until you restart your terminal or open a new one.

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

ezpyc-0.1.1.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

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

ezpyc-0.1.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file ezpyc-0.1.1.tar.gz.

File metadata

  • Download URL: ezpyc-0.1.1.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for ezpyc-0.1.1.tar.gz
Algorithm Hash digest
SHA256 848e78186a2fb46ffca27148e41475d7f04a3e0242bf33aad860d754ff82aa93
MD5 94512f839475fbeeb80189256fba7ec4
BLAKE2b-256 75772f2f0bacd58d18577fe0ac0485434f8a323e6d24946097681e6d2e424187

See more details on using hashes here.

Provenance

The following attestation bundles were made for ezpyc-0.1.1.tar.gz:

Publisher: python-publish.yml on itonx/ezpyc

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

File details

Details for the file ezpyc-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ezpyc-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for ezpyc-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ec87aec6e9b22bc0f81ebced6fe6e79fc9139566ae006c02d992133ee8142328
MD5 59a379f306a457265229ed06162a5e28
BLAKE2b-256 880cffb2f65a1be0702815fcd953e2f57acb17cbf6e4ec36ff11586ce27cbd19

See more details on using hashes here.

Provenance

The following attestation bundles were made for ezpyc-0.1.1-py3-none-any.whl:

Publisher: python-publish.yml on itonx/ezpyc

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