Skip to main content

I have written my own python ip/subnet tool. It's for python2/3. Use theese methods to conver ip mask formats and to check if ip/subnet belong to other subnet. I made it partly for fun and to learn, so perhaps these are not the best, but they get the job done. Checking if ip belongs to subnet is actually about 20-30% faster, than with tools from netaddr module.

Instalation:

pip install iptoolsjj

Import: (I use *, not worrying about namespace because its small script ):

from iptoolsjj import *

Example:

Check if 192.168.10.10 is inside 192.168.10.0/22:

if iptoolsjj.is_in_subnet("192.168.10.10", "192.168.10.0/22"):
		print ("yes")

Convert mask '255.255.255.240' to '28':

print(iptoolsjj.mask255_to_dec("255.255.255.240"))

Convert mask '28' to '['255', '255', '255', '240']' (normally it's list format):

print(iptoolsjj.dec_to_mask255(28))

or

print(".".join(iptoolsjj.dec_to_mask255(28)))

Metadata

Release files for iptoolsjj 1.0.6

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

Source distribution (sdist)

Source distribution for iptoolsjj 1.0.6
File Size Uploaded
iptoolsjj-1.0.6.tar.gz 3.2 kB Details

Release files / iptoolsjj-1.0.6.tar.gz

Download URL iptoolsjj-1.0.6.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d59dc2a54035ebae63a3a7f086c317bc5de423cdd50e83d0a3ca1a7e9e6bba08
BLAKE2b-256 checksum
How to use checksums
f0d43fa4fc35ce88639b9d031527afe9b74a5ea4a84e98d46833fe4d97538e67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.12.4 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.5.3

Release history Release notifications | RSS feed

1.4.2

2 release files

1.4.1

2 release files

1.3.0

1 release file

1.2.6

2 release files

1.2.5

1 release file

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

1 release file

1.2

1 release file

1.1

1 release file

1.0.7

1 release file

This release

1.0.6 This release

1 release file

1.0.5

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

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