semvec/pypi-packages huggingface dataset:
celery-rmq 0.0.2
Celery and RabbitMQ producer and consumer made easy with celery-rmq
License: MIT
Requires Python: >=3.6.0

# celery-rmq

celery-rmq is a python library to implement Celery and RabbitMQ message broker. 
it's a standalone library required celery and kombu (python library for rabbitmq).
Celery and RabbitMQ producer and consumer made easy with celery-rmq


## Quick Start

First of all, install rabbitmq and start.

Create a python app and create an virtual environment too. Activate the virtual environment.

1:: Install it:

```bash
pip install celery-rmq
```


2:: Basic Usage:

** app.py **

```python
from celery_rmq.app import CeleryAppProvider
from celery_rmq.exchange import register_exchange
from celery_rmq.queue import register_queue

from .consumers.testconsumer import BasicTestConsumer

apps = ['tests.testapp']

app_provider = CeleryAppProvider(app_name='test_celery_broker', installed_apps=apps)

app = app_provider.get_app()


# adding exchanges

def register_exchanges():
    register_exchange(app_provider, "test_exchange")


def register_queues():
    register_queue(app_provider, "test_queue", "test_routing", "test_exchange")


def add_consumers():
    app_provider.add_consumer(BasicTestConsumer)


# execution of following two functions
# "register_exchanges()" and "register_queues()"
# needs to be synced
# i.e one after another.
# because queues are depended on exchanges

register_exchanges()
register_queues()

add_consumers()

app.start()
```

register as many as exchanges, queues and consumers

3:: consumer.py

```python
import kombu
from celery import bootsteps

from celery_rmq.registry import get_queue


class BasicTestConsumer(bootsteps.ConsumerStep):

    def handle_message(self, body, message):
        print(body)
        message.ack()

    def get_consumers(self, channel):
        queue = get_queue("test_queue", "test_routing")
        return [kombu.Consumer(
            channel,
            queues=[queue],
            callbacks=[self.handle_message],
            accept=['json']
        )]
```

4:: If you want to add this with any framework,
create an app (example: **Django** apps) and create a tasks.py file under the app:

```python
from __future__ import absolute_import, unicode_literals

from celery import shared_task

from tests.app import app_provider


@shared_task
def simple_json_message(message, exchange_name, route_key):
    producer = app_provider.get_producer()
    producer.publish(message, content_type='application/json', exchange=exchange_name, routing_key=route_key)
```

&nbsp;&nbsp;&nbsp;and call the `simple_json_message` function from the view as per your need.

5:: Run the celery worker:

```bash
celery worker -l info -A app
```

here app is app.py file

###### Done.

for testing purpose, we would like to send messages directly from RabbitMQ web panel. Go the the queue section and publish message.

<p align="center">
    <img src="https://github.com/knroy/celery-rmq/blob/master/screenshots/publish_message_from_rabbitmq.png?raw=True">
</p>

<p align="center">
    <img src="https://github.com/knroy/celery-rmq/blob/master/screenshots/terminal.png?raw=True">
</p>
pip-grab 1.0.0.6
Grabs installed packages in pip every N seconds
License: MIT
Requires Python: >=3.6

# pip-grab         ![Python package](https://github.com/QuantumNovice/pip-grab/workflows/Python%20package/badge.svg)

https://pypi.org/project/pip-grab/#description
https://github.com/QuantumNovice/pip-grab

# Installation
`pip install pip-grab`

# Motivation
`pip install this`, `pip install that`, `conda install this`, `conda install that`
and you never know when pip will break conda environment or conda will break pip.
That's why it's better to keep backup of your installed packages so you can revert
changes.


# Usage
```cmd
py -m pip_grab.pip_grab [-h] [-s] [-g] [-t TICKER]

Grabs currently installed pip packages.

optional arguments:
  -h, --help            show this help message and exit
  -s, --save            Save packages
  -g, --grab            Display packages
  -t TICKER, --ticker TICKER
                        Save installed packages after N seconds
```

```python
from pip_grab import pip_grab
pip_grab.ticker(60000)
```

# Examples
`py pip_grab.py --ticker 590000`

# Output
```cmd
[+] Loop Started
[+] Enivronment grabs after every 2.7314814814814814 hours
```
algopack 0.0.4
Implementation of various common CS algortihms in Cython
License: MIT
Requires Python: >=3.6

========
algopack
========
Implementation of various common CS algorithms in Cython

Usage
=====

Installation
------------
.. code-block:: shell

    $ pip install algopack

Examples
--------

Sorting:

.. code-block:: python3

    from algopack import sort

    my_array = [10, 0, 5, 15, -5]
    sorted_array = sort.bubble(my_array)
    print(sorted_array)
    # [-5, 0, 5, 10, 15]

Testing
-------

Clone the repository::

    $ git clone https://github.com/divykj/algopack.git
    $ cd algopack


Install requirements::

    $ pip install -r requirements.txt
    $ pip install -r requirements_dev.txt

Run tests::

    $ doit tests


Modules
=======

- `sort <algopack/sort.pyx>`_
    - `bubble <algopack/sort.pyx#L2-L18>`_
    - `bucket <algopack/sort.pyx#L22-L38>`_
    - `cocktail_shaker <algopack/sort.pyx#L42-L64>`_
    - `comb <algopack/sort.pyx#L68-L90>`_
    - `counting <algopack/sort.pyx#L94-L124>`_
    - `gnome <algopack/sort.pyx#L128-L139>`_
    - `heap <algopack/sort.pyx#L143-L175>`_
    - `insertion <algopack/sort.pyx#L179-L196>`_
    - `merge <algopack/sort.pyx#L200-L238>`_
    - `pancake <algopack/sort.pyx#L242-L255>`_
    - `quick <algopack/sort.pyx#L259-L287>`_
    - `radix <algopack/sort.pyx#L291-L315>`_
    - `selection <algopack/sort.pyx#L319-L335>`_
    - `shell <algopack/sort.pyx#L339-L358>`_