ScriptGenPy is a script generator tool that simplifies the process of running scripts in any language.
Project description
scriptgen_py
ScriptGenPy is a command-line based script generator tool that simplifies the process of running scripts in any language.
Introduction
When a script is executed using an interpreter, the command line statement can become quite long as it includes the interpreter path, script path, and all required arguments. ScriptGenPy addresses this issue by consolidating the interpreter and script paths into a short command that can be easily accessed from anywhere in the system. This means that when calling the script via command, only the arguments need to be passed.
ScriptGenPy generates commands for all operating systems. For Windows, it generates batch and PowerShell scripts. For macOS, it generates Shell scripts and PowerShell scripts which can be used if PowerShell is installed. For Linux, it generates Shell scripts. This makes it easy to run scripts on any platform without having to manually create the appropriate command.
Working
Here's a Python script that takes two positional arguments: interpreter and script_path. It also has a -v/--version option to show the version information. You can run it with python scriptgen.py <interpreter> <script_path>.
Build
To setup ScriptGenPy, you need to clone the repository from GitHub.
git clone https://github.com/isurfer21/scriptgen_py.git
After running these commands, you should have a local copy of ScriptGenPy that is ready to use.
To use ScriptGenPy, navigate to the project directory and run the appropriate command.
cd scriptgen_py
python src/scriptgen.py -h
If it displays the help menu, the script is working!
Usage
ScriptGenPy is a command-line tool for creating script files. To use ScriptGenPy, you need to specify the interpreter to use and the path to the script.
scriptgenpy [interpreter] [script_path]
For example, to create a Python script at /path/to/script.py, you would run the following command:
scriptgenpy python /path/to/script.py
ScriptGen also supports several options:
-h,--help: Show the help message and exit.-v,--version: Show the program's version number and exit.
For example, to show the version number of ScriptGen, you would run the following command:
scriptgenpy -v
This would output the version number of ScriptGen, which is currently 1.0.0.
Examples
Here are some additional examples of how to use ScriptGenPy:
- To create a Bash script at
/path/to/script.sh, you would run the following command:
scriptgenpy bash /path/to/script.sh
- To create a Ruby script at
/path/to/script.rb, you would run the following command:
scriptgenpy ruby /path/to/script.rb
- To create a Perl script at
/path/to/script.pl, you would run the following command:
scriptgenpy perl /path/to/script.pl
Publish
Here is the process to make the app ready for distribution.
Generating distribution archives
To generate distribution packages for the package. Make sure you have the latest version of PyPA’s build installed:
python3 -m pip install --upgrade build
Now run this command from the same directory where pyproject.toml is located:
python3 -m build
Uploading the distribution archives to Test PyPi
Finally, it’s time to upload your package to the Python Package Index!
Ensure to have an independent account on both platforms:
After that, you can use twine to upload the distribution packages. You’ll need to install Twine:
python3 -m pip install --upgrade twine
Once installed, run Twine to upload all of the archives under dist:
python3 -m twine upload --repository testpypi dist/*
You will be prompted for a username and password. For the username, use __token__. For the password, use the token value, including the pypi- prefix.
Installing the uploaded package from Test PyPi
You can use pip to install your package.
pip install -i https://test.pypi.org/simple/ scriptgenpy
Uploading the package to PyPI
Similar to Test PyPI, uploading to PyPI. Put this command into action:
python -m twine upload dist/*
Upon successful upload, your package will be visible on the PyPI website. You may discover the uploaded package by searching the 'scriptgenpy' at PyPI.
Installing the package from PyPi
Now that the app is public, anyone may download it and install it by using the following command.
pip install scriptgenpy
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scriptgenpy-1.0.0.tar.gz.
File metadata
- Download URL: scriptgenpy-1.0.0.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0309ddfd121fcc0f19cd49361f372cbe642bbae55c829b13c6da2dd4d2557b0c
|
|
| MD5 |
84d28b2ee6770beb5e3d6d0be3e87764
|
|
| BLAKE2b-256 |
24617edd7b3aa2d03dd7e9155545a328d067a53e4900bd9dd0652f4af8edee45
|
File details
Details for the file scriptgenpy-1.0.0-py3-none-any.whl.
File metadata
- Download URL: scriptgenpy-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8eded9cc5d2fa28099ad46d9b0cce199f312cc10b5b32bed5547e9e59d9fd419
|
|
| MD5 |
a4aa39ae22bddfa3497903ec7fa529d9
|
|
| BLAKE2b-256 |
78cc7295d89701f139f077eb570b77a8931998c1612aa632da02b354f97a0b6f
|