Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

GeoLocationIp

GeoLocationIp is an advanced IP geolocation tool written in Python. It consults ip-api.com to retrieve geographic information for one or more IPs. It supports querying a single IP, multiple IPs, or batch processing via a text file, and can output results in multiple formats including a text table, JSON, and CSV.

Features

  • No external dependencies: Uses only the Python 3 standard library.
  • Multiple output formats: Table (default), JSON, and CSV.
  • Batch processing: Read multiple IPs from a text file.
  • Validation: Automatically validates IPs (IPv4 and IPv6) before querying.

Requirements

  • Python 3.7 or higher

No external libraries are required.

Usage

You can run the script from the command line. Below are some examples:

1. Look up a single IP

python ip_locator.py 8.8.8.8

2. Look up multiple IPs

python ip_locator.py 1.1.1.1 8.8.8.8

3. Change the output format to JSON

python ip_locator.py 8.8.8.8 --output json

4. Batch processing from a file and output as CSV

Create a text file (e.g., ips.txt) with one IP per line. Then run:

python ip_locator.py --batch ips.txt --output csv > report.csv

Command-Line Arguments

  • ips: One or more IP addresses to look up.
  • -b, --batch <file>: Text file with one IP per line.
  • -o, --output <format>: Output format. Options: table, json, csv. (Default: table)
  • -t, --timeout <seconds>: Request timeout in seconds. (Default: 15)
  • --no-warnings: Suppress warnings (e.g., private IP notices).
  • -h, --help: Show help message and exit.

Limitations

IP geolocation relies on public ISP databases. Precision is usually limited to the city or ISP datacenter level.

About

localiza ubicacion aproximada de ip

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages