Skip to main content

Test PyPI PyPI - Python Version License: MIT Stars

fipv

fipv (fast ip validator) is a python package build with C language. Simply it includes basic IP address validator functions as a C function, so works faster than others. Following C functions avaliable on this package:

  • ipv4
  • ipv4_cidr
  • ipv6
  • ipv6_cidr

Can be used on bulk IP data. You can find detailed test benchmark at below.

Installation

fipv can be installed easly with pip3. It requires Python 3.7+

$ pip3 install fipv

Usage

#!/usr/bin/python3

import fipv

# Basic C validation functions
print(
    fipv.ipv4('127.0.0.1'),  # True
    fipv.ipv4_cidr('127.0.0.1/44'),  # False
    fipv.ipv6('::1'),  # True
    fipv.ipv6_cidr('::1/129'),  # False
)

# Validate bulk IPv4 data
ips = ['127.0.0.1'] * 1000000
valids = [ip for ip in ips if fipv.ipv4(ip)]
print(len(valids))  # 1000000

Test Benchmark

In this test, it was tested validation speed and average RAM usage with different python validators and different data types. Finally results saved to below table.

Test Duration: Used linux time command for determine execution time of script.
Avr. RAM Usage: Used linux ps command every 0.1 second and calculated RAM average.

:green_circle: Valid :red_circle: Invalid

Test ID Test Data Count Total Data Data Type Project Validation Duration Avr. RAM Usage (MB)
1 :green_circle: 500K 1M IPv4 validators 0m12,975s 85M
:red_circle: 500K ipaddress 0m2,007s 80M
N/A N/A fipv 0m0,635s 76M
2 :green_circle: 1M 2M IPv4 validators 0m25,682s 151M
:red_circle: 1M ipaddress 0m3,937s 154M
N/A N/A fipv 0m1,193s 150M
3 :green_circle: 500K 1M IPv4 CIDR validators 0m19,721s 96M
:red_circle: 500K ipaddress 0m8,662s 89M
N/A N/A fipv 0m0,909s 77M
4 :green_circle: 1M 2M IPv4 CIDR validators 0m39,457s 179M
:red_circle: 1M ipaddress 0m17,029s 174M
N/A N/A fipv 0m1,779s 174M
5 :green_circle: 500K 1M IPv6 validators 0m12,633s 96M
:red_circle: 500K ipaddress 0m2,802s 92M
N/A N/A fipv 0m0,684s 87M
6 :green_circle: 1M 2M IPv6 validators 0m26,449s 183M
:red_circle: 1M ipaddress 0m5,605s 177M
N/A N/A fipv 0m1,308s 172M
7 :green_circle: 500K 1M IPv6 CIDR validators 0m20,936s 99M
:red_circle: 500K ipaddress 0m10,778s 95M
N/A N/A fipv 0m0,958s 93M
8 :green_circle: 1M 2M IPv6 CIDR validators 0m51,382s 184M
:red_circle: 1M ipaddress 0m25,563s 184M
N/A N/A fipv 0m1,862s 168M

Contact

Blog - erdoganyoksul.com
Mail - erdoganyoksul3@gmail.com

Metadata

Release files for fipv 0.1.2

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

Source distribution (sdist)

Source distribution for fipv 0.1.2
File Size Uploaded
fipv-0.1.2.tar.gz 8.1 kB Details

Release files / fipv-0.1.2.tar.gz

Download URL fipv-0.1.2.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4002b70ea5eff348414803f56ccecb5b06ad8b4a7632a7f7e8e274088b6bf6fe
BLAKE2b-256 checksum
How to use checksums
f37978d0b5fd7c7a063248e647ccb86047063937fce592d5f9d58ba826250890
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release history Release notifications | RSS feed

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

This release

0.1.2 This release

1 release file

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