semvec/pypi-packages huggingface dataset:
pylcount 0.1.1
Python file line counter.
License: MIT
Keywords: line,counter,count,file

# PyLcount

PyLcount (python line count) is a line counter written in python that can count the lines with different *search options* using a command line interface.

Use pip to install `pylcount`:

```
pip install pylcount
```

## How to use

You must use the `pylcount` command to be able to count the lines in a single file or in a directory using the `count` argument. Here is an example:

```
pylcount count ./pylcount
```

Or in just one file:

```
pylcount count ./pylcount/counter.py
```

You can also filter some files by their extension using the `--ext` flag, or ignore directories and files using the `--ignore` flag:

```
pylcount count ./pylcount --ignore ./venv --ext .py .md
```

In the above command, we are ignoring the `venv` directory and only getting the files with the `.py` and `.md` extensions.

## License

This project uses the `MIT License`, [see the LICENSE](https://github.com/jaedsonpys/pylcount/blob/master/LICENSE) file in the root of the project for more information.
rabbitmq-decorator 0.0.1
Easily send and receive messages to and from RabbitMQ message broker
License: MIT
Requires Python: >=3.7.0


# RabbitMQ Decorator
* Work in progress

Easily send and receive messages to and from RabbitMQ message broker.


## Installation

```bash
pip install rabbitmq-decorator
```


##  Usage 

### Optional:
```shell
export RABBITMQ_HOST=localhost
export RABBITMQ_PORT=5672
export RABBITMQ_USERNAME=username
export RABBITMQ_PASSWORD=password
```

### Example:

```python
import asyncio
from typing import Dict, Any

from rabbitmq_decorator import RabbitMQHandler, RabbitMQConsumer, RabbitMQProducer, RabbitMQMessage, Exchange

event_loop = asyncio.get_event_loop()

# If environment variables was set
rabbit_handler = RabbitMQHandler(event_loop=event_loop)

# Or if environment variables wasn't set 
rabbit_handler = RabbitMQHandler(
    event_loop=event_loop,
    rabbitmq_host="localhost",
    rabbitmq_port=5672,
    rabbitmq_username="username",
    rabbitmq_password="password"
)


@rabbit_handler
class SomeClass:
    EXCHANGE = Exchange("test_exchange", durable=True)
    _producer: RabbitMQProducer = rabbit_handler.get_new_producer(EXCHANGE)

    def some_unrelated_function(self):
        pass

    @RabbitMQConsumer(EXCHANGE)
    async def consumer_1(self, body: Dict[str, Any]):
        print("I'm getting all the messages on test_exchange")
        self._producer.publish(RabbitMQMessage(routing_key="response.consumer1", body={"status": "Success"}))

    @RabbitMQConsumer(EXCHANGE, route="*.*.*")
    async def consumer_2(self, body: Dict[str, Any]):
        print("I'm getting only the messages on test_exchange with *.*.* as routing-key ")
        response_exchange = Exchange("response_exchanges", durable=True)
        self._producer.publish(
            exchange=response_exchange,
            message=RabbitMQMessage(routing_key="response.consumer2", body={"status": "Success"})
        )


# ================ main ================

async def main():
    """do something"""


if __name__ == '__main__':
    some_class = SomeClass()
    rabbit_handler.start(some_class)
    event_loop.run_until_complete(main())
    rabbit_handler.stop_consume(some_class)
```