semvec/pypi-packages huggingface dataset:
bunnymq 0.0.15
Simple messaging with RabbitMQ and Python.

# BunnyMQ

[![Build Status](https://travis-ci.com/havefish/bunnymq.svg?branch=master)](https://travis-ci.com/havefish/bunnymq)
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/bunnymq.svg)](https://pypi.python.org/pypi/bunnymq/)
[![PyPI version fury.io](https://badge.fury.io/py/bunnymq.svg)](https://pypi.python.org/pypi/bunnymq/)

Simple messaging with RabbitMQ and Python.

Head over to the [tutorial](http://havefish.github.io/bunnymq/) to get started.

This is a small library inspired by the Python standard library [queue](https://docs.python.org/3/library/queue.html) module and the [hotqueue](https://github.com/richardhenry/hotqueue) library. Primarily geared towards programmer happiness :slightly_smiling_face:

Basic Usage:

```python
>>> queue = Queue('test')

>>> queue.put(1)
>>> queue.put('hello', priority=8)
>>> queue.put({'a': 1})

>>> queue.get()
'hello'
>>> queue.task_done()

>>> queue.get()
1
>>> queue.requeue()
```

Iterating over a queue indefinitely, waiting if nothing is available:

```python
>>> for item in queue:
...     print(item)
...     queue.task_done()
```

## Features

* Simple usage
* Automatic serialization and deserialization of Python objects
* Adding custom serializers or turning serialization off is trivial
* Automatic retry while publishing
* Automatic handling of connection failures while consuming
* Easy parallelization by starting multiple workers to share the load.


## Install

```
pip install bunnymq
```

## Requirements
* Python 3.6+
* [RabbitMQ server](https://www.rabbitmq.com/)
* [Pika](https://pika.readthedocs.io/en/stable/)
dataclass-cli 0.1.1
A library for building simple CLIs from dataclasses

# datacli

`datacli` is a library for building simple command line interfaces from
dataclasses. It is built on `argparse` and has no dependencies.

## Usage

A ~~picture~~ code snippet speaks a thousand words:

```python
# person.py

from dataclasses import dataclass, field
from datacli import datacli

@dataclass
class Person:
    name: str
    age: int = 30

args = datacli(Person)
print(args)
```

```shell
$ python person.py --name "Jeremy"
Person(name="Jeremy", age=30)
$ python person.py --name "Jeremy" --age 20
Person(name="Jeremy", age=20)
$ python person.py --help
usage: test.py [-h] --name NAME [--age AGE]

optional arguments:
  -h, --help   show this help message and exit
  --name NAME
  --age AGE
```

## Field names

Short and long field names (`-a` or `--foo-bar`) can be modified through the
[data-class field metadata][field], for example,

```python
# person.py

from dataclasses import dataclass, field
from datacli import datacli

@dataclass
class Person:
    name: str = field(metadata={"short_name": "-n"})
    age: int = field(metadata={"short_name": "-a", "long_name": "--years"})

args = datacli(Person)
print(args)
```

```shell
$ python person.py -n "Jeremy" -a 20
Person(name="Jeremy", age=20)
$ python person.py --name "Jeremy" --years 30
Person(name="Jeremy", age=30)
$ python person.py --help
usage: test.py [-h] --name NAME --age AGE

optional arguments:
  -h, --help   show this help message and exit
  -n, --name NAME
  -a, --age YEARS
```

If you want to use defaults with field names, you should use the [`default` or
`default_factory`][field] arguments to `field()`, for example,

```python
age: int = field(default=20, metadata={"short_name": "-a"})
```

[field]: https://docs.python.org/3/library/dataclasses.html#dataclasses.field