semvec/pypi-packages huggingface dataset:
pynenc-rabbitmq 0.1.4
RabbitMQ plugin for pynenc, a distributed task queue for Python.
License: MIT License
Requires Python: <4.0,>=3.11.6

# Pynenc RabbitMq Plugin

[![CI](https://github.com/pynenc/pynenc-rabbitmq/actions/workflows/ci.yml/badge.svg)](https://github.com/pynenc/pynenc-rabbitmq/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/pynenc/pynenc-rabbitmq/branch/main/graph/badge.svg)](https://codecov.io/gh/pynenc/pynenc-rabbitmq)
[![PyPI version](https://badge.fury.io/py/pynenc-rabbitmq.svg)](https://badge.fury.io/py/pynenc-rabbitmq)
[![Python versions](https://img.shields.io/pypi/pyversions/pynenc-rabbitmq.svg)](https://pypi.org/project/pynenc-rabbitmq/)

RabbitMq state backend plugin for [Pynenc](https://github.com/pynenc/pynenc), providing distributed task state management using RabbitMq as the storage backend.

## Features

- 🚀 **High Performance**: Optimized RabbitMq operations with connection pooling
- 🔒 **Distributed Locking**: RabbitMq-based distributed locks for task coordination
- 🎯 **Type Safe**: Full type hints and mypy compatibility
- 🧪 **Well Tested**: Comprehensive test suite with multiple RabbitMq versions
- 📊 **Production Ready**: Battle-tested configuration options and monitoring

## Quick Start

### Installation

```bash
pip install pynenc-rabbitmq
```

### Basic Usage

```python
from pynenc import Pynenc
from pynenc_rabbitmq import RabbitMqStateBackend

# Create Pynenc app with RabbitMq backend
app = Pynenc().with_state_backend(
    RabbitMqStateBackend.from_uri("rabbitmq://localhost:27017/pynenc")
)

@app.task
def my_task(x: int, y: int) -> int:
    return x + y

# Use your tasks as normal
result = my_task(1, 2)
```

## Configuration

### Connection Configuration

```python
from pynenc_rabbitmq import RabbitMqStateBackend, ConfigRabbitMq

config = ConfigRabbitMq(
    uri="rabbitmq://localhost:27017",
    database_name="my_pynenc_db",
    max_pool_size=100,
    write_concern_w="majority",
    read_preference="primaryPreferred"
)

backend = RabbitMqStateBackend(config)
```

### Environment Variables

You can also configure via environment variables:

```bash
export PYNENC_RABBITMQ_URI="rabbitmq://localhost:27017"
export PYNENC_RABBITMQ_DATABASE="pynenc"
export PYNENC_RABBITMQ_MAX_POOL_SIZE="100"
```

## Documentation

- [Configuration Guide](docs/configuration/index.md)
- [Usage Examples](docs/usage/index.md)
- [Migration Guide](docs/migration/index.md)

## Development

### Setup

1. Clone the repository
2. Install dependencies: `poetry install --with dev`
3. Start RABBITMQ: `docker-compose -f docker/docker-compose.yml up -d`
4. Run tests: `poetry run pytest`

### Contributing

We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
AnsiLib 1.1.0
A library for handling ANSI codes
License: MIT License
Requires Python: >=3.5

# AnsiLib

AnsiLib is a Python module for handling text style and color shortcuts from ANSI escape codes.

**Author:** Bora Boyacıoğlu
* E-Mail: boyacioglu20@itu.edu.tr
* GitHub: [@boraboyacioglu-itu](https://github.com/boraboyacioglu-itu)

## Installation

To install AnsiLib, use pip:

```sh
pip install ansilib
```

If you are running Python 3.7 or below, you also need to install `typing_extensions`, which comes as a dependency. 

## Usage

```python
import AnsiLib as al
```

You can use the quick styles and colors to simply format your text.

```python
print(al.s("This text is bold."))
print(al.r("This text is red."))
print(al.u(al.b("This text is underlined and blue.")))
```

Also you can reach all of the colors using `al.c` class.

```python
print(al.c.t.r("This text is red."))
print(al.c.b.c("This text has cyan background."))
print(al.c.t.g_("This text is bright green."))
```

To define styles, use `al.style()` function.

```python
sty1 = al.style('bold', 'r', 'kb1')
print(sty1("This text is bold, red and has a background color of bright black."))
```

Get the complete list of styles and colors with `al.available()`.

```python
print(al.available())
```

Create an RGB color using `al.color()` function.

```python
my_color = al.color(56, 12, 74)
sty2 = al.style('x', 'italic', my_color)
print(sty2("This text is italic, crossed and has an RGB color of (56, 12, 74)."))
```

Finally, you can use the AnsiLib's `prints()` function to print a styled text.

```python
al.prints("This text is bold, red and has a background color of bright black.", s=['bold', 'r', 'kb1'])
```

The `prints()` function also supports inline style syntax for quick styling:
```python
al.prints("$[r]This text is red", "$[b,u]This text is blue and underlined")
```

It is also possible to use the short form for single-character styles:
```python
al.prints("$rThis text is red")
```

Inline syntax takes priority per value, the optional s= parameter still applies an overall style.

## Contributions

I welcome contributions and suggestions to the AnsiLib Python library! Contact me about the details.

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE.txt) file for details.