semvec/pypi-packages huggingface dataset:
py-vigil-reporter 0.2.0
Vigil Reporter for Python
License: MIT
Requires Python: >=3.6

# py-vigil-reporter
[![codecov](https://codecov.io/gh/M0r13n/py-vigil-reporter/branch/master/graph/badge.svg)](https://codecov.io/gh/M0r13n/py-vigil-reporter)
[![downloads](https://img.shields.io/pypi/dm/py-vigil-reporter)](https://pypi.org/project/py-vigil-reporter/)

#### Vigil Reporter for Python. Used in pair with [Vigil](https://github.com/valeriansaliou/vigil), the Microservices Status Page.


## Who uses it?

<table>
<tr>
<td align="center"><a href="https://smartphoniker.shop/"><img src="https://smartphoniker.shop/static/images/smartphoniker-logo.svg" height="64" /></a></td>
</tr>
<tr>
<td align="center">Smartphoniker</td>
</tr>
</table>



# How to install
Install with pip:

```sh
$ pip install py-vigil-reporter
```


# How to use
`vigil-reporter` can be instantiated as such:

```py
from vigil_reporter.reporter import VigilReporter

SAMPLE_CONFIG = {
    "url": "http://localhost:8080",
    "token": "REPLACE_THIS_WITH_A_SECRET_KEY",
    "probe_id": "stats",
    "node_id": "stats-node",
    "replica_id": "192.168.1.103",
    "interval": 5
}
reporter = VigilReporter.from_config(SAMPLE_CONFIG)
reporter.start_reporting()
print("You can continue with your normal work here!")
```

This module uses the `threading.Timer` class from the `threading` module to run reporting in background. 
This makes the method non-blocking. 

**NOTE**: The threaded execution drifts about +/- 0.05 seconds. But this won't be an issue, as you should set an interval that is greater than 1.0 seconds.

For further details see this Stackoverflow [post](https://stackoverflow.com/questions/8600161/executing-periodic-actions-in-python).

# What is Vigil?
ℹ️ **Wondering what Vigil is?** Check out **[valeriansaliou/vigil](https://github.com/valeriansaliou/vigil)**.
persistentdict 1.0.1
Yet another dictionary backed by Redis DB
License: MIT
Requires Python: >=3.6
Keywords: dict,durable,persistent,redis

# persistentdict

Yet another \[1\] dictionary backed by Redis DB.

We use Redis` 'hash' type \[2\] and store whole dictionary in one hash.

Usage:

```python
from persistentdict.dict_in_redis import PersistentDict

db = PersistentDict(hash_name="my-persistent-dict")

# add key to the db with a value
db['key'] = value

# show whole dictionary
print(db)

# iterate over keys & values in db
for key, value in db.items():
  do_something(key)

# do sth with key if it is in db
if key in db:
  do_something(key)

# delete key from db
del db['key']
```

Installation:

```shell
pip3 install persistentdict
```


\[1\] Alternatives: [persistent-dict](https://github.com/richardARPANET/persistent-dict), [durabledict](https://github.com/disqus/durabledict/)

\[2\] https://redis.io/topics/data-types-intro#hashes is basically Python's dict, but values can be strings only, so we use json serialization