commandex
PyPI Package v0.3.1
pip install commandex
PyPI Package v0.3.1
pip install commandex
A cross-platform library for creation, storage, management of commands and command packages. Execution of commands, parsing of files with command packages.
commandex - A cross-platform library for creation, storage, management of commands and command packages. Execution of commands, parsing of files with command packages.
Author and developer: A.A. Suvorov
commandex v0.3.1
A cross-platform library for creation, storage, management of commands and command packages.
Execution of commands, parsing of files with command packages.
Used to create utilities for working with commands (execution, launch, autorun, storage).
You can keep your commands in simple and understandable files, collect them in one place,
split into named categories (packages) and execute at any time:
The files must have the extension *.cfg, and have the correct structure:
# Comments
[package name 1]
command 1
command 2
command N
[package name 2]
command 1
command 2
command N
pip install commandexAvailable tools:
Principle of operation:
from commandex import Commander
commander = Commander()
# Reading command packages from a file.
pack_dict = commander.parsers.cfg_parser.parse('file.cfg')
# Filter packages if needed.
packs = commander.filters.pack_filter.filter_pack_dict(pack_dict, add_list=[], exc_list=[])
# We create a list of package objects for future use.
pack_list = commander.makers.pack_maker.make_pack_list(packs)
# We execute commands from each package.
for pack in pack_list:
print(pack.name)
for command in pack.commands:
print(command)
commander.executors.os.execute(command)
Utilities created with use work "commandex", without problems in Termux, Windows.
For example: commandman.
pip install pytestpytest -vpip install pytest-coveragepytest --cov
pytest --cov --cov-report=htmlTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------
Licensed under the terms of the BSD 3-Clause License
(see LICENSE for details).
Copyright © 2018-2025, A.A. Suvorov
All rights reserved.
--------------------------------------------------------
https://github.com/smartlegionlab
--------------------------------------------------------