semvec/pypi-packages huggingface dataset:
operation-log 0.2.2
A operation log package
Requires Python: >=3.7

# Operation Log

operation_log is used to record operation log for web api.

## Features

1. Non-intrusive to record operation log

## Requirements

1. Python 3.x

## Getting started

1. install operation log

```shell
pip install operation-log 
```

2. use record_operation_log decorator to wrap api function

```python
from operation_log import Operator, record_operation_log


def get_operator() -> Operator:
    return Operator(1, 'test_user')


@record_operation_log(get_operator, 'hello world')
async def hello(request):
    return Response()
```

3. use record_operation_log decorator with context

```python
import typing

from operation_log import Operator, record_operation_log


def get_operator() -> Operator:
    return Operator(1, 'test_user')


def before_execute_context(request) -> typing.Dict:
    return {'msg': 'hello old world'}


def after_execute_context(request) -> typing.Dict:
    return {'msg': 'hello new world'}


@record_operation_log(
    get_operator,
    'hello {{ before_execute.msg }} {{ after_execute.msg }}',
    before_execute_contexts=[before_execute_context],
    after_execute_contexts=[after_execute_context]
)
async def hello(request):
    return Response()
```

The context functions will receive params such as the execute function.

4. custom log writer

```python
import logging

from operation_log import Operator, OperationLogWriter, OperationLog, record_operation_log


def get_operator() -> Operator:
    return Operator(1, 'test_user')


class CustomOperationLogWriter(OperationLogWriter):
    def write(self, operation_log: OperationLog):
        logging.info(f'this is custom log writer {operation_log.text}')


@record_operation_log(
    get_operator,
    'hello world',
    writer=CustomOperationLogWriter()
)
async def hello(request):
    return Response()
```

If you want to save the operation log to the database, you can subclass the `OperationLogWriter` class and implement
your own `write` method.
color-printtext 1.0.2
PrintColor

# color-printtext
![image](https://user-images.githubusercontent.com/78240988/160273481-3bdbedb7-5580-4975-833a-a611bcbc7a8a.png)<br>
<a href="https://pypi.org/project/color-printtext/"><img src="https://img.shields.io/pypi/v/color-printtext.svg" alt="pypi Vertion" /></a>
<a href="https://pypi.org/project/color-printtext/"><img src="https://img.shields.io/pypi/pyversions/color-printtext.svg" alt="Python Vertion" /></a>
<a href="https://pepy.tech/project/color-printtext"><img src="https://static.pepy.tech/badge/color-printtext" alt="Total downloads" /></a>  
[pypi](https://pypi.org/project/color-printtext/)<br>
[wiki](https://github.com/gx1285/color-printtext/blob/main/docs/index.md)<br>
A module that specifies the color of print.  
# How to use
It can be installed using pip.
```sh
python3 -m pip install -U color-printtext
```
On Windows, install with this command.
```sh
py -3 -m pip install -U color-printtext
```
If you have passed PATH, you can install it with this command.
```sh
pip install -U color-printtext
```
Install with
Sample code
```py
import colorprinttext
colorprinttext.cprint('test','red')
```