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.4.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: bashmetahandler-1.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 514a11907d9a999838cbd18f959420577d4c8ea21da31e525595e1e22cf92313
MD5 253ecadc8786bd14fcc22fd9a4d72d01
BLAKE2b-256 9640546a34488823d2715fa45c527a5402b53b9d971636a7412abbb7a79d51f2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bashmetahandler-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a73ba4105dd96f1e55a9df9e5cd29e0169ae712946df7f70d64f264563d6dd3d
MD5 0f53fe2c4b0a09769070cf1b9e1d7047
BLAKE2b-256 b54164a3c92c3f0b9d5af1144ca693ff8e63863694e424b5fb980c53aecfbee7

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