Metadata-Version: 2.4
Name: gossip
Version: 2.5.0
Summary: Signaling and hooking library
Project-URL: Homepage, https://github.com/getslash/gossip
Author-email: Rotem Yaari <vmalloc@gmail.com>
License: BSD 3-Clause License
License-File: LICENSE
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.8
Requires-Dist: logbook>=0.12.0
Requires-Dist: sentinels
Requires-Dist: vintage
Provides-Extra: doc
Requires-Dist: alabaster; extra == 'doc'
Requires-Dist: docutils; extra == 'doc'
Requires-Dist: releases; extra == 'doc'
Requires-Dist: sphinx>=1.7.1; extra == 'doc'
Provides-Extra: testing
Requires-Dist: munch; extra == 'testing'
Requires-Dist: pylint; extra == 'testing'
Requires-Dist: pytest; extra == 'testing'
Description-Content-Type: text/markdown

|                    |                                                                                                         |
| ------------------ | ------------------------------------------------------------------------------------------------------- |
| Build Status       | ![Build Status](https://github.com/getslash/gossip/actions/workflows/test.yml/badge.svg?branch=develop) |
| Supported Versions | ![Supported Versions](https://img.shields.io/pypi/pyversions/gossip.svg)                                |
| Latest Version     | ![Latest Version](https://img.shields.io/pypi/v/gossip.svg)                                             |

# Overview

`gossip` is a library implementing a basic hook mechanism for implementing callbacks. It provides flexible configuration, hook namespaces and error handling strategies.

# Installation

```
$ pip install gossip
```

# Usage

The simplest use case when we want to register a callback to be called later. We start by registering a callback through `gossip.register`:

```python

>>> from __future__ import print_function
>>> import gossip
>>> @gossip.register('hook_name')
... def func():
...     print('Called')

```

Now we can call the hook:

```python

>>> gossip.trigger('hook_name')
Called

```

# And There's A Lot More!

Plain publish/subscribe is just the tip of the iceberg. Gossip is geared towards implementing complex plugin systems, and supports many more advanced features, such as:

1. Token (bulk) unregistration of hooks
2. Hook dependencies - control the order of hook callbacks, either implicitly or explicitly
3. Non-reentrant hooks
4. Custom exception handling strategies

And much more. For more information, please refer to [the documentation](http://gossip.readthedocs.org)

# Licence

BSD3
