semvec/pypi-packages huggingface dataset:
argus-ticket-github 1.1.1
Allow argus-server to create tickets in Github
Requires Python: >=3.8

# argus_ticket_github

This is a plugin to create tickets in Github from [Argus](https://github.com/Uninett/argus-server)

## Settings

* `TICKET_PLUGIN`: `"argus_ticket_github.GithubPlugin"`
* `TICKET_ENDPOINT`: `"https://github.com/"` or link to self-hosted instance, absolute URL
* `TICKET_AUTHENTICATION_SECRET`: Create a [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) with the scope `repo`:

    ```
    {
        "token": token
    }
    ```

    It is recommended to create a Github API user and to ensure that that user
    has the necessary authorization for creating issues in the relevant
    repository.

* `TICKET_INFORMATION`:

    Project namespace and name (obligatory)

    ```
    {
        "project_namespace_and_name": project_namespace_and_name
    }
    ```

    To know which project to create the ticket in the Github API needs to know
    the owner and name of it. The owner is the user or organization the Github
    repository belongs to and the name is the name of the Github project.

    For the Github project
    [Hello Git World](https://github.com/githubtraining/hellogitworld) the
    dictionary would look like this:

    ```
    {
       "project_namespace_and_name": "githubtraining/hellogitworld",
    }
    ```

    Labels (optional)

    There are two ways of automatically filling labels:

    1. Labels that are always the same, independent of the incident.
    These will be set in `labels_set`.


        ```
        {
            "labels_set" : [
                label1,
                label2,
                label3,
            ]
        }
        ```

    2. Labels that are filled by attributes of the Argus incident.
    These are set in `labels_mapping` which is a list of the names of the
    attributes as they are returned by the API (e.g. `start_time`). If the
    information can be found in the tags the it has to be a dictionary with
    `tag` as the key and the name of the tag as the value (e.g.
    {"tag": "host"}).

        ```
        {
            "labels_mapping" : [
                attribute_of_incident,
                {"tag": name_of_tag},
            ]
        }
        ```

## Code style

argus_ticket_github uses black as a source code formatter. Black can be installed
by running

```console
$ pip install black
```

A pre-commit hook will format new code automatically before committing.
To enable this pre-commit hook, run

```console
$ pre-commit install
```
fish-util 1.0.37
Fishyer's Python Util Library

# 我的Python工具库

github地址：[fishyer/fish_util](https://github.com/fishyer/fish_util )
pypi地址：[fish_util](https://pypi.org/project/fish_util/)

## 介绍

这是我自己编写的一些Python工具库，包括：
- log_util
- decorator_util：包括trace_exception、trace_time、trace_args、trace_retry、trace_validate等装饰器
- file_util
- yaml_util
- json_util
- redis_util
- mysql_util
- mongo_util
- oss_util
- date_util
- string_util
- re_util
- collections_util
- function_util

## 安装

```
pip install fish_util
```

## 使用示例

```python
from fish_util.src.log_util import logger
import fish_util.src.decorator_util as decorator_util

logger.debug("This is a debug message")
logger.info("This is an info message")
logger.warning("This is a warning message")
logger.error("This is an error message")


@decorator_util.trace_exception
@decorator_util.trace_time
@decorator_util.trace_args
@decorator_util.trace_retry(max_attempts=2, delay=1)
@decorator_util.trace_validate(
    lambda username: len(username) > 0, lambda password: len(password) > 0
)
def login(username, password):
    if username == "admin" and password == "123456":
        return True
    else:
        return False


def main():
    print(__file__)
    print(login("admin", "123456"))
    print(login("", "123456"))


if __name__ == "__main__":
    main()
```

## 输出结果

![](https://yupic.oss-cn-shanghai.aliyuncs.com/202405141752940.png)