Skip to main content

极态后端工具包

Project description

JIT Utils Backend

极态后端工具包 - 一个为后端开发提供便利工具的 Python 包。

安装

pip install jit_utils_backend

使用方法

导入包

# 导入整个包
import jit_utils

# 导入特定功能(从具体的子模块)
from jit_utils.time import now
from jit_utils.string import randomString
from jit_utils.qrcode import Qrcode
from jit_utils.barcode import Barcode

# 导入特定模块
import jit_utils.time
import jit_utils.string

主要功能

1. 时间处理工具

from jit_utils.time import now, today, dayShift, formatNow

# 获取当前时间
current_time = now()

# 获取今天的日期
today_date = today()

# 日期偏移
tomorrow = dayShift(today_date, 1)

# 格式化当前时间
formatted_time = formatNow("%Y-%m-%d %H:%M:%S")

2. 字符串处理工具

from jit_utils.string import randomString, md5Str, getUuidStr

# 生成随机字符串
random_str = randomString(8)

# MD5 加密
encrypted = md5Str("hello world")

# 生成 UUID
uuid_str = getUuidStr()

3. 二维码生成

from jit_utils.qrcode import Qrcode

# 创建二维码
qr = Qrcode("https://example.com")

# 获取二维码图片的字节数据
qr_bytes = qr.toByte()

# 获取二维码的 base64 字符串
qr_str = qr.toStr()

4. 条形码生成

from jit_utils.barcode import Barcode

# 创建条形码
barcode = Barcode("123456789")

# 获取条形码图片的字节数据
barcode_bytes = barcode.toByte()

# 获取条形码的 base64 字符串
barcode_str = barcode.toStr()

5. 数据验证

from jit_utils.validator import ParamsValidator
from dataclasses import dataclass

@dataclass
class UserParams(ParamsValidator):
    name: str
    age: int
    email: str = ""

# 验证参数
params = UserParams("test_function", name="John", age=25)

6. 装饰器

from jit_utils.decorator import forward

@forward("module.submodule")
def my_function():
    pass

模块说明

  • time_utils: 时间处理相关工具
  • string_utils: 字符串处理相关工具
  • qrcode: 二维码生成工具
  • barcode: 条形码生成工具
  • validator: 数据验证工具
  • network: 网络相关工具
  • signature: 签名相关工具
  • matchTool: 匹配工具
  • clsTool: 类工具
  • exceptions: 异常处理
  • workday_constants: 工作日常量
  • config: 配置相关工具

依赖包

  • requests
  • qrcode
  • python-barcode
  • Pillow
  • arrow
  • python-dateutil

许可证

MIT License

作者

JitAi (develop@wanyunapp.com)

版本

0.0.3

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

jit_utils_backend-0.0.4.tar.gz (23.7 kB view details)

Uploaded Source

Built Distribution

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

jit_utils_backend-0.0.4-py3-none-any.whl (28.8 kB view details)

Uploaded Python 3

File details

Details for the file jit_utils_backend-0.0.4.tar.gz.

File metadata

  • Download URL: jit_utils_backend-0.0.4.tar.gz
  • Upload date:
  • Size: 23.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/40.6.2 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.16

File hashes

Hashes for jit_utils_backend-0.0.4.tar.gz
Algorithm Hash digest
SHA256 8bab9b96b2af5d22bf630d52adaeb5be7f6af4adbf9839f3a2a44a7f43bc87ea
MD5 57f2c906dd05e4e175786234311f133b
BLAKE2b-256 eb44fae292c87387dba726dce7af84f010f291e4770a46d8d5eeae2322bd7431

See more details on using hashes here.

File details

Details for the file jit_utils_backend-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: jit_utils_backend-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 28.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/40.6.2 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.16

File hashes

Hashes for jit_utils_backend-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5aa55ce23d257beaa464d5ba954185c5ec35d116cffef74de937858e1d22e4ac
MD5 fea0c839beeb55ee6bdeb31beece68ab
BLAKE2b-256 12adc8cd0a369f3e7768a40776265dd3e2a528d31d2274f6e6cc5ed3b4c47edb

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