Skip to main content

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.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lqxnjk 0.0.3
File Size Uploaded Provenance Actions
lqxnjk-0.0.3.tar.gz 3.2 kB Without provenance Details for lqxnjk-0.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lqxnjk 0.0.3
File Interpreter ABI Platform Actions
lqxnjk-0.0.3-py3-none-any.whl Python 3 none any Details for lqxnjk-0.0.3-py3-none-any.whl

Total release size: 6.8 kB

Release files / lqxnjk-0.0.3.tar.gz

Download URL lqxnjk-0.0.3.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b16204bf2a7dd6e6618ee79dde83962d02b974d176c9bc3e6f00bc9b70c34a58
BLAKE2b-256 checksum
How to use checksums
681d6038e03f19d2d4a528a4cf226c66c4062860dbd82a99538d5e6258c53f59
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.3-py3-none-any.whl

Download URL lqxnjk-0.0.3-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff04088b7a27b9b9914ed5c3d429f0f8b45688d77306541e43f10e959f37cd40
BLAKE2b-256 checksum
How to use checksums
bd8efa869438389e3f0af2e4e33b2272be98de2ecccc6232617a1cb39f4570cb
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.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.

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page