cmdfile
cmdfile runs annoying commands automatically.
Docs
Installation
Run python -m pip install cmdfile in your terminal.
Usage
You can use cmdfile as a command, or as a module.
Example for using as a command:
> python -m cmdfile build
Hello
You can specify cmdfile filename with the following: python -m cmdfile tablename filename
(By default, if you simply run python -m cmdfile, it will run the main table of the cmdfile file)
This will run the hello table of the cmdfile, note that the cmdfile must be in the directory you're running the script from, example cmdfile:
(hello)
echo Hello
python -m cmdfile check temp is the equivalent of this:
import cmdfile
cmdfile.run("check", filename="temp")
Variables
You can declare variables in the cmdfile using:
# You can declare variables outside of tables
# some_variable = "I'm not in any table!"
(table)
variable = "some text"
echo {{variable}}
some text
You can also declare variables through code like this:
import cmdfile
cmdfile.add_var("variable", "some text")
cmdfile.run("table")
And then this will also output some text:
(table)
echo {{variable}}
Changing the shell
You can change what shell to use by changing the shell variable:
shell = "powershell.exe -c"
[main]
echo 'Hello' # Executes "powershell.exe -c echo 'Hello'"
Requirements
Requirements are tables that run before the main table, example:
[main] a_requirement another_requirement
# This will call a_requirement, another_requirement and main, respectively
[a_requirement]
# ...
[another_requirement]
# ...
1.2.2 Bugfix
- Fixed cmdfile giving error when directly calling without args
Changelog for 1.2.0
- Added "requirements", this calls other tables before running the current table, example:
[main] a_requirement another_requirement
# This will call a_requirement, another_requirement and main, respectively
[a_requirement]
# ...
[another_requirement]
# ...
- You can now select the shell to use to run commands like this:
shell = "powershell.exe -c"
[main]
echo 'Hello' # Executes "powershell.exe -c echo 'Hello'"
- Changed variable usage from
{_varname_}to{{varname}}
Metadata
Release files for cmdfile 1.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cmdfile-1.2.2.tar.gz | 3.9 kB | Without provenance | Details for cmdfile-1.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cmdfile-1.2.2-py3-none-any.whl | Python 3 | none | any | Details for cmdfile-1.2.2-py3-none-any.whl |
Total release size: 8.1 kB
Release files / cmdfile-1.2.2.tar.gz
| Download URL | cmdfile-1.2.2.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a2bdefdde9028bb54e6e1ccc25fb37d7df41b11e0bacc657474ddf443718136a
|
|
BLAKE2b-256 checksum How to use checksums |
cab3342547fa49fef2c2f258cdaeb8d787b0de452deb9bfae45dae64e68feec7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.1
|
Release files / cmdfile-1.2.2-py3-none-any.whl
| Download URL | cmdfile-1.2.2-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
491416287f61c24c075bb9b75425f40f5f9d80caceead00b910936b9e1955b87
|
|
BLAKE2b-256 checksum How to use checksums |
30857df19eee450243ab09d4fec85c10ead13977b8696e75e5faa05b496ef50c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.1
|
Security for cmdfile 1.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.