Skip to main content

utils for enconia

Project description

enconia-utils

Enconia 工具包,提供常用的 Python 工具函数集合。

安装

pip install enconia-utils

功能模块

ID 生成器 (id_generator)

  • get_random_short_id() - 生成 8 位随机短 ID
  • get_random_long_id() - 生成 22 位随机长 ID
  • get_fix_short_id(base_str) - 根据输入字符串生成固定的短 ID
  • get_fix_long_id(base_str) - 根据输入字符串生成固定的长 ID
  • get_file_md5(filepath) - 计算文件 MD5

日期工具 (util_date)

  • get_orbit_std_datetime() - 获取标准格式的当前日期时间
  • get_orbit_std_date() - 获取标准格式的当前日期
  • get_date_range_list_v2(start, end) - 获取日期范围列表
  • get_next_day(day, interval) - 获取下一天
  • get_next_workday_cn(day) - 获取下一个中国工作日

飞书推送 (feishu_push)

  • FeiShuTalkChatBot - 飞书机器人消息推送

阿里云 SLS 日志 (aliyun_sls_log)

  • send_log_to_sls() - 发送日志到阿里云 SLS

阿里云 OSS (util_oss)

  • OssCloudObjectProvider - OSS 文件操作(上传、下载、复制、删除等)

文件类型映射 (util_type_mapping)

  • get_content_type_4_filename(filename) - 根据文件名获取 MIME 类型
  • file2content_type(ext) - 扩展名转 MIME 类型
  • content2file_type(mime) - MIME 类型转扩展名

依赖

  • requests
  • pytz
  • deprecated
  • oss2
  • aliyun-log-python-sdk
  • chinese_calendar

License

BSD-3-Clause

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

enconia_utils-0.1.2.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

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

enconia_utils-0.1.2-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file enconia_utils-0.1.2.tar.gz.

File metadata

  • Download URL: enconia_utils-0.1.2.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for enconia_utils-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5890af07a79d6f451628ecb80ee2b27b18061274f405569f85d15d0c91784585
MD5 a247a412ad0a8016e67c0e35ad0fae6b
BLAKE2b-256 539c9c86c243170a6f249af8c9cf5e720f89fb69d5c7f6c8a083b4b5d07d5815

See more details on using hashes here.

File details

Details for the file enconia_utils-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: enconia_utils-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for enconia_utils-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 164ef509e46641d067b6306517edc4286f70158fe996e7689e506273daa07ed3
MD5 514c553844130a3a82584439cb82c2ca
BLAKE2b-256 be5c497b1b061cbd3bf3fd3f0794844092e5b2103f139d5a9ca07884d4ea8117

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