gnsq


Namegnsq JSON
Version 1.0.2 PyPI version JSON
download
home_pagehttps://github.com/wtolson/gnsq
SummaryA gevent based python client for NSQ.
upload_time2020-01-08 16:53:01
maintainer
docs_urlNone
authorTrevor Olson
requires_python
licenseBSD
keywords gnsq
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            ===============================
gnsq
===============================

.. image:: https://img.shields.io/pypi/v/gnsq.svg
        :target: https://pypi.python.org/pypi/gnsq

.. image:: https://img.shields.io/travis/wtolson/gnsq.svg
        :target: https://travis-ci.org/wtolson/gnsq

.. image:: https://readthedocs.org/projects/gnsq/badge/?version=latest
        :target: https://gnsq.readthedocs.io/en/latest/?badge=latest
        :alt: Documentation Status


A `gevent`_ based python client for `NSQ`_ distributed messaging platform.

Features include:

* Free software: BSD license
* Documentation: https://gnsq.readthedocs.org
* Battle tested on billions and billions of messages `</sagan>`
* Based on `gevent`_ for fast concurrent networking
* Fast and flexible signals with `Blinker`_
* Automatic nsqlookupd discovery and back-off
* Support for TLS, DEFLATE, and Snappy
* Full HTTP clients for both nsqd and nsqlookupd

Installation
------------

At the command line::

    $ easy_install gnsq

Or even better, if you have virtualenvwrapper installed::

    $ mkvirtualenv gnsq
    $ pip install gnsq

Currently there is support for Python 2.7+, Python 3.4+ and PyPy.

Usage
-----

First make sure nsq is `installed and running`_. Next create a producer and
publish some messages to your topic::

    import gnsq

    producer = gnsq.Producer('localhost:4150')
    producer.start()

    producer.publish('topic', 'hello gevent!')
    producer.publish('topic', 'hello nsq!')

Then create a Consumer to consume messages from your topic::

    consumer = gnsq.Consumer('topic', 'channel', 'localhost:4150')

    @consumer.on_message.connect
    def handler(consumer, message):
        print 'got message:', message.body

    consumer.start()

Compatibility
-------------

For **NSQ 1.0** and later, use the major version 1 (``1.x.y``) of gnsq.

For **NSQ 0.3.8** and earlier, use the major version 0 (``0.x.y``) of the
library.

The recommended way to set your requirements in your `setup.py` or
`requirements.txt` is::

    # NSQ 1.x.y
    gnsq>=1.0.0

    # NSQ 0.x.y
    gnsq<1.0.0

Dependencies
------------

Optional snappy support depends on the `python-snappy` package which in turn
depends on libsnappy::

    # Debian
    $ sudo apt-get install libsnappy-dev

    # Or OS X
    $ brew install snappy

    # And then install python-snappy
    $ pip install python-snappy

Contributing
------------

Feedback, issues, and contributions are always gratefully welcomed. See the
`contributing guide`_ for details on how to help and setup a development
environment.


.. _gevent: http://gevent.org/
.. _NSQ: http://nsq.io/
.. _Blinker: http://pythonhosted.org/blinker/
.. _installed and running: http://nsq.io/overview/quick_start.html
.. _contributing guide: https://github.com/wtolson/gnsq/blob/master/CONTRIBUTING.rst



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/wtolson/gnsq",
    "name": "gnsq",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "gnsq",
    "author": "Trevor Olson",
    "author_email": "trevor@heytrevor.com",
    "download_url": "https://files.pythonhosted.org/packages/3d/c3/e5edbf7abbc1b2947176ae487c37fff8bd7d47e47556057dc1274f82e8c9/gnsq-1.0.2.tar.gz",
    "platform": "",
    "description": "===============================\ngnsq\n===============================\n\n.. image:: https://img.shields.io/pypi/v/gnsq.svg\n        :target: https://pypi.python.org/pypi/gnsq\n\n.. image:: https://img.shields.io/travis/wtolson/gnsq.svg\n        :target: https://travis-ci.org/wtolson/gnsq\n\n.. image:: https://readthedocs.org/projects/gnsq/badge/?version=latest\n        :target: https://gnsq.readthedocs.io/en/latest/?badge=latest\n        :alt: Documentation Status\n\n\nA `gevent`_ based python client for `NSQ`_ distributed messaging platform.\n\nFeatures include:\n\n* Free software: BSD license\n* Documentation: https://gnsq.readthedocs.org\n* Battle tested on billions and billions of messages `</sagan>`\n* Based on `gevent`_ for fast concurrent networking\n* Fast and flexible signals with `Blinker`_\n* Automatic nsqlookupd discovery and back-off\n* Support for TLS, DEFLATE, and Snappy\n* Full HTTP clients for both nsqd and nsqlookupd\n\nInstallation\n------------\n\nAt the command line::\n\n    $ easy_install gnsq\n\nOr even better, if you have virtualenvwrapper installed::\n\n    $ mkvirtualenv gnsq\n    $ pip install gnsq\n\nCurrently there is support for Python 2.7+, Python 3.4+ and PyPy.\n\nUsage\n-----\n\nFirst make sure nsq is `installed and running`_. Next create a producer and\npublish some messages to your topic::\n\n    import gnsq\n\n    producer = gnsq.Producer('localhost:4150')\n    producer.start()\n\n    producer.publish('topic', 'hello gevent!')\n    producer.publish('topic', 'hello nsq!')\n\nThen create a Consumer to consume messages from your topic::\n\n    consumer = gnsq.Consumer('topic', 'channel', 'localhost:4150')\n\n    @consumer.on_message.connect\n    def handler(consumer, message):\n        print 'got message:', message.body\n\n    consumer.start()\n\nCompatibility\n-------------\n\nFor **NSQ 1.0** and later, use the major version 1 (``1.x.y``) of gnsq.\n\nFor **NSQ 0.3.8** and earlier, use the major version 0 (``0.x.y``) of the\nlibrary.\n\nThe recommended way to set your requirements in your `setup.py` or\n`requirements.txt` is::\n\n    # NSQ 1.x.y\n    gnsq>=1.0.0\n\n    # NSQ 0.x.y\n    gnsq<1.0.0\n\nDependencies\n------------\n\nOptional snappy support depends on the `python-snappy` package which in turn\ndepends on libsnappy::\n\n    # Debian\n    $ sudo apt-get install libsnappy-dev\n\n    # Or OS X\n    $ brew install snappy\n\n    # And then install python-snappy\n    $ pip install python-snappy\n\nContributing\n------------\n\nFeedback, issues, and contributions are always gratefully welcomed. See the\n`contributing guide`_ for details on how to help and setup a development\nenvironment.\n\n\n.. _gevent: http://gevent.org/\n.. _NSQ: http://nsq.io/\n.. _Blinker: http://pythonhosted.org/blinker/\n.. _installed and running: http://nsq.io/overview/quick_start.html\n.. _contributing guide: https://github.com/wtolson/gnsq/blob/master/CONTRIBUTING.rst\n\n\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "A gevent based python client for NSQ.",
    "version": "1.0.2",
    "split_keywords": [
        "gnsq"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "0dc027a8c592e030364cc1e7816caccd",
                "sha256": "5c0d9cadb93430d10a2183621622c2b760b957c9b7c61c0573c7bb82a0c7774c"
            },
            "downloads": -1,
            "filename": "gnsq-1.0.2-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0dc027a8c592e030364cc1e7816caccd",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 32678,
            "upload_time": "2020-01-08T16:52:58",
            "upload_time_iso_8601": "2020-01-08T16:52:58.341436Z",
            "url": "https://files.pythonhosted.org/packages/a3/06/00dd201554402843bfdab0c9892b96f57630cddbeecadccce4d5fb5853f2/gnsq-1.0.2-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "b92f07143ac13fc9954cc5da9c10aae1",
                "sha256": "f2bb8cc816ffc449865ab1729eeec8b7524f7a416161cc99db2f44782a002c13"
            },
            "downloads": -1,
            "filename": "gnsq-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "b92f07143ac13fc9954cc5da9c10aae1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 46183,
            "upload_time": "2020-01-08T16:53:01",
            "upload_time_iso_8601": "2020-01-08T16:53:01.065788Z",
            "url": "https://files.pythonhosted.org/packages/3d/c3/e5edbf7abbc1b2947176ae487c37fff8bd7d47e47556057dc1274f82e8c9/gnsq-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-01-08 16:53:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "wtolson",
    "github_project": "gnsq",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "tox": true,
    "lcname": "gnsq"
}
        
Elapsed time: 0.02427s