lqxnjk
English | 中文
把时间区间按固定步长切成窗口。
安装
pip install lqxnjk
用法
from datetime import datetime
from lqxnjk import split_windows
start = datetime(2026, 1, 1)
end = datetime(2026, 1, 4)
split_windows(start, end)
# [(2026-01-01 00:00, 2026-01-02 00:00), (..., 01-03), (..., 01-04)]
split_windows(start, end, n_hours=12) # 6 个窗口
说明
接受 date 或 datetime,纯日期按当天零点处理。左闭右开:相邻窗口不重叠,末尾不足一个步长的那段保留。起点不早于终点、或步长为 0 时抛 ValueError。
许可证
MIT
English
Split a time range into fixed windows.
Install
pip install lqxnjk
Usage
from datetime import datetime
from lqxnjk import split_windows
start = datetime(2026, 1, 1)
end = datetime(2026, 1, 4)
split_windows(start, end)
# [(2026-01-01 00:00, 2026-01-02 00:00), (..., 01-03), (..., 01-04)]
split_windows(start, end, n_hours=12) # 6 个窗口
Notes
Accepts date or datetime; a bare date means midnight. Windows are half-open, so they never overlap, and a trailing partial window is kept. A start not before the end, or a zero step, raises ValueError.
License
MIT
Metadata
Release files for lqxnjk 0.0.2
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 | Actions |
|---|---|---|---|---|
| lqxnjk-0.0.2.tar.gz | 3.2 kB | Without provenance | Details for lqxnjk-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lqxnjk-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for lqxnjk-0.0.2-py3-none-any.whl |
Total release size: 6.7 kB
Release files / lqxnjk-0.0.2.tar.gz
| Download URL | lqxnjk-0.0.2.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eee1153978afdcddcdf65c8529e5261d910c3eb9f228ddd6d6b31a20fd2e732d
|
|
BLAKE2b-256 checksum How to use checksums |
3e8ac1889064660d8e631ba3aebe4ca8ad8e2e606894d16d93b70018f3cf952e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.11
|
Release files / lqxnjk-0.0.2-py3-none-any.whl
| Download URL | lqxnjk-0.0.2-py3-none-any.whl |
|---|---|
| Size | 3.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ae11c3a5bfe93ad2e7113d9792df67b5045404b9071d30ca855a08ba8bb2681a
|
|
BLAKE2b-256 checksum How to use checksums |
4d19bc00839b813528791703d0d9c8d0894c3d952620c94d6bd2f25211c2005e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.11
|
Security for lqxnjk 0.0.2
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.