Skip to main content

Common tools of AI module for BNQ

Project description

python setup.py sdist bdist_wheel
twine upload dist/*

1.NacConnect类,用于连接nacos服务,获取配置文件信息

NacConnect类中参数信息如下:
    server_addresses: 地址
    namespace: 命名空间
    username: 用户名
    password: 密码
    group: 组合字典, 包括group_name和data_ids
    conf_type: 配置文件类型, 非必需,值为json或yaml

示例如下:
    test_data = {
                    'group': {'t-dev': ['project_name_1', 'project_name_2']},
                    'username': 'nacos',
                    'password': 'nacos',
                    'server_addresses': '127.0.0.1:8080',
                    'namespace': 't-dev'
                }
    conf_test = NacConnect(**test_data)
    print(conf_test())

2.LoggingRecord类,用于记录日志信息

LoggingRecord类中参数信息如下:
    max_bytes: 日志文件最大大小, 默认值20M
    backup_count: 日志备份最大数量, 默认值为10
    log_level: 日志级别, 默认值为INFO
    log_dir: 日志文件路径,默认在根目录下创建log文件夹

示例如下:
    testLog = LoggingRecord(log_level=logging.DEBUG)
    for i in range(10):
        print(i, 'i')
        print(testLog, "testLog")
        testLog.debug(i)
        testLog.info("中文测试")
        testLog.error(i)
        testLog.warning(i)
        testLog.exception(i)

3.SingletonMeta类,用于实现单例模式

示例如下:
    class TestClass(metaclass=SingletonMeta):
        def __init__(self):
            pass

4.CosConnect类,用于连接腾讯云存储平台cos

CosConnect类中参数信息如下:
    secret_id: 腾讯云secret_id
    secret_key: 腾讯云secret_key
    region: 腾讯云存储区域

示例如下:
    test_data = {
                    'secret_id': 'AKIDxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
                    'secret_key': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
                    'region': 'ap-guangzhou'
                }
    cos_test = CosConnect(**test_data)
    print(cos_test())

Project details


Download files

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

Source Distribution

common-tools-ai-bnq-0.1.5.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

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

common_tools_ai_bnq-0.1.5-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file common-tools-ai-bnq-0.1.5.tar.gz.

File metadata

  • Download URL: common-tools-ai-bnq-0.1.5.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.8

File hashes

Hashes for common-tools-ai-bnq-0.1.5.tar.gz
Algorithm Hash digest
SHA256 d77074dd8de5825e31dba96c019d82d0355a4097a4eaefc3876cbf40501a755b
MD5 b51e0dd13dc881d6899bed8ba3c616bf
BLAKE2b-256 bcc7f8284fe2411aa7af12ee08467cb21c9d0c0d7a4cc46822e4b606cac4013a

See more details on using hashes here.

File details

Details for the file common_tools_ai_bnq-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for common_tools_ai_bnq-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5be5a2af20f38cab6561c8fce32090419452339f7c38af2db95b01ba571a26be
MD5 2bb8bee8b08235958f9f7b422e8272d0
BLAKE2b-256 8d5749039489c5cdebe9290c6893125a4d30b4a7157886b3345f1ceaaae4db49

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