semvec/pypi-packages huggingface dataset:
wexpect 4.0.1.dev9
Windows alternative of pexpect
License: MIT
Requires Python: >=3.4
Keywords: scripting, automation, expect, pexpect, wexpect

# **wexpect**

[![Build status](https://ci.appveyor.com/api/projects/status/tbji72d5s0tagrt9?svg=true)](https://ci.appveyor.com/project/raczben/wexpect)
[![codecov](https://codecov.io/gh/raczben/wexpect/branch/master/graph/badge.svg)](https://codecov.io/gh/raczben/wexpect)
[![Documentation Status](https://readthedocs.org/projects/wexpect/badge/?version=latest)](https://wexpect.readthedocs.io/en/latest/?badge=latest)

*Wexpect* is a Windows variant of [pexpect](https://pexpect.readthedocs.io/en/stable/).

*Pexpect* is a Python module for spawning child applications and controlling
them automatically.

## You need wexpect if...

 - you want to control any windows console application from python script.
 - you want to write test-automation script for a windows console application.
 - you want to automate your job by controlling multiple application parallel, synchronously.

## **Install**

    pip install wexpect

## **Usage**

To interract with a child process use `spawn` method:

```python
import wexpect

prompt = '[A-Z]\:.+>'

child = wexpect.spawn('cmd.exe')
child.expect(prompt)    # Wait for startup prompt

child.sendline('dir')   # List the current directory
child.expect(prompt)

print(child.before)     # Print the list
child.sendline('exit')
```

For more information see [examples](./examples) folder.

---
## REFACTOR

**Refactor has been finished!!!** The default spawn class is `SpawnPipe` from now. For more
information read [history](https://wexpect.readthedocs.io/en/latest/history.html#refactor).

---
## What is wexpect?

Wexpect is a Python module for spawning child applications and controlling
them automatically. Wexpect can be used for automating interactive applications
such as ssh, ftp, passwd, telnet, etc. It can be used to a automate setup
scripts for duplicating software package installations on different servers. It
can be used for automated software testing. Wexpect is in the spirit of Don
Libes' Expect, but Wexpect is pure Python. Other Expect-like modules for Python
require TCL and Expect or require C extensions to be compiled. Wexpect does not
use C, Expect, or TCL extensions.

Original Pexpect should work on any platform that supports the standard Python pty module. While
Wexpect works on Windows platforms. The Wexpect interface focuses on ease of use so that simple
tasks are easy.

---
## Dev

Thanks for any contributing!

### Test

To run test, enter into the folder of the wexpect's repo then:

`python -m unittest`

### Deploy

The deployment itself is automated and done by [appveyor](https://ci.appveyor.com/project/raczben/wexpect).
See `after_test` section in [appveyor.yml](appveyor.yml) for more details.

The wexpect uses [pbr](https://docs.openstack.org/pbr/latest/) for managing releasing procedures.
The versioning is handled by the pbr. The *"master-version"* is the git tag. Pbr derives the package
version from the git tags.
PyQueueManager 1.12.1
Library to deal with RabbitMQ and Google PubSub
License: MIT

py-queue-manager
================

Library to deal with RabbitMQ and Google PubSub

Usage
-----

QueueManager class
..................

.. code:: python

    >>> from queue_manager.queue_manager import QueueManager
    >>> conn_params = {
    ...     'host': '',
    ...     'port': '',
    ...     'username': '',
    ...     'password': ''
    ... }
    >>> # or use multiple urls
    >>> conn_params = ('amqp://host1', 'amqp://host2',)
    qm = QueueManager(conn_params)
    >>> qm.push('hello', 'Hello from QueueManager')
    True
    >>> qm.pop('hello')
    Hello from QueueManager
    >>> del(qm)

RabbitMqPublisher class
.......................

.. code:: python

    from queue_manager.rabbitmq_consumer import RabbitMqPublisher

    producer = RabbitMqPublisher('amqp://username:password@hostname:port',
                                 'exchange', 'exchange_type', 'queue_name', 'routing_key')

    producer.publish_message('hello')
    # or passing message property
    producer.publish_message('hello', dict(priority=8))


RabbitMqConsumer class
......................

This class is an async consumer class, that still connected.

Inspired on: asynchronous_consumer_example_

.. code:: python

    single_url = 'amqp://username:password@hostname:port'
    # or multiple urls
    multiple_urls = ('amqp://username:password@hostnameone:port', 'amqp://username:password@hostnametwo:port')
    consumer = RabbitMqConsumer(single_url, queue='queue_name')

    try:
        def callback(body):
            print("message body", body)

        consumer.run(callback)
    except KeyboardInterrupt:
        consumer.stop()

TornadoConsumer class
.......................

.. code:: python

    from tornado.ioloop import IOLoop
    from queue_manager.tornado_consumer import TornadoConsumer

    consumer = TornadoConsumer('amqp://username:password@hostname:port',
                               'exchange', 'exchange_type', 'queue_name', 'routing_key')


    def callback(body):
        print("message body", body)

    consumer.run(callback)
    IOLoop.instance().start()

PubsubConsumer class
.......................

.. code:: python

    consumer = PubsubConsumer('project_id', 'path/to/sa.json', 'subscription_name', 'topic_name')

    def callback(message):
        print("message", message)

    try:
        consumer.start_listening(callback)
    except KeyboardInterrupt:
        consumer.stop()

Running tests with ``tox``
--------------------------

Install ``tox``

::

    $ pip install tox

Run tests

::

    tox

.. _asynchronous_consumer_example: http://pika.readthedocs.io/en/0.13.1/examples/asynchronous_consumer_example.html
py-queue-manager 1.12.1
Library to deal with RabbitMQ and Google PubSub
License: MIT

py-queue-manager
================

Library to deal with RabbitMQ and Google PubSub

Usage
-----

QueueManager class
..................

.. code:: python

    >>> from queue_manager.queue_manager import QueueManager
    >>> conn_params = {
    ...     'host': '',
    ...     'port': '',
    ...     'username': '',
    ...     'password': ''
    ... }
    >>> # or use multiple urls
    >>> conn_params = ('amqp://host1', 'amqp://host2',)
    qm = QueueManager(conn_params)
    >>> qm.push('hello', 'Hello from QueueManager')
    True
    >>> qm.pop('hello')
    Hello from QueueManager
    >>> del(qm)

RabbitMqPublisher class
.......................

.. code:: python

    from queue_manager.rabbitmq_consumer import RabbitMqPublisher

    producer = RabbitMqPublisher('amqp://username:password@hostname:port',
                                 'exchange', 'exchange_type', 'queue_name', 'routing_key')

    producer.publish_message('hello')
    # or passing message property
    producer.publish_message('hello', dict(priority=8))


RabbitMqConsumer class
......................

This class is an async consumer class, that still connected.

Inspired on: asynchronous_consumer_example_

.. code:: python

    single_url = 'amqp://username:password@hostname:port'
    # or multiple urls
    multiple_urls = ('amqp://username:password@hostnameone:port', 'amqp://username:password@hostnametwo:port')
    consumer = RabbitMqConsumer(single_url, queue='queue_name')

    try:
        def callback(body):
            print("message body", body)

        consumer.run(callback)
    except KeyboardInterrupt:
        consumer.stop()

TornadoConsumer class
.......................

.. code:: python

    from tornado.ioloop import IOLoop
    from queue_manager.tornado_consumer import TornadoConsumer

    consumer = TornadoConsumer('amqp://username:password@hostname:port',
                               'exchange', 'exchange_type', 'queue_name', 'routing_key')


    def callback(body):
        print("message body", body)

    consumer.run(callback)
    IOLoop.instance().start()

PubsubConsumer class
.......................

.. code:: python

    consumer = PubsubConsumer('project_id', 'path/to/sa.json', 'subscription_name', 'topic_name')

    def callback(message):
        print("message", message)

    try:
        consumer.start_listening(callback)
    except KeyboardInterrupt:
        consumer.stop()

Running tests with ``tox``
--------------------------

Install ``tox``

::

    $ pip install tox

Run tests

::

    tox

.. _asynchronous_consumer_example: http://pika.readthedocs.io/en/0.13.1/examples/asynchronous_consumer_example.html
py_queue_manager 1.12.1
Library to deal with RabbitMQ and Google PubSub
License: MIT

py-queue-manager
================

Library to deal with RabbitMQ

Usage
-----

QueueManager class
..................

.. code:: python

    >>> from queue_manager.queue_manager import QueueManager
    >>> conn_params = {
    ...     'host': '',
    ...     'port': '',
    ...     'username': '',
    ...     'password': ''
    ... }
    >>> # or use multiple urls
    >>> conn_params = ('amqp://host1', 'amqp://host2',)
    qm = QueueManager(conn_params)
    >>> qm.push('hello', 'Hello from QueueManager')
    True
    >>> qm.pop('hello')
    Hello from QueueManager
    >>> del(qm)

RabbitMqPublisher class
.......................

.. code:: python

    from queue_manager.rabbitmq_consumer import RabbitMqPublisher

    producer = RabbitMqPublisher('amqp://username:password@hostname:port',
                                 'exchange', 'exchange_type', 'queue_name', 'routing_key')

    producer.publish_message('hello')
    # or passing message property
    producer.publish_message('hello', dict(priority=8))


RabbitMqConsumer class
......................

This class is an async consumer class, that still connected.

Inspired on: asynchronous_consumer_example_

.. code:: python

    single_url = 'amqp://username:password@hostname:port'
    # or multiple urls
    multiple_urls = ('amqp://username:password@hostnameone:port', 'amqp://username:password@hostnametwo:port')
    consumer = RabbitMqConsumer(single_url, queue='queue_name')

    try:
        def callback(body):
            print("message body", body)

        consumer.run(callback)
    except KeyboardInterrupt:
        consumer.stop()

TornadoConsumer class
.......................

.. code:: python

    from tornado.ioloop import IOLoop
    from queue_manager.tornado_consumer import TornadoConsumer

    consumer = TornadoConsumer('amqp://username:password@hostname:port',
                               'exchange', 'exchange_type', 'queue_name', 'routing_key')


    def callback(body):
        print("message body", body)

    consumer.run(callback)
    IOLoop.instance().start()

PubsubConsumer class
.......................

.. code:: python

    consumer = PubsubConsumer('project_id', 'path/to/sa.json', 'subscription_name', 'topic_name')

    def callback(message):
        print("message", message)

    try:
        consumer.start_listening(callback)
    except KeyboardInterrupt:
        consumer.stop()

Running tests with ``tox``
--------------------------

Install ``tox``

::

    $ pip install tox

Run tests

::

    tox

.. _asynchronous_consumer_example: http://pika.readthedocs.io/en/0.13.1/examples/asynchronous_consumer_example.html