Succession
==========
|build-status| |coverage|
A python library providing a useful abstraction for recording state transitions, compressing them, and distributing to multiple listeners.
Usage
=====
Compression
-----------
The :class:`Succession` class provides a way to reduce long chains of updates
down to a reduced chain with the same effect.
For example, assume that you only care about the sum of the numbers pushed to a
succession, and that it's fine to replace all of the numbers from before you started
listening with the current total. You can do something like the following:
>>> succession = Succession(compress=lambda items: [sum(items)])
<succession.Succession object at 0x7f5a65a10518>
>>> from_start = succession.iter()
>>> for i in [1, 2, 3, 4, 5]:
... succession.push(i)
... succession.close()
>>> from_end = succession.iter()
>>> list(from_start)
[1, 2, 3, 4, 5])
>>> list(from_end)
[15]
Iterators forked earlier will not miss any transitions added from the time they
were created. Compression is only applied to transitions before the fork.
Installation
============
Recommended method is to use the version from `pypi`_
.. code::
pip install succession
Links
=====
- Source code: https://github.com/bwhmather/succession
- Issue tracker: https://github.com/bwhmather/succession/issues
- Continuous integration: https://travis-ci.org/bwhmather/succession
- PyPI: https://pypi.python.org/pypi/succession
License
=======
The project is licensed under the BSD license. See `LICENSE`_ for details.
.. |build-status| image:: https://travis-ci.org/bwhmather/succession.png?branch=develop
:target: https://travis-ci.org/bwhmather/succession
:alt: Build Status
.. |coverage| image:: https://coveralls.io/repos/bwhmather/succession/badge.png?branch=develop
:target: https://coveralls.io/r/bwhmather/succession?branch=develop
:alt: Coverage
.. _pypi: https://pypi.python.org/pypi/sucession
.. _LICENSE: ./LICENSE
Metadata
Release files for succession 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| succession-0.5.0.tar.gz | 4.1 kB | Without provenance | Details |
Release files / succession-0.5.0.tar.gz
| Download URL | succession-0.5.0.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e18722468cf8ef1a2f3de2a47550a91b930f775d0b2734915079aa0e8c39a2d6
|
|
BLAKE2b-256 checksum How to use checksums |
ea5c4d1e97e819e58ade48fcccf29b60c9c5d87fcecbdc227bf9ff39fbec67fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for succession 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.