Skip to main content

KQML messaging classes in Python.

Project description

PyKQML

PyKQML is an implementation of KQML messaging in Python.

Installation

PyKQML can be installed as

pip install pykqml

Note that releases of PyKQML up to 0.5 work in Python 2 only, whereas releases after 0.5 work in Python 3 only.

To install for Python 2, use:

pip install pykqml==0.5

To install for Python 3 (or force an upgrade to a compatible version), use

pip install "pykqml>0.5"

Usage

PyKQML implements the following KQML classes, which allow constructing and manipulating KQML messages programmatically:

KQMLToken
KQMLString
KQMLQuotation
KQMLList
KQMLPerformative
KQMLReader
KQMLDispatcher
KQMLModule

You can import KQML classes as, for instance,

from kqml import KQMLList

You can create a new KQML messaging agent as

from kqml import KQMLModule

class MyAgent(KQMLModule):
    def __init__(self, argv):
        # Initialize the agent
        super(MyAgent, self).__init__(argv)
        self.ready()
        super(MyAgent, self).start()

    def receive_request(self, msg, content):
        # Handle request and construct a reply_msg
        # ...
        self.reply(msg, reply_msg)

Testing

You can run all tests by running nosetests in the top level folder.

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

pykqml-1.0.tar.gz (10.1 kB view details)

Uploaded Source

File details

Details for the file pykqml-1.0.tar.gz.

File metadata

  • Download URL: pykqml-1.0.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pykqml-1.0.tar.gz
Algorithm Hash digest
SHA256 e25625163446b866e5ffa4e16aa6368b964b8aa501f8b2548e14649206e00069
MD5 d0fa5a169b1569df788a181e7ce90ddb
BLAKE2b-256 4ff8b4f1d83dc270de58272c554dda92e515c152195e27ce924689278ec82f15

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