kiwiPy

kiwiPy: Robust, high-volume, messaging for big-data and computational science workflows - Published in JOSS (2020)

https://github.com/aiidateam/kiwipy

Science Score: 59.0%

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

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 5 DOI reference(s) in README
  • Academic publication links
    Links to: joss.theoj.org
  • Committers with academic emails
    1 of 8 committers (12.5%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.0%) to scientific vocabulary

Keywords

python rabbitmq
Last synced: 6 months ago · JSON representation

Repository

A python messaging library for RPC, task queues and broadcasts

Basic Info
Statistics
  • Stars: 17
  • Watchers: 2
  • Forks: 4
  • Open Issues: 4
  • Releases: 7
Topics
python rabbitmq
Created about 8 years ago · Last pushed 10 months ago
Metadata Files
Readme Changelog License

README.rst

.. _AiiDA: https://www.aiida.net
.. _rmq tutorial: https://www.rabbitmq.com/getstarted.html
.. _documentation: https://kiwipy.readthedocs.io/en/latest/index.html


kiwiPy
======

.. image:: docs/source/_static/logo.svg
   :height: 64px
   :width: 64px
   :alt: kiwiPy

.. image:: https://codecov.io/gh/aiidateam/kiwipy/branch/master/graph/badge.svg
    :target: https://codecov.io/gh/aiidateam/kiwipy
    :alt: Coveralls

.. image:: https://github.com/aiidateam/kiwipy/workflows/continuous-integration/badge.svg
    :target: https://github.com/aiidateam/kiwipy/actions?query=workflow%3Acontinuous-integration
    :alt: Github Actions

.. image:: https://img.shields.io/pypi/v/kiwipy.svg
    :target: https://pypi.python.org/pypi/kiwipy/
    :alt: Latest Version

.. image:: https://img.shields.io/pypi/pyversions/kiwipy.svg
    :target: https://pypi.python.org/pypi/kiwipy/

.. image:: https://img.shields.io/pypi/l/kiwipy.svg
    :target: https://pypi.python.org/pypi/kiwipy/

.. image:: https://joss.theoj.org/papers/10.21105/joss.02351/status.svg
   :target: https://doi.org/10.21105/joss.02351



`kiwiPy`_ is a library that makes remote messaging using RabbitMQ (and possibly other message brokers) EASY.  It was
designed to support high-throughput workflows in big-data and computational science settings and is currently used
by `AiiDA`_ for computational materials research around the world.  That said, kiwiPy is entirely general and can
be used anywhere where high-throughput and robust messaging are needed.

Here's what you get:

* RPC
* Broadcast (with filters)
* Task queue messages

Let's dive in, with some examples taken from the `rmq tutorial`_.  To see more detail head over to the `documentation`_.

RPC
---

The client:

.. code-block:: python

    import kiwipy

    with kiwipy.connect('amqp://localhost') as comm:
        # Send an RPC message
        print(" [x] Requesting fib(30)")
        response = comm.rpc_send('fib', 30).result()
        print((" [.] Got %r" % response))

`(rmq_rpc_client.py source) `_


The server:

.. code-block:: python

    import threading
    import kiwipy

    def fib(comm, num):
        if num == 0:
            return 0
        if num == 1:
            return 1

        return fib(comm, num - 1) + fib(comm, num - 2)

    with kiwipy.connect('amqp://127.0.0.1') as comm:
        # Register an RPC subscriber with the name 'fib'
        comm.add_rpc_subscriber(fib, 'fib')
        # Now wait indefinitely for fibonacci calls
        threading.Event().wait()

`(rmq_rpc_server.py source) `_


Worker
------

Create a new task:

.. code-block:: python

    import sys
    import kiwipy

    message = ' '.join(sys.argv[1:]) or "Hello World!"

    with rmq.connect('amqp://localhost') as comm:
        comm.task_send(message)

`(rmq_new_task.py source) `_


And the worker:

.. code-block:: python

    import time
    import threading
    import kiwipy

    print(' [*] Waiting for messages. To exit press CTRL+C')


    def callback(_comm, task):
        print((" [x] Received %r" % task))
        time.sleep(task.count(b'.'))
        print(" [x] Done")


    try:
        with kiwipy.connect('amqp://localhost') as comm:
            comm.add_task_subscriber(callback)
            threading.Event().wait()
    except KeyboardInterrupt:
        pass

`(rmq_worker.py source) `_

Citing
======

If you use kiwiPy directly or indirectly (e.g. by using `AiiDA`_) then please cite:

Uhrin, M., & Huber, S. P. (2020). kiwiPy : Robust , high-volume , messaging for big-data and computational science workflows, 5, 4–6. http://doi.org/10.21105/joss.02351

This helps us to keep making community software.

Versioning
==========

This software follows `Semantic Versioning`_

Contributing
============

Want a new feature? Found a bug? Want to contribute more documentation or a translation perhaps?

Help is always welcome, get started with the `contributing guide `__.

.. _Semantic Versioning: http://semver.org/

Development
===========

This package utilises `tox `__ for unit test automation, and `pre-commit `__ for code style formatting and test automation.

To install these development dependencies:

.. code-block:: bash

    pip install tox pre-commit

To run the unit tests:

.. code-block:: bash

    tox

For the ``rmq`` tests you will require a running instance of RabbitMQ.
One way to achieve this is using Docker and launching ``test/rmq/docker-compose.yml``.

To run the pre-commit tests:

.. code-block:: bash

    pre-commit run --all

To build the documentation:

.. code-block:: bash

    tox -e docs-clean

Changes should be submitted as Pull Requests (PRs) to the ``develop`` branch.

Publishing Releases
===================

1. Create a release PR/commit to the ``develop`` branch, updating ``kiwipy/version.py`` and ``CHANGELOG.md``.
2. Fast-forward merge `develop` into the `master` branch
3. Create a release on GitHub (https://github.com/aiidateam/kiwipy/releases/new), pointing to the release commit on `master`, named ``v.X.Y.Z`` (identical to version in ``kiwipy/version.py``)
4. This will trigger the ``continuous-deployment`` GitHub workflow which, if all tests pass, will publish the package to PyPi. Check this has successfully completed in the GitHub Actions tab (https://github.com/aiidateam/kiwipy/actions).

(if the release fails, delete the release and tag)

Owner

  • Name: AiiDA team
  • Login: aiidateam
  • Kind: organization

The development team of AiiDA

GitHub Events

Total
  • Issues event: 2
  • Watch event: 1
  • Delete event: 3
  • Issue comment event: 12
  • Push event: 11
  • Pull request review comment event: 2
  • Pull request review event: 5
  • Pull request event: 8
  • Create event: 6
Last Year
  • Issues event: 2
  • Watch event: 1
  • Delete event: 3
  • Issue comment event: 12
  • Push event: 11
  • Pull request review comment event: 2
  • Pull request review event: 5
  • Pull request event: 8
  • Create event: 6

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 242
  • Total Committers: 8
  • Avg Commits per committer: 30.25
  • Development Distribution Score (DDS): 0.351
Past Year
  • Commits: 6
  • Committers: 3
  • Avg Commits per committer: 2.0
  • Development Distribution Score (DDS): 0.5
Top Committers
Name Email Commits
Martin Uhrin m****n@g****m 157
Sebastiaan Huber m****l@s****t 62
Chris Sewell c****l@h****m 9
Jason.Eu m****u@y****m 5
cclauss c****s@b****h 4
Leopold Talirz l****z@g****m 2
Daniel S. Katz d****z@i****g 2
Alexander Goscinski a****i@p****e 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 28
  • Total pull requests: 86
  • Average time to close issues: 3 months
  • Average time to close pull requests: 11 days
  • Total issue authors: 8
  • Total pull request authors: 8
  • Average comments per issue: 0.96
  • Average comments per pull request: 1.79
  • Merged pull requests: 75
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 7
  • Average time to close issues: 5 days
  • Average time to close pull requests: about 7 hours
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 1.0
  • Average comments per pull request: 1.14
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • sphuber (13)
  • ltalirz (5)
  • muhrin (3)
  • unkcpz (3)
  • uellue (1)
  • volbil (1)
  • kashcode (1)
  • dghoshal-lbl (1)
Pull Request Authors
  • sphuber (36)
  • muhrin (28)
  • chrisjsewell (8)
  • unkcpz (7)
  • agoscinski (5)
  • ltalirz (2)
  • danielskatz (2)
  • g0phergit (1)
Top Labels
Issue Labels
type/enhancement (7) type/bug (6) priority/important (6) priority/critical (4) priority/nice to have (3) topic/rabbitmq (2) topic/communicators (2) type/accepted feature (1) can't reproduce (1)
Pull Request Labels
pr/blocked (3)

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 29,121 last-month
  • Total docker downloads: 37,978
  • Total dependent packages: 3
    (may contain duplicates)
  • Total dependent repositories: 23
    (may contain duplicates)
  • Total versions: 76
  • Total maintainers: 4
pypi.org: kiwipy

Robust, high-volume, message based communication made easy.

  • Versions: 52
  • Dependent Packages: 1
  • Dependent Repositories: 13
  • Downloads: 29,121 Last month
  • Docker Downloads: 37,978
Rankings
Docker downloads count: 1.2%
Downloads: 2.2%
Dependent repos count: 4.0%
Dependent packages count: 4.8%
Average: 7.1%
Stargazers count: 15.3%
Forks count: 15.4%
Last synced: 6 months ago
conda-forge.org: kiwipy

kiwipy is a library that makes remote messaging using RabbitMQ (and any other protocol for which a backend is written) EASY. I don't know about you but I find RabbitMQ HARD. It's all too easy to make a configuration mistake which is then difficult to debug. With kiwipy, there's none of this, just messaging, made simple, with all the nice properties and guarantees of AMQP.

  • Versions: 24
  • Dependent Packages: 2
  • Dependent Repositories: 10
Rankings
Dependent repos count: 11.1%
Dependent packages count: 19.6%
Average: 34.5%
Stargazers count: 52.9%
Forks count: 54.2%
Last synced: 6 months ago

Dependencies

.github/workflows/cd.yml actions
  • actions/cache v1 composite
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • rabbitmq latest docker
.github/workflows/ci.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • codecov/codecov-action v2 composite
  • rabbitmq ${{ matrix.rabbitmq }} docker
test/rmq/docker-compose.yml docker
  • rabbitmq 3.8.3-management