Skip to main content

those common functions of package for inner corporation

Project description

天智信达的库

用法

  1. 此库作为git项目管理,凡是修改完后应及时通知到开发团队
  2. 需要使用库中的方法,需要将项目下载的本地,然后进入到项目中执行 python setup.py install,这时候就可以在项目中引用库中的方法
  3. 引用的方法举例:

install

  • pip install wisdoms

find the latest package of wisdoms

  • pip list --outdated

upgrade

  • pip install wisdoms --upgrade

generation

Make sure you installed setuptools and wheel.

Important: You must modify the version of the package in setup.py and delete folders (build, dist, egg-info)

  • python setup.py sdist bdist_wheel

upload

Install twine before doing this

  • twine upload dist/*

packet usage:

auth.py:

    from wisdoms.auth import permit

    host ={'AMQP_URI': "amqp://guest:guest@localhost"}

    auth = permit(host)

    class A:
        @auth
        def func():
            pass

config.py

    from wisdoms.config import c

    # gains item of YML config
    print(c.get('name'))

    # transforms class into dict
    d = c.to_dict()
    print(d['name'])

commons package

    from wisdoms.commons import revert, codes, success

    def func():
        # do something

        # revert(codes.code) or revert(number)
        # return revert(1)
        return revert(codes.ERROR)

    def foo():
        # return revert(code, data, desc)
        return revert(codes.SUCCESS, {'data':'data'},'返回成功描述信息')

    def done():
        # simplified revert where success execute
        # return success(data) or success()
        return success()

如何设计包

  • 顶级包:wisdom,代表天智,智慧
  • 现阶段的约定:采用一级包的方式
  • 不同的功能放在不同的文件(模块)即可做好方法的分类

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

wisdoms-0.0.11.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

wisdoms-0.0.11-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file wisdoms-0.0.11.tar.gz.

File metadata

  • Download URL: wisdoms-0.0.11.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6

File hashes

Hashes for wisdoms-0.0.11.tar.gz
Algorithm Hash digest
SHA256 63edb45054ac1544aa0afd9cebe0b36797021dfb59a923697ce9b676e14f3825
MD5 82ade35496174c2810fe016f19c0c4e4
BLAKE2b-256 d509e3854994163b8a6f06d7dfdd1ffaa78feacb6b7b472bf1c4037f8c7579ad

See more details on using hashes here.

File details

Details for the file wisdoms-0.0.11-py3-none-any.whl.

File metadata

  • Download URL: wisdoms-0.0.11-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6

File hashes

Hashes for wisdoms-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 10852c80ceedae8777a7ccb7c5373310e379d3974f46c95f975bdef7f740fb70
MD5 15ba26e689d51b20b5221e556a535abf
BLAKE2b-256 38e04052cff201a5609e879a0b2d07a1c43a69b753a0863147a4c7113c92d012

See more details on using hashes here.

Supported by

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