Skip to main content

try to upload to Pypi

Project description

sugar

@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 安装依赖

pip install sugar

@string | str

@string
class MockData:
    def __init__(self, age):
        self.age = age


data = MockData(18)

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

@csv | CSV

@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

git init

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neko233_sugar-0.0.3-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file neko233_sugar-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: neko233_sugar-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for neko233_sugar-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7de07b41ca036befcfd7354c00e08e710d728f59d8482c72771b060ebe85b9f7
MD5 19e4d8f09d9ef839b58d41b33a357e41
BLAKE2b-256 e4e96305a4ea6d772841ac887e46278c384053e2afae9ef4fbe8ca1dcea7702c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page