semvec/pypi-packages huggingface dataset:
mutablesecurity 0.4.0
Seamless deployment and management of cybersecurity solutions
License: MIT
Requires Python: >=3.9,<4.0
Keywords: cybersecurity,security-solutions,hardening,automatic-deployment

<div align="center">
    <img src="https://raw.githubusercontent.com/MutableSecurity/mutablesecurity/main/others/readme_images/cover.webp" width="600px" alt="Cover">
    <br/><br/>
    <img src="https://img.shields.io/github/workflow/status/mutablesecurity/mutablesecurity/Executes%20unit%20testing%20and%20coverage%20reporting?color=brightgreen&label=unit%20tests&logo=github&logoColor=white&style=flat-square" alt="Unit Tests">
    <a href='https://coveralls.io/github/MutableSecurity/mutablesecurity?branch=main'>
        <img src="https://img.shields.io/coveralls/github/MutableSecurity/mutablesecurity?color=brightgreen&label=coverage&logo=coveralls&logoColor=white" alt="Coveralls Coverage">
    </a>
    <br/>
    <img src="https://snyk-widget.herokuapp.com/badge/pip/mutablesecurity/badge.svg" alt="Snyk Security Score">
    <img src="https://deepsource.io/gh/MutableSecurity/mutablesecurity.svg/?label=active+issues&show_trend=true&token=p678jq0qtDRJaOXo_Whya-un" alt="Deepsource active issues">
    <img src="https://img.shields.io/badge/dependencies%20bumping-enabled-brightgreen?logo=dependabot&style=flat-square&logoColor=white" alt="Dependencies Bumping via Dependabot">
    <br/>
    <img src="https://img.shields.io/pypi/dm/mutablesecurity?color=blue&logoColor=white&label=downloads&logo=pypi&style=flat-square" alt="Monthly Downloads on PyPi">
    <img src="https://img.shields.io/pypi/v/mutablesecurity?color=blue&label=version&logo=pypi&logoColor=white&style=flat-square" alt="Stable Version of PyPi">
    <img src="https://img.shields.io/github/stars/mutablesecurity/mutablesecurity?color=blue&logoColor=white&label=stars&logo=github&style=flat-square" alt="GitHub Stars">
    <img src="https://img.shields.io/github/issues-closed/mutablesecurity/mutablesecurity?color=blue&logoColor=white&label=issues&logo=github&style=flat-square" alt="GitHub closed issues">
    <img src="https://img.shields.io/github/license/mutablesecurity/mutablesecurity?color=lightgray&logoColor=white&label=license&logo=opensourceinitiative&style=flat-square" alt="License">
    <br/>
</div>

---

# Description

**MutableSecurity** is a software product for making cybersecurity solution management easier and more accessible, from deployment and configuration to monitoring.

Despite the current lack of complex functionalities, we have a vision in mind that we hope to achieve in the near future. As we must begin somewhere, the first step in our progress is this command line interface for automatic management of cybersecurity solutions.

Come join the MutableSecurity journey!

# Read Further 📎

This is only an excerpt from the `README.md` hosted on GitHub. To read the full text, please visit our [official repository](https://github.com/MutableSecurity/mutablesecurity) and check our [website and documentation](https://mutablesecurity.io/)!
lazymethod 0.0.4
pylazy 是一个 python 对象的懒加载装饰器，类似于 `@property` 但只会调用一次。
License: MIT
Requires Python: >=3.8

**lazymethod** 是一个 python 对象的懒加载装饰器，类似于 `@property` 但只会调用一次。

**lazymethod** 还能静态识别方法返回值类型 ( 类似 `typing` ) 。

## 安装

```shell
pip install lazymethod
```

## 基本使用

只需要将方法加入到懒加载装饰器：`@lazymethod(<return type>)` 。

或使用 `var: [return type] = lazy(lambda: ...)` 。

```python
from pylazy import lazymethod

class Model:
    @lazymethod(list)
    def numbers(self):
        print('get numbers')
        return [1, 2, 3]

m1 = Model()
print(m1.numbers)
print(m1.numbers)

m2 = Model()
print(m2.numbers)
print(m2.numbers)
```

```python
### Print:
get numbers
[1, 2, 3]
[1, 2, 3]
get numbers
[1, 2, 3]
[1, 2, 3]
```

结果上所示。可以看到，每个对象只会调用懒加载方法一次。

也可以将方法声明为静态属性，如此就可以在任何时候都只调用一次：

```python
from typing import ClassVar

@lazymethod(ClassVar[list])
def numbers(self):
    print('get numbers')
    return [1, 2, 3]

m1 = Model()
print(m1.numbers)

m2 = Model()
print(m2.numbers)
print(Model.numbers)
    
""" Print:
get numbers
[1, 2, 3]
[1, 2, 3]
[1, 2, 3]
"""
```

### 使用 lambda

**lazymethod** 支持使用 `lambda` 表达式创建懒加载属性：


```python
from typing import ClassVar
from pylazy import lazy

class Model:
    numbers: list = lazy(lambda: [1, 2, 3])
    ages: ClassVar[list] = lazy(lambda: [10, 20, 30])

m1 = Model()
m2 = Model()

print(m1.numbers)
print(m2.ages)
```

结果如下：

```python
### Print:
[1, 2, 3]
[10, 20, 30]
```

## 静态识别返回值类型

不论你是使用 `@lazymethod` 还是 `lazy` 来创建懒加载属性，它们都会静态识别方法返回值类型：

![](33d61644f2ecc319455f4b1970fa0d0.jpg)

----

![](06201ef2fdbd0db6aa9a7c5d9a633c4.jpg)