Skip to main content

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.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 iizysl 0.0.3
File Size Uploaded Provenance Actions
iizysl-0.0.3.tar.gz 3.3 kB Without provenance Details for iizysl-0.0.3.tar.gz

Built distribution (wheel)

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

Total release size: 7.1 kB

Release files / iizysl-0.0.3.tar.gz

Download URL iizysl-0.0.3.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
7cba6e28c145fe716cd09c461a31cd548dee1a501f6b2006531deffb10caf49b
BLAKE2b-256 checksum
How to use checksums
0c0d2b26a66535a6606b7646523ddcb506f288430eeb0a1fcc7d2792c4fc118e
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.3-py3-none-any.whl

Download URL iizysl-0.0.3-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ad5a334c1af44c407f572fb9e69896fcc35160966fb88aa61f2ed84e341ea9b
BLAKE2b-256 checksum
How to use checksums
49391c1bb958bbdc88a980fb586beb349b465c7859d42743a82e10bc05076a9b
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.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.

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