commandpack v1.0.0

A cross-platform library for creation, storage, management of commands and command packages

Execution of commands, parsing of files with command packages. 100% test coverage.

Python Command Manager Cross-Platform CLI PyPI 100% Coverage

⚠️ WARNING: I recommend using my new library commandex.

commandpack — 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.

Supported platforms: Linux (all), Windows 7/8/10, Termux (Android).

  • Command executors — os, subprocess, unified executor
  • Pack makers — create and manage command packages
  • Parsers*.cfg and *.json file parsing
  • Commands — individual command handling
  • Packs — named command package management
  • Factories — unified object creation interface
  • Cross-Platform — Linux, Windows, Termux
  • 100% Test Coverage — fully tested

commands.cfg

[package name 1]
command 1
command 2
command N

[package name 2]
command 1
command 2
command N

commands.json

{
  "name1":
  [
    "command1",
    "command2",
    "commandN"
  ],
  "name2":
  [
    "command1",
    "command2",
    "commandN"
  ]
}

pip3 install commandpack

Requirements: Python 3.6+

Available tools: Command executors, Pack makers, Parsers, Commands, Packs, Factories.

from commandpack.factories import Factory

os_executor = Factory.tools.get_os_executor()
sub_executor = Factory.tools.get_sub_executor()
executor = Factory.tools.get_executor()

command = Factory.tools.command_pack.create_command('pip list')
pack = Factory.tools.command_pack.create_pack('default')

cfg_parser = Factory.tools.parsers.get_cfg_parser()
json_parser = Factory.tools.parsers.get_json_parser()
parser = Factory.tools.parsers.get_parser()

pack_maker = Factory.tools.makers.get_pack_maker()

100% test coverage — All components thoroughly tested.

Run tests:

pip install pytest
pytest -v

Coverage report:

pip install pytest-coverage
pytest --cov
pytest --cov --cov-report=html

By using this software, you agree to the full disclaimer terms.

Software provided "AS IS" without warranty. You assume all risks.

Full legal disclaimer: See DISCLAIMER.md

License: BSD 3-Clause License