Metadata-Version: 2.1
Name: suger
Version: 0.0.5
Summary: suger is a sugar. use python in @decorator/@Annotation like other languages~
Project-URL: Homepage, https://github.com/SolarisNeko/python-suger
Project-URL: Bug Tracker, https://github.com/SolarisNeko/python-suger/issues
Author-email: SolarisNeko <1417015340@qq.com>
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.7
Description-Content-Type: text/markdown

# suger


suger is a sugar ~ 

use python with @decorator/@Annotation Like Java、C#、TypeScript 

@author SolarisNeko


# What is it
Use Python in Decorator / Annotation Like Java Lombok / C# Annotation / TypeScript Decorator

作者是写 Java / TypeScript 习惯了注解

Use Like Other Language:
1. Java Lombok @Data
2. TypeScript  @Async
3. C#  [Required(ErrorMessage = "{0} is required")]

顺手写

# How to use 如何使用
## install 安装依赖
```shell
pip install suger
```

## @string | __str__
```python
@string
class MockData:
    def __init__(self, age):
        self.age = age


data = MockData(18)

# Output = "MockData(age=18)"
print(data)

```

## @csv | CSV 
```python
@csv
class MockData:
    def __init__(self, name, age):
        self.name = name
        self.age = age
        self.emptyTips = ''




class Test(TestCase):
    def test_csv(self):
        data = MockData(name='neko', age=18)

        # csv 输出文本
        print(data.csv_str())
        # csv 的格式
        print(data.csv_format())

# 示例中，有个字段为空
# neko,18,
# name,age,emptyTips

```


# my project init
```shell
git init

 git remote add github https://github.com/SolarisNeko/neko233-python-suger.git
 git remote add origin https://gitee.com/SolarisNeko/neko233-python-suger.git
```
