Skip to main content

处理计时数据的一个函数

Project description

sanitize-jhlong

项目简介

sanitize-jhlong 是一个用于处理时间数据的 Python 函数库,能够将时间字符串格式化为标准的 分钟.秒钟 格式。该库的设计目标是帮助开发者更方便地处理和格式化时间数据。

安装方法

您可以通过以下命令从 PyPI 安装该库:

pip install sanitize-jhlong

使用方法

导入库并调用sanitize 函数:

from sanitize_jhlong import sanitize

# 示例
time_string = "2:34"
formatted_time = sanitize(time_string)
print(formatted_time)  # 输出 "2.34"

功能说明

*时间格式转换:支持分钟:秒钟分钟-秒钟格式的转换 *错误处理:当输入数据不符合标准格式时,会自动返回原始字符串,确保代码运行的稳定性。 *(在 Markdown 中,您可以通过在子项前增加四个空格来创建嵌套列表:)

示例代码

以下是一些使用示例:

from sanitize_jhlong import sanitize

# 支持的时间格式
print(sanitize("2:45"))  # 输出 "2.45"
print(sanitize("3-21"))  # 输出 "3.21"

# 不支持的格式将返回原始字符串
print(sanitize("hello"))  # 输出 "hello"

贡献指南

如果您有兴趣为 sanitize-jhlong项目做出贡献,欢迎提交 pull request 或 issue! 我们乐意接受任何有助于改进项目的反馈和建议。

联系方式

如果您在使用过程中遇到问题,请联系作者:jhlong2024@163.com

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

sanitize_jhlong-1.0.3.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

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

sanitize_jhlong-1.0.3-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

Details for the file sanitize_jhlong-1.0.3.tar.gz.

File metadata

  • Download URL: sanitize_jhlong-1.0.3.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for sanitize_jhlong-1.0.3.tar.gz
Algorithm Hash digest
SHA256 a6b52c0ac8094cd7b65f1728cc3a70b023633b4c29f409e1556d8f45de006af4
MD5 be11ee84668ac926f38342bfa3e439b4
BLAKE2b-256 b7bb571a18423ee5714680ae71b0c980e5d53eec3372727ac75f38258dc1d001

See more details on using hashes here.

File details

Details for the file sanitize_jhlong-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for sanitize_jhlong-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a2af0fae5cf8cef94d016f72df79807c609eb1195c4421c52dd6f91255e52d68
MD5 606a83d08b792ebab7feb6efb8c05522
BLAKE2b-256 81b79a7a2eaec12696e87f39712d527d171cb68b7a403ef52a3402ed99766496

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