IPDS - IP Data Service
A comprehensive Python library and CLI tool for IP address analysis, network information retrieval, and geolocation services.
Features
- IP Address Analysis - Basic IP properties, validation, and classification
- Network Information - Subnet masks, CIDR notation, network ranges, and broadcast addresses
- ASN Lookup - Autonomous System Number lookup with organization details
- Geolocation - Country, region, city, ISP, and timezone information
- WHOIS Data - IP and domain WHOIS information
- Batch Processing - Analyze multiple IP addresses simultaneously
- Multiple Output Formats - JSON, YAML, and CSV export options
- Network Scanning - Scan network ranges and analyze security
Installation
pip install ipds
Quick Start
Command Line Interface
# Basic IP lookup
ipds 8.8.8.8
# Network information only
ipds 8.8.8.8 --network-only
# ASN information only
ipds 8.8.8.8 --asn-only
# Geolocation only
ipds 8.8.8.8 --geo-only
# Batch processing from file
ipds --file ip_list.txt
# Save results to file
ipds 8.8.8.8 --output results.json
Python API
from ipds import IPInfo
# Create IPInfo object
ip_info = IPInfo("8.8.8.8")
# Get all information
all_info = ip_info.get_all_info()
print(all_info)
# Get specific information
basic_info = ip_info.get_basic_info()
network_info = ip_info.get_network_info()
asn_info = ip_info.get_asn_info()
geo_info = ip_info.get_geolocation_info()
whois_info = ip_info.get_whois_info()
Examples
Basic IP Analysis
from ipds import IPInfo
ip_info = IPInfo("192.168.1.1")
# Basic properties
basic = ip_info.get_basic_info()
print(f"IP Version: IPv{basic['version']}")
print(f"Private IP: {basic['is_private']}")
print(f"Global IP: {basic['is_global']}")
# Network information
network = ip_info.get_network_info()
print(f"Network Range: {network['network_range']}")
print(f"Subnet Mask: {network['subnet_mask']}")
print(f"Broadcast: {network['broadcast_address']}")
Public IP Analysis
from ipds import IPInfo
ip_info = IPInfo("8.8.8.8")
# Get ASN information
asn_info = ip_info.get_asn_info()
print(f"ASN: {asn_info['asn']}")
print(f"Organization: {asn_info['asn_name']}")
# Get geolocation
geo_info = ip_info.get_geolocation_info()
print(f"Country: {geo_info['country']}")
print(f"City: {geo_info['city']}")
print(f"ISP: {geo_info['isp']}")
Batch Processing
from ipds import IPInfo
ip_addresses = ["8.8.8.8", "1.1.1.1", "192.168.1.1"]
results = []
for ip in ip_addresses:
ip_info = IPInfo(ip)
result = {
"ip_address": ip,
"basic_info": ip_info.get_basic_info(),
"network_info": ip_info.get_network_info()
}
results.append(result)
print(f"Processed {len(results)} IP addresses")
CLI Options
ipds [IP_ADDRESS] [OPTIONS]
Options:
--file FILE Process IPs from file
--output FILE Save results to file
--format FORMAT Output format (json, yaml, csv)
--basic-only Show only basic IP information
--network-only Show only network information
--asn-only Show only ASN information
--geo-only Show only geolocation information
--whois-only Show only WHOIS information
--geo-service SERVICE Geolocation service (ipapi, ipinfo)
--asn-service SERVICE ASN service (ipapi, ipinfo, hackertarget)
--verbose Verbose output
--quiet Quiet output
--help Show help message
Output Formats
JSON (Default)
{
"ip_address": "8.8.8.8",
"basic_info": {
"version": 4,
"is_private": false,
"is_global": true,
"is_multicast": false,
"is_loopback": false,
"is_link_local": false,
"is_reserved": false
},
"network_info": {
"network_address": "8.8.8.0",
"subnet_mask": "255.255.255.0",
"subnet_mask_cidr": "/24",
"broadcast_address": "8.8.8.255",
"total_addresses": 256,
"usable_addresses": 254,
"network_range": "8.8.8.0/24"
},
"asn_info": {
"asn": "AS15169",
"asn_name": "Google LLC",
"isp": "Google LLC"
},
"geolocation": {
"country": "United States",
"country_code": "US",
"region": "VA",
"city": "Ashburn",
"lat": 39.03,
"lon": -77.5,
"timezone": "America/New_York",
"isp": "Google LLC"
}
}
Network Analysis
IPDS provides detailed network analysis including:
- Subnet Mask Calculation - Automatic subnet mask detection
- CIDR Notation - Network range in CIDR format
- Broadcast Address - Network broadcast address
- Address Count - Total and usable address counts
- ASN Network Ranges - For public IPs, finds the specific network range
Private IP Networks
For private IPs, IPDS automatically detects the network class and provides:
- Class A (10.0.0.0/8)
- Class B (172.16.0.0/12)
- Class C (192.168.0.0/16)
Public IP Networks
For public IPs, IPDS:
- Looks up the ASN (Autonomous System Number)
- Retrieves all network prefixes announced by that ASN
- Finds the specific network range containing the IP
- Provides detailed subnet information
Services Integration
IPDS integrates with multiple external services:
- IP-API - Primary geolocation and ASN service
- IPInfo - Alternative geolocation service
- HackerTarget - ASN lookup service
- RIPE Stat - ASN network prefix data
- BGPView - BGP routing information
Error Handling
IPDS includes comprehensive error handling:
- Invalid IP address validation
- Network connectivity issues
- API service failures
- Graceful degradation when services are unavailable
Requirements
- Python 3.7+
- Internet connection for external API calls
- Required packages: requests, ipaddress
Examples Directory
The package includes example scripts in the examples/ directory:
basic_ip_lookup.sh- Basic IP lookup examplesnetwork_analysis.sh- Network analysis examplesbatch_processing.sh- Batch processing examplesadvanced_usage.sh- Advanced usage examplespython_api_example.py- Python API examplesnetwork_scanner.py- Network scanning examples
License
MIT License
Support
For issues and questions, please open an issue on the GitHub repository.
Metadata
Release files for ipds 1.0.1
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 |
|---|---|---|---|---|
| ipds-1.0.1.tar.gz | 20.8 kB | Without provenance | Details for ipds-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ipds-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for ipds-1.0.1-py3-none-any.whl |
Total release size: 44.0 kB
Release files / ipds-1.0.1.tar.gz
| Download URL | ipds-1.0.1.tar.gz |
|---|---|
| Size | 20.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3a1c91ef60bbfa89c059a719958e9d45e0dd35a4a14238a7a98fe08256c6052b
|
|
BLAKE2b-256 checksum How to use checksums |
6eaf9b65d168d9027943b493a0f02fd227143fcc63c6d8d4bd44a5799cc4b0e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.11
|
Release files / ipds-1.0.1-py3-none-any.whl
| Download URL | ipds-1.0.1-py3-none-any.whl |
|---|---|
| Size | 23.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4fc373fb931b85faa7b1c608b6f761d8c0d5649b0382a3f9f2dc7a35d13e2519
|
|
BLAKE2b-256 checksum How to use checksums |
23d04f83c063bfb9ea88ad71f2b2c079e61b6993e7ff172b65f664ddabf41996
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.11
|
Security for ipds 1.0.1
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.