Skip to main content

nest common helper

Project description

常用的辅助方法

Installation

install as pip

pip install nest-helper

Usage

  • 生成 uuid

    参数: fmt 是替换字符串,默认为 -

    >>> from pyhelper.helper import generate_uuid
    >>> print(generate_uuid())
    c294bfab-5249-4c01-8e38-02f7957afdfa
    >>> print(generate_uuid(fmt=''))
    2204d86f2815482c83d697acd0b36c16
    
  • 生成11位的唯一识别码

    >>> from pyhelper.helper import generate_unique_id
    >>> print(generate_unique_id())
    78LM0XLpnpv
    
  • 生成自定义位数的随机字符串

    参数: n是生成字符串的个数,默认为6位

    >>> from pyhelper.helper import generate_rnd_string
    >>> print(generate_rnd_string())
    w9y5Yk
    >>> print(generate_rnd_string(n=10))
    T65rZduWMC
    
  • url 编码

    >>> from pyhelper.helper import urlencode
    >>> url = "https://baidu.com?a=1&b=2"
    >>> print(urlencode(url))
    https%3A//baidu.com%3Fa%3D1%26b%3D2
    
  • url 解码

    >>> from pyhelper.helper import urldecode
    >>> url = "https%3A//baidu.com%3Fa%3D1%26b%3D2"
    >>> print(urldecode(url))
    https://baidu.com?a=1&b=2
    

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

nest-helper-1.0.0.tar.gz (2.4 kB view details)

Uploaded Source

File details

Details for the file nest-helper-1.0.0.tar.gz.

File metadata

  • Download URL: nest-helper-1.0.0.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.9

File hashes

Hashes for nest-helper-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b58f9919168ecdfb1ac29ca566aedc1eda91ab6332b45d73bf358745df5369e0
MD5 2654db1ded055bfc5f64fff1fac5fc97
BLAKE2b-256 88b621cb14b63ce3293dcad87f6101605daf581851d964762dd01b280734c446

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