semvec/pypi-packages huggingface dataset:
cardaio 1.0.0
Iterator with adjustable delays between iterations.
Requires Python: >=3.8
Keywords: asyncio

# ❤️ cardaio

A Python library for adjustable delays.

The main use case is when you want to periodically pull something from a third-party system but you don't know exactly how often the system will have updates. For example, you're monitoring a news website for a particular topic and you want to pull news as soon as they are available but at the same time you don't want to send too many requests when there are no updates.

## 😎 Features

+ 🐍 Pure Python.
+ 🐎 asyncio-first with synchronous API available.
+ 🛡 Fully type-annotated and type-safe.
+ 🪶 Zero-dependency.
+ 🔧 Highly configurable.
+ ☑️ 100% test coverage.

## 📦 Installation

```bash
python3 -m pip install cardaio
```

## 🛠️ Usage

```python
from cardaio import Heartbeat

async def run() -> None:
    hb = Heartbeat(
        # never pull more often than every 1s.
        fastest=1,
        # never pull less often than every 1m.
        slowest=60,
        # start with 10s between iterations.
        start=10,
    )
    async for _ in hb:
        # Pull messages from a remote system.
        msgs = await pull_messages()
        # If there are more than 5 messages,
        # start pulling more often.
        if msgs > 5:
            hb.faster()
        # If there are no messages,
        # pull less often
        elif not msgs:
            hb.slower()
        ...  # do something with messages
```

## 🖨 Acknowledgments

The project is inspired by [cardio.go](https://github.com/Xe/x/blob/master/cardio/cardio.go) Go script introduced by [Xe Iaso](https://xeiaso.net/) in the [Anything can be a message queue if you use it wrongly enough](https://xeiaso.net/blog/anything-message-queue) blog post. The implementation and API are different, though, to make it pythonic and user-friendly.
miskibin 1.2.4
My personal package for colored logs. Highly customizable.
Requires Python: >=3.8


![example workflow](https://github.com/michalskibinski109/miskibin/actions/workflows/python-app.yml/badge.svg)
[![PyPI version](https://badge.fury.io/py/miskibin.svg)](https://badge.fury.io/py/miskibin)

# miskibin

this repo contains some of my scripts and tools, that i
could not find anywhere else.

## repository
https://github.com/michalskibinski109/miskibin

## description

module contains some useful functions, that i use in my projects.

## usage

### get_logger

returns highly configurable logger object.

- Every level has its own color. (If it is printed to terminal)
- Problems with logging messages from `ipynb` cells are resolved.
- Includes validation for file name and path.
- Has `disable_existing_loggers` param to disable all other loggers.
#### params:
- `logger_name` - name of the logger
- `lvl`: [logging level](https://docs.python.org/3/library/logging.html#logging-levels). Default is 10 (DEBUG).
- `file_name`: file that logs will be saved to. If None, logs will not be saved to file.
- `format`: [logging format](https://docs.python.org/3/library/logging.html#logrecord-attributes).
- `datefmt`: date format for logging formatter. Define only if `(asctime)` in format Default is "%H:%M:%S".
- `disable_existing_loggers`: if True, disable existing loggers.

#### Example 1:

```python
from miskibin.utils import get_logger
logger = get_logger(lvl = 10)
logger.debug("debug")
logger.info("info")
logger.warning("warning")
logger.error("error")
logger.critical("critical")
```

#### output:
<img src="https://user-images.githubusercontent.com/77834536/201940080-28e7dc08-ac99-4f8d-8f24-a9e0c6ac06c2.png" width="500"/>

#### example 2:

```python
from miskibin.utils import get_logger
logger = get_logger(
    datefmt="%Y-%m-%d %H:%M:%S",
    format="%(asctime)s %(levelname)s %(funcName)s %(message)s",
    disable_existing_loggers=True,
    logger_name="test2",
    file_name = None,
    lvl="INFO",
)


def example_func():
    logger.debug("debug")
    logger.info("info")
    logger.warning("warning")
    logger.error("error")
    logger.critical("critical")
example_func()
```

#### output:

<img src="https://user-images.githubusercontent.com/77834536/201939466-228b110f-21de-4461-9c86-55f8f46652ef.png" width="500"/>
Python-PCG 0.2
Python wrapper around the PCG c++ library.
Requires Python: >=3.7

# Python-PCG

This is a python wrapper around the pcg-cpp library, for randum number generation using the _permuted congruential generator_ method. For more information, see [the official website](https://www.pcg-random.org/).

## Installation
```bash
pip install Python-PCG
```

## Usage:

```python
import py_pcg

rng = py_pcg.PCG32()
rng = py_pcg.PCG32(42, 9001) # Seed with initial stream and state.

rng.rand()     # Generate a single random uniform number.
rng.randn(100)     # Generate a list of random numbers following a standard normal PDF.
rng.randint(1000, bound=100) # Generate a list of bounded random integers.
```