Skip to content

lorkaan/pexpectparser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pexpect Parser

A parser using the parsegrammar library to create automated bots for command line programs.

Examples

An example of this code can be found in the following projects:

Installation

Pip installation is reccommended

pip install -u pexpectparser

Or if you are using PipEnv

pipenv shell
pipenv install pexpectparser

Usage

Import

import pexpectParser as pp

Creating Class

parser = pp.Parser(<Grammar>)

where <Grammar> is a Grammar Object from the Parse Grammar Library.

  • for more information about <Grammar> objects, see parsegrammar

API Usage

process = parser.run()

where type(process) is <class 'pexpect.pty_spawn.spawn'>,

  • meaning that process is an object returned from pexpect.spawn(<cmd>)

Errors that can be thrown:

  • Timeout Error
    • Class pexpect.exceptions.TIMEOUT
  • EOF Error
    • Class pexpect.exceptions.EOF

Dependencies

This project has the following dependencies:

About

A Parser to create command line bots using pexpect

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages