Skip to main content

bmh

Project description

BashMetaHandler

PyPI Status Python Version License

Read the documentation at https://BashMetaHandler.readthedocs.io/ Tests Codecov

pre-commit Black

Features

It provites an interpreter for a own bash meta languange. Currently only tested for linux systems.

Requirements

click>=8.1.7 ; python_version >= "3.7" and python_version < "4.0" colorama>=0.4.6 ; python_version >= "3.7" and python_version < "4.0" and platform_system == "Windows" datetime>=5.5 ; python_version >= "3.7" and python_version < "4.0" importlib-metadata>=4.2.0 ; python_version >= "3.7" and python_version < "3.8" pexpect>=4.9.0 ; python_version >= "3.7" and python_version < "4.0" ptyprocess>=0.7.0 ; python_version >= "3.7" and python_version < "4.0" pytz>=2024.1 ; python_version >= "3.7" and python_version < "4.0" setuptools>=68.0.0 ; python_version >= "3.7" and python_version < "4.0" typing-extensions>=4.7.1 ; python_version >= "3.7" and python_version < "3.8" zipp>=3.15.0 ; python_version >= "3.7" and python_version < "3.8" zope-interface>=6.4.post2 ; python_version >= "3.7" and python_version < "4.0"

Installation

You can install bmh via pip from PyPI:

$ pip install BashMetaHandler

Usage

The main purpose of this library is to provide an interpreter for the self-created metabashlanguage. The MetaBashHandler-class handles this interpretation. When on object of this class is created it initiates a bash terminal where the interpreted language is executed.

Firstly, it a provided file is read and lines for the goto-command are searched and indexed. They must be a word followed by an ":".Secondly, the execute_file function will run the interpreter.

The metabashlanguange has normally the ending ".msh". When not a special case the input goes directly to the bash terminal. It has the advantage to not care whether you are directly in the bash terminal are input of a program run by the terminal. Keywords implemented are: while, if, elif, else. When used you have to use a tab to indicate how long these keywords effect should be (similar to python).

Additionally you are provided with functions to be used. They are used as follows functionname(arg1,arg2,...). There are a few prebuild functions to use given as default parameters to the MetaBashHandler. These are: check, do_not, equal, expect, expect_check, get_input, println and wait. The actual functionname are sometimes different to the actual python functionnames. You can also create your own function, the first argument should always be the MetaBashHandler object.

Finally there you can use variables indicated by $(variable name). They will be replaced with the content of the variable given to the MetaBashHandler object.

Please see the Command-line Reference for details.

Contributing

Contributions are very welcome. To learn more, see the Contributor Guide.

License

Distributed under the terms of the MIT license, bmh is free and open source software.

Issues

If you encounter any problems, please file an issue along with a detailed description.

Credits

This project was generated from @cjolowicz's Hypermodern Python Cookiecutter template.

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

bashmetahandler-1.0.3.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

bashmetahandler-1.0.3-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file bashmetahandler-1.0.3.tar.gz.

File metadata

  • Download URL: bashmetahandler-1.0.3.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for bashmetahandler-1.0.3.tar.gz
Algorithm Hash digest
SHA256 1f5756693531202997626eb3f3d3e8952cc87ca66b7af01731a6afd80079b7e1
MD5 34731cd455e7751749ca6890e1316ce3
BLAKE2b-256 f6f40adda7844de48b05f70ea94fdb45aad9068a20c80b28985d7ec373ad331f

See more details on using hashes here.

File details

Details for the file bashmetahandler-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for bashmetahandler-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 841897b8d52c122031dc753102bbdcdc2cde65b5b38220c0d465dc8b5c31512f
MD5 1abf230e40a276a346a6b17be579ed45
BLAKE2b-256 a92519ccde5ebdcdf85689269de3f7fee46713ec016112ef19fcada072225774

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