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.0.tar.gz (17.6 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.0-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: enconia_utils-0.1.0.tar.gz
  • Upload date:
  • Size: 17.6 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.0.tar.gz
Algorithm Hash digest
SHA256 3bfef80ea0c8dcfea822f050539b5476ef579f3bb9d3e75ff9907e43cbcb36eb
MD5 92f1f7989aeef068f5f58c7645ce3a92
BLAKE2b-256 eda0ac91a4981614878726ce5932f1c8038bd97fc59b9e3c53cb4ec23a6bdfd2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: enconia_utils-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.5 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e07f8a4733e5f6414778bf8c94bf3899c7b1d850a22ed9f8cf7f6c46e47dce94
MD5 e301969aaed0a7d4bd2c3ee0baf2815b
BLAKE2b-256 7164fae32bac4e5e542995a757e6030f1092274b27c74fc170d00e1e44cb7658

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