pykqml

KQML messaging library

https://github.com/bgyori/pykqml

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 4 committers (25.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.5%) to scientific vocabulary
Last synced: 7 months ago · JSON representation ·

Repository

KQML messaging library

Basic Info
  • Host: GitHub
  • Owner: bgyori
  • License: bsd-2-clause
  • Language: Python
  • Default Branch: master
  • Size: 94.7 KB
Statistics
  • Stars: 4
  • Watchers: 3
  • Forks: 7
  • Open Issues: 1
  • Releases: 6
Created over 9 years ago · Last pushed over 4 years ago
Metadata Files
Readme License Citation

README.rst

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 above and including 1.0 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,

.. code:: python

    from kqml import KQMLList

You can create a new KQML messaging agent in the context of the TRIPS
system as

.. code:: python

    from kqml import KQMLModule

    class MyAgent(KQMLModule):
        name = "MyAgent" # This is the name of the agent to register with

        def __init__(self, **kwargs):
            # Call the parent class' constructor which sends a registration
            # message, setting the agent's name to be recognized by the
            # Facilitator.
            super(MyAgent, self).__init__(name=self.name, **kwargs)

            # Subscribe to REQUESTs of interest. The list will change
            # depending on the role of the agent
            for req in ('what-next', 'commit', 'evaluate'):
                self.subscribe_request(req)

            # Subscribe to TELLs of interest if needed. This list will change
            # depending on the role of the agent
            for tell in ('log-speechact', ):
                self.subscribe_tell(tell)

            # Now signal that the agent is ready to receive messages
            self.ready()

            # Finally, start the listener for incoming messages
            self.start()


        def receive_request(self, msg, content):
            # First, figure out what kind of request this is
            task = content.head().upper()
            # Here you typically decide what to do based on the
            # type of request.

            # Construct reply message's content
            reply_content = KQMLList()
            # Set whatever needs to be set in the reply content

            # Finally, wrap the content in a message and reply
            reply_msg = KQMLPerformative('reply')
            reply_msg.set('content', reply_content)
            self.reply(msg, reply_msg)

Testing
=======

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

Owner

  • Name: Benjamin M. Gyori
  • Login: bgyori
  • Kind: user
  • Location: Boston, MA, USA
  • Company: Harvard Medical School

Sysbio & AI researcher. Leading indralab.github.io. Working on knowledge assembly, human-machine collaboration, text mining, probabilistic modeling.

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Gyori"
  given-names: "Benjamin M."
  orcid: "https://orcid.org/0000-0001-9439-5346"
title: "PyKQML"
version: 1.3
doi: 10.5281/zenodo.5272252
date-released: 2021-08-26
url: "https://github.com/bgyori/pykqml"

GitHub Events

Total
  • Watch event: 1
Last Year
  • Watch event: 1

Committers

Last synced: about 3 years ago

All Time
  • Total Commits: 110
  • Total Committers: 4
  • Avg Commits per committer: 27.5
  • Development Distribution Score (DDS): 0.291
Top Committers
Name Email Commits
Ben Gyori b****i@g****m 78
pagreene p****e@g****m 30
Willie Wilson j****w@n****u 1
Sam Hill w****l@p****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 7
  • Total pull requests: 11
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 19 days
  • Total issue authors: 4
  • Total pull request authors: 5
  • Average comments per issue: 1.14
  • Average comments per pull request: 0.91
  • Merged pull requests: 10
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • bgyori (4)
  • jivens (1)
  • profwillie (1)
  • SamuelHill (1)
Pull Request Authors
  • pagreene (4)
  • bgyori (4)
  • profwillie (1)
  • jivens (1)
  • SamuelHill (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 112 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 3
  • Total versions: 7
  • Total maintainers: 1
pypi.org: pykqml

KQML messaging classes in Python.

  • Versions: 7
  • Dependent Packages: 0
  • Dependent Repositories: 3
  • Downloads: 112 Last month
Rankings
Dependent repos count: 8.9%
Dependent packages count: 10.1%
Forks count: 12.5%
Average: 16.1%
Downloads: 21.0%
Stargazers count: 27.8%
Maintainers (1)
Last synced: 7 months ago