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.2.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.2-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ezpyc-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a2b002a4a22e3a30dae75b1cbc11eb12a1e84a4835bf6fdf1169fa16a60bd64c
MD5 c102926c9738eacd9402d39dea888706
BLAKE2b-256 8b9a0ddac740124687d3dd2918041480cf9426fdb145fabb79eec996f8b562ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for ezpyc-0.1.2.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.2-py3-none-any.whl.

File metadata

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

File hashes

Hashes for ezpyc-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 408c3469a87b71398745d5bda0219aeb54693ddb13f011702c4e777270011c39
MD5 5f60b218fdeaa75f7ebee0d23a29b36e
BLAKE2b-256 17083caf2480c1fe6dca8499abf8726bfa6bce6facd4f7d2217566a9f844f6dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for ezpyc-0.1.2-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