semvec/pypi-packages huggingface dataset:
history-set 0.3.0
A Set implementation that tracks added and removed elements.

# History Set #

A Set implementation that tracks added and removed elements.

## Usage ##

~~~python
>>> from history_set import HistorySet
>>> history_set = HistorySet([1, 2, 3])
>>> history_set.add(4)
>>> history_set                   # Prints: {1, 2, 3, 4}
>>> history_set.added()           # Prints: {4}
>>> history_set.remove(1)
>>> history_set                   # Prints: {2, 3, 4}
>>> history_set.removed()         # Prints: {1}
>>> history_set.reset()
>>> history_set.added()           # Prints: set()
>>> history_set.removed()         # Prints: set()
~~~

## Special case ##

By default, if an element is added and later removed, it will not be tracked in history

~~~python
>>> history_set = HistorySet([1, 2, 3])
>>> history_set.add(4)
>>> history_set.remove(4)
>>> history_set.added()           # Prints: set()
>>> history_set.removed()         # Prints: set()
~~~

If you require these elements to be tracked, you can construct the object with the `eidetic` keyword argument

~~~python
>>> history_set = HistorySet([1, 2, 3], eidetic=True)
>>> history_set.add(4)
>>> history_set.remove(4)
>>> history_set.added()           # Prints: {4}
>>> history_set.removed()         # Prints: {4}
~~~

----------

By default, the `reset()` method will clear the entire history

~~~python
>>> history_set = HistorySet([1, 2, 3])
>>> history_set.add(4)
>>> history_set.added()           # Prints: {4}
>>> history_set.remove(2)
>>> history_set.removed()         # Prints: {2}
>>> history_set.reset()
>>> history_set.added()           # Prints: set()
>>> history_set.removed()         # Prints: set()
~~~

If you require reseting only the `added()` or `removed()` history, you can call the `reset` method with `added` or `removed` booleans values to specify which history you with to reset

~~~python
>>> history_set = HistorySet([1, 2, 3])
>>> history_set.add(4)
>>> history_set.added()           # Prints: {4}
>>> history_set.remove(2)
>>> history_set.removed()         # Prints: {2}
>>> history_set.reset(added=True)
>>> history_set.added()           # Prints: set()
>>> history_set.removed()         # Prints: {2}
~~~

## Test ##

You can run the tests using [tox](https://tox.readthedocs.io/en/latest/)

~~~shell
tox
~~~

## Publish ##

To publish a new version of this package your Pypi user needt to be added to the project. (Ask Tjaart to give you access)

~~~shell
# Update version number in setup.py

python setup.py sdist
twine upload dist/*
~~~
notify-run 0.0.15
Client for notify.run notifications.
Requires Python: >=2.7

==========
notify-run
==========

Setup
-----

``notify-run`` can be installed with ``pip``::

    pip install notify-run

This will install both a Python module ``notify_run`` for sending notifications
programmatically, and the ``notify-run`` command for sending notifications
from the shell.

Configuration
-------------

Before you use either the shell command or Python package to send notifications,
you must configure an endpoint. Both the command-line interface and Python
interface provide a way of creating this configuration, and the configuration is
shared by both. The configuration is stored in a file called ``.config/notify-run``
in your home directory.

Command-line Interface
----------------------

Register a channel
~~~~~~~~~~~~~~~~~~

To register a channel::

    notify-run register

You will then be presented with a link that you can open on the devices
you wish to subscribe to the channel. A QR code encoding the link is also
provided for convinience.

.. image:: https://raw.githubusercontent.com/notify-run/notify.run/master/py_client/screenshots/register.png
   :width: 490px
   :height: 453px
   :alt: Registering from the command line.

Sending Message
~~~~~~~~~~~~~~~

Once you have registered a channel, you can send a message to it with the
``send`` subcommand::

    notify-run send "Hi from notify-run."

To open a webpage when the notification is clicked, you can pass it to
notify-run as the `-a` parameter::

    notify-run send "Click to open notify.run!" -a https://notify.run

Using an Existing Endpoint
~~~~~~~~~~~~~~~~~~~~~~~~~~

If you want to point notify-run at an existing endpoint, for example one
created through the `web interface <https://notify.run/>`_, you can use the
``configure`` subcommand instead of ``register``::

    notify-run configure <endpoint URL>

Python Interface
----------------

The commands above can also be used through a Python interface::

    from notify_run import Notify
    notify = Notify()
    notify.register()
    notify.send('Hi there!')
    notify.send('Click to open notify.run!', 'https://notify.run')

To connect to a channel you have already created, pass it as the `endpoint` parameter to `Notify()`:

    notify = Notify(endpoint="https://notify.run/<channel_id>")

The ``notify.register()`` and ``notify.info()`` commands return an ``EndpointInfo`` object.
When rendered in a terminal, this prints the QR code in a terminal-friendly way. When used
in a Jupyter notebook, it displays the QR code inline.

.. image:: https://raw.githubusercontent.com/notify-run/notify.run/master/py_client/screenshots/notebook.png
   :width: 490px
   :height: 453px
   :alt: Inline QR Code in Jupyter Notebook