xiaojing
English | 中文
长度、质量与温度的单位换算。
安装
pip install xiaojing
用法
from xiaojing import convert
convert(1, "km", "m") # 1000.0
convert(1, "mile", "km") # 1.609344
convert(1, "kg", "lb") # 2.204622...
convert(100, "c", "f") # 212.0
说明
长度与质量走「先归一到基准单位再换算」,所以任意两个受支持单位之间都能互转;温度单独处理,因为它不是线性缩放而是带偏移。未知单位抛 KeyError,不做模糊匹配。
许可证
MIT
English
Convert units of length, mass and temperature.
Install
pip install xiaojing
Usage
from xiaojing import convert
convert(1, "km", "m") # 1000.0
convert(1, "mile", "km") # 1.609344
convert(1, "kg", "lb") # 2.204622...
convert(100, "c", "f") # 212.0
Notes
Length and mass convert through a base unit, so any supported pair works. Temperature is handled separately because it carries an offset, not just a scale. An unknown unit raises KeyError rather than being guessed.
License
MIT
Metadata
Release files for xiaojing 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| xiaojing-0.0.3.tar.gz | 3.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| xiaojing-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.4 kB
Release files / xiaojing-0.0.3.tar.gz
| Download URL | xiaojing-0.0.3.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
29247ae73466748fa2ee7a46943d6ff457ae5c936b6a6f5867d8a0044b2e9fdf
|
|
BLAKE2b-256 checksum How to use checksums |
5b9f8288219b7dadacb053fbe046d2bf9f0daaa965931b9fd2b8d273b639303d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.11
|
Release files / xiaojing-0.0.3-py3-none-any.whl
| Download URL | xiaojing-0.0.3-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2c104daa897e0a2016b60e4577fa655fcaa7865b8fb174263e239edf082f0c4a
|
|
BLAKE2b-256 checksum How to use checksums |
f8201870be8447e3b7e9d82a4464d7ee9dc9a12e952eeabf0ac7a6520a9d0941
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.11
|
Security for xiaojing 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.