semvec/pypi-packages huggingface dataset:
fairshare 0.1.2
Fair queue implementation on Python
Requires Python: >=3.10

# FairShare - a fair way to queue messages

## Installation

    pip install fairshare

## Usage Example

```python3
import asyncio

from fairshare.base import BaseMessage
from fairshare.core import FairQueue
from fairshare.helpers import init_redis


class DownloadRequest(BaseMessage):
    image_url: str


async def main():
    redis_url = "redis://127.0.0.1:6379/0"

    async with init_redis(redis_url) as client:
        queue = FairQueue("downloads", client)

        for i in range(2):
            share_id = f"user-{i + 1}"
            for _ in range(3):
                await queue.put(
                    DownloadRequest(
                        share_id=share_id,
                        image_url="https://picsum.photos/200"
                    )
                )

        async for message in queue.poll():
            print(f"Message from {message.share_id}")


if __name__ == '__main__':
    with asyncio.Runner() as runner:
        runner.run(main())

```

Running the above code should produce the following output:

```bash
$ python main.py

Output: "Message from user-1"
Output: "Message from user-2"
Output: "Message from user-1"
Output: "Message from user-2"
Output: "Message from user-1"
Output: "Message from user-2"
```
monadcontainers 0.2.0
Python monads for functional programing
Requires Python: >=3.8

# Monad Containers 🛸

Delicious monads for functional programming patterns in python!

[Check out the api docs for reference](https://benrutter.github.io/monads/monadcontainers.html)

![Coverage Badge](https://img.shields.io/badge/coverage-100-green) ![Static Badge](https://img.shields.io/badge/python-%3E%3D3.8-blue)

## Project Goals

This library is meant to implement a simple Monad class for functional chaining in python in a way that:

- Can be intergrated quickly/simply with existing code
- Maintains type safety
- Depends only on the standard library


## Quick Start

Install libary with pip:

```bash
pip install monadcontainers
```

You can now import monad classes for handling functional chains over data.

Say we want to pass a value through a list of functions like so:

```python
def add_six(x: int) -> int:
  return x + 6

def minus_two(x: int) -> int:
  return x - 2

x = minus_two(add_six(4))  # x == 8
```

This can be a little messy with long calls, more importantly monads can handle repeated work for us with each call (but we'll cover that in a sec).

A basic identity Monad implementing the above looks like this:

```python
from monadcontainers.monads import Monad

x = (
  Monad(4)
  .bind(add_six)
  .bind(minus_two)
)  # x == Monad(8)

y = x.value  # y == 8
```

This above pattern chains the Monad contained value through the relevant functions. For alternative syntactical sugar to the `bind` method, you can use `>>`:

```python
x = (
  Monad(4)
  >> add_six
  >> minus_two
)  # x == Monad(8)
```

We can also use Monads to handle additional functionality for us, like error handling with the `Result` monad:

```python
def divide_by_zero(x: int) -> int:
    return x / 0

x = (
  Result(4)
  >> add_six
  >> divide_by_zero
  >> minus_two
)  # x is a result monad

x.unwrap()  # <- raises divide by zero exception
x.unwrap_or(42)  # <- evaluates to 42
x.value  # <- is None (since exception has been raised)
x.exception  # <- is a ZeroDivisionError
x.recover(add_six)  # <- will apply the given function to the last non-error state
```

Monad's can be a helpful pattern for functional programming, see the docs for more info on available Monad classes.

Enjoy! 👍
parallel-db 0.0.3.post2
Package for high level database parallel  automatization
Requires Python: >=3.10

## Parallel-db

[![codecov](https://codecov.io/gh/Zkh-dot/parallel-db/graph/badge.svg?token=FXXCH3MW90)](https://codecov.io/gh/Zkh-dot/parallel-db)
[![CI - Test](https://github.com/Zkh-dot/parallel-db/actions/workflows/python-package.yml/badge.svg)](https://github.com/Zkh-dot/parallel-db/actions/workflows/python-package.yml)

Neet framework for managing database connections in python.
Can be usefull for basicly any database and can parallel your queries with ease.

There are represented 2 main classes: Table and Scenario. Scenario is a class that represents a set of queries that should be executed. Table is a class that represents a table in database and can be used to execute queries on it.

[Github page](https://github.com/Zkh-dot/parallel-db)