Skip to main content

A cross-platform library for creation, storage, management of commands and command packages. Execution of commands, parsing of files with command packages.

Project description

commandpack


I recommend using my new library commandex.


GitHub top language PyPI - Downloads GitHub release (latest by date) GitHub PyPI PyPI - Format GitHub Repo stars GitHub watchers GitHub forks


Short Description:

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


Supported:

  • Linux: All.
  • Windows: 7/8/10.
  • Termux (Android).

Requirements:


What's new?

commandpack v0.3.1


Description:

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, or *.json and have the correct structure:

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"
  ]
}

Help:

Install and Use:

  • pip3 install commandpack

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()

Termux support:

Utilities created with use work "commandpack", without problems in Termux.

Windows support:

  • Install python.
  • pip install commandpack.

Utilities created with use work "commandpack", without problems in Windows:

Test coverage:

Run tests:

  • pip install pytest
  • pytest -v

Test coverage 100%

  • pip install pytest-coverage
  • pytest --cov

commandpack image

Report html:

  • pytest --cov --cov-report=html

Disclaimer of liability:

THIS 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.

Copyright:

--------------------------------------------------------
Licensed under the terms of the BSD 3-Clause License
(see LICENSE for details).
Copyright © 2018-2024, A.A Suvorov
All rights reserved.
--------------------------------------------------------

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

commandpack-0.3.1.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

commandpack-0.3.1-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file commandpack-0.3.1.tar.gz.

File metadata

  • Download URL: commandpack-0.3.1.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for commandpack-0.3.1.tar.gz
Algorithm Hash digest
SHA256 cd4e736625ccea67a79df205e0a699931de280d5b7019e5d82be49df230cc32e
MD5 93fb9244bb289823423aa02c2a17a7e5
BLAKE2b-256 f2dadb09865cb6e1f33d59ea257b49fa9ae11abe153cae27c63e7f7b6672707e

See more details on using hashes here.

File details

Details for the file commandpack-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: commandpack-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for commandpack-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ef81d0f8db69f55560d88d028c63a6ab39ca0f7e4dde157c127b0d8c9716f888
MD5 f69af5d99a88ebb60228c1bf9ee798c8
BLAKE2b-256 0a0fe56d675cfbb9a31dc22196eba42a33fea60e2fca79fc18a0159438ef1c6a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page