iizysl
English | 中文
IPv4 CIDR 计算:网段、掩码、广播地址与归属判断。
安装
pip install iizysl
用法
from iizysl import contains, iter_hosts, network_info
network_info("10.0.0.0/24").as_dict()
# {'network': '10.0.0.0', 'prefix': 24, 'netmask': '255.255.255.0',
# 'broadcast': '10.0.0.255', 'first': '10.0.0.0', 'last': '10.0.0.255',
# 'hosts': 254}
contains("10.0.0.0/24", "10.0.0.7") # True
iter_hosts("10.0.0.0/30") # ['10.0.0.1', '10.0.0.2']
说明
主机位被设置时按 strict=False 归一化;/31 和 /32 不区分网络地址与广播地址,全部算可用;非法输入抛 ValueError,不会退回一个默认网段。
许可证
MIT
English
IPv4 CIDR arithmetic: ranges, membership and host counts.
Install
pip install iizysl
Usage
from iizysl import contains, iter_hosts, network_info
network_info("10.0.0.0/24").as_dict()
# {'network': '10.0.0.0', 'prefix': 24, 'netmask': '255.255.255.0',
# 'broadcast': '10.0.0.255', 'first': '10.0.0.0', 'last': '10.0.0.255',
# 'hosts': 254}
contains("10.0.0.0/24", "10.0.0.7") # True
iter_hosts("10.0.0.0/30") # ['10.0.0.1', '10.0.0.2']
Notes
Host bits are normalised with strict=False. /31 and /32 treat every address as usable. Invalid input raises ValueError rather than falling back to a default network.
License
MIT
Metadata
Release files for iizysl 0.0.4
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 |
|---|---|---|---|---|
| iizysl-0.0.4.tar.gz | 3.3 kB | Without provenance | Details for iizysl-0.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| iizysl-0.0.4-py3-none-any.whl | Python 3 | none | any | Details for iizysl-0.0.4-py3-none-any.whl |
Total release size: 7.1 kB
Release files / iizysl-0.0.4.tar.gz
| Download URL | iizysl-0.0.4.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5b468a19da4d89925e0b2e08a253bc9b1769b135a811a10d30c4fd42bcf44c28
|
|
BLAKE2b-256 checksum How to use checksums |
58f55fc8bcc81c7a3deb2b58b2904aa2c47bab75ee61ad54c19213bc254ab6c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.11
|
Release files / iizysl-0.0.4-py3-none-any.whl
| Download URL | iizysl-0.0.4-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6a63eff1d611446700b121e728343727e02cd01d75ed017a477a050dfdb5529c
|
|
BLAKE2b-256 checksum How to use checksums |
1f047343487577481778ec35b21135acdfce973f639d74fb41db5839c151c797
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.11
|
Security for iizysl 0.0.4
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.