IP2Trace


NameIP2Trace JSON
Version 3.2.0 PyPI version JSON
download
home_pagehttps://github.com/ip2location/ip2trace-python
SummaryA Python tool to display geolocation information in the traceroute.
upload_time2023-05-09 08:06:54
maintainer
docs_urlNone
authorIP2Location
requires_python>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
licenseMIT
keywords ip2location geolocation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # IP2Trace Python

IP2Trace Python is a Python tool allowing user to get IP address information such as country, region, city, latitude, longitude, zip code, time zone, ISP, domain name, connection type, area code, weather, mobile network, elevation, usage type, address type, IAB category, district, autonomous system number (ASN) and autonomous system (AS) from traceroute probes IP address.

*Note: This tool requires Python 2.7, or Python 3.5 or later.*

## Installation

You can install this tool by using pip in Windows or Linux. To install this tool in Windows and Linux, just type `pip install IP2Trace` in your console and IP2Trace will be installed in your machine.

*Note: This tool require [IP2Location](https://github.com/chrislim2888/IP2Location-Python) library to work with. If pip did not install the dependency for you, you can manually install it by using `pip install IP2Location`.*

## Usage

```
Usage: ip2tracepy -p [IP ADDRESS/HOSTNAME] -d [IP2LOCATION BIN DATA PATH] [OPTIONS]
   or: ip2tracepy [IP ADDRESS/HOSTNAME] -d [IP2LOCATION BIN DATA PATH] [OPTIONS]

  -p, --ip
  Specify an IP address or hostname.
  The -p/--ip can be omitted if the IP address or hostname is defined in the first parameter.

  -d, --database
  Specify the path of IP2Location BIN database file. You can download the latest free IP2Location BIN database from https://lite.ip2location.com.
  If the database filename is specified but without the path, ip2tracepy will search the database file in /usr/local/share/ip2location/ for Linux or C:\Users\(your_Windows_username)\Documents\ for Windows.

  -t, --ttl
  Set the max number of hops. (Default: 30)

  -o, --output
  Set the desired IP2Location BIN database columns to output with.
  Available columns are: country_code, country_name, region_name, city_name, isp, latitude, longitude, domain, zip_code, time_zone, net_speed, idd_code, area_code, weather_station_code, weather_station_name, mcc, mnc, mobile_brand, elevation, usage_type, address_type, category, district, asn, as_name.
  
  -a, --all
  Print all the column(s) available based on the BIN file used.

  -h, -?, --help
  Display this guide.

  -v, --version
  Print the version of the IP2Location version.
```

#### Example

Traceroute an IP address.

```bash
ip2tracepy 8.8.8.8 -d /usr/local/share/ip2location/DB3.BIN -a
```

Example output:

```bash
IP2Location Geolocation Traceroute (ip2trace) Version 3.2.0
Copyright (c) 2023 IP2Location.com [MIT License]
https://www.ip2location.com/free/traceroute-application

Traceroute to dns.google ( 8.8.8.8 )

 1  37.123.114.1  0.3853ms ["GB","United Kingdom of Great Britain and Northern Ireland","England","London"]
 2  10.10.32.132  0.4084ms ["-","-","-","-"]
 3  10.10.32.17  0.2673ms ["-","-","-","-"]
 4  212.78.92.2  0.5546ms ["GB","United Kingdom of Great Britain and Northern Ireland","England","London"]
 5  98.158.181.98  1.8706ms ["US","United States of America","New York","New York City"]
 6  195.66.236.125  0.5715ms ["GB","United Kingdom of Great Britain and Northern Ireland","England","London"]
 7  108.170.246.129  0.5193ms ["US","United States of America","California","Mountain View"]
 8  108.170.232.97  0.4749ms ["US","United States of America","California","Mountain View"]
 9  8.8.8.8  0.5693ms ["US","United States of America","California","Mountain View"]
```

Traceroute by hostname

```bash
ip2tracepy google.com -d /usr/local/share/ip2location/DB3.BIN -a
```

Example output:

```bash
IP2Location Geolocation Traceroute (ip2trace) Version 3.2.0
Copyright (c) 2023 IP2Location.com [MIT License]
https://www.ip2location.com/free/traceroute-application

Traceroute to dns.google ( 8.8.8.8 )

 1  37.123.114.1  0.3529ms ["GB","United Kingdom of Great Britain and Northern Ireland","England","London"]
 2  10.10.32.131  0.3686ms ["-","-","-","-"]
 3  10.10.32.17  0.2663ms ["-","-","-","-"]
 4  212.78.92.2  19.7358ms ["GB","United Kingdom of Great Britain and Northern Ireland","England","London"]
 5  98.158.181.98  9.2373ms ["US","United States of America","New York","New York City"]
 6  195.66.236.125  0.5388ms ["GB","United Kingdom of Great Britain and Northern Ireland","England","London"]
 7  108.170.246.161  1.6131ms ["US","United States of America","California","Mountain View"]
 8  172.253.65.211  1.2376ms ["US","United States of America","California","Mountain View"]
 9  216.58.213.14  0.5167ms ["US","United States of America","California","Mountain View"]
```



## Download IP2Location Databases

- Download free IP2Location LITE databases at [https://lite.ip2location.com](https://lite.ip2location.com/)
- For more accurate commercial database, please refer to [https://www.ip2location.com](https://www.ip2location.com/)

One you have obtained your download token, you can download the the database using **wget** as below:

```bash
wget "https://www.ip2location.com/download?token={DOWNLOAD_TOKEN}&file={DATABASE_CODE}"
```

## Support

Email: [support@ip2location.com](mailto:support@ip2location.com)
URL: [https://www.ip2location.com](https://www.ip2location.com/)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ip2location/ip2trace-python",
    "name": "IP2Trace",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
    "maintainer_email": "",
    "keywords": "IP2Location Geolocation",
    "author": "IP2Location",
    "author_email": "support@ip2location.com",
    "download_url": "https://files.pythonhosted.org/packages/07/ab/1a803768369c51a3431ca928486d1bf8b72f0ecd2c63bd4549aad702fb1c/IP2Trace-3.2.0.tar.gz",
    "platform": null,
    "description": "# IP2Trace Python\r\n\r\nIP2Trace Python is a Python tool allowing user to get IP address information such as country, region, city, latitude, longitude, zip code, time zone, ISP, domain name, connection type, area code, weather, mobile network, elevation, usage type, address type, IAB category, district, autonomous system number (ASN) and autonomous system (AS) from traceroute probes IP address.\r\n\r\n*Note: This tool requires Python 2.7, or Python 3.5 or later.*\r\n\r\n## Installation\r\n\r\nYou can install this tool by using pip in Windows or Linux. To install this tool in Windows and Linux, just type `pip install IP2Trace` in your console and IP2Trace will be installed in your machine.\r\n\r\n*Note: This tool require [IP2Location](https://github.com/chrislim2888/IP2Location-Python) library to work with. If pip did not install the dependency for you, you can manually install it by using `pip install IP2Location`.*\r\n\r\n## Usage\r\n\r\n```\r\nUsage: ip2tracepy -p [IP ADDRESS/HOSTNAME] -d [IP2LOCATION BIN DATA PATH] [OPTIONS]\r\n   or: ip2tracepy [IP ADDRESS/HOSTNAME] -d [IP2LOCATION BIN DATA PATH] [OPTIONS]\r\n\r\n  -p, --ip\r\n  Specify an IP address or hostname.\r\n  The -p/--ip can be omitted if the IP address or hostname is defined in the first parameter.\r\n\r\n  -d, --database\r\n  Specify the path of IP2Location BIN database file. You can download the latest free IP2Location BIN database from https://lite.ip2location.com.\r\n  If the database filename is specified but without the path, ip2tracepy will search the database file in /usr/local/share/ip2location/ for Linux or C:\\Users\\(your_Windows_username)\\Documents\\ for Windows.\r\n\r\n  -t, --ttl\r\n  Set the max number of hops. (Default: 30)\r\n\r\n  -o, --output\r\n  Set the desired IP2Location BIN database columns to output with.\r\n  Available columns are: country_code, country_name, region_name, city_name, isp, latitude, longitude, domain, zip_code, time_zone, net_speed, idd_code, area_code, weather_station_code, weather_station_name, mcc, mnc, mobile_brand, elevation, usage_type, address_type, category, district, asn, as_name.\r\n  \r\n  -a, --all\r\n  Print all the column(s) available based on the BIN file used.\r\n\r\n  -h, -?, --help\r\n  Display this guide.\r\n\r\n  -v, --version\r\n  Print the version of the IP2Location version.\r\n```\r\n\r\n#### Example\r\n\r\nTraceroute an IP address.\r\n\r\n```bash\r\nip2tracepy 8.8.8.8 -d /usr/local/share/ip2location/DB3.BIN -a\r\n```\r\n\r\nExample output:\r\n\r\n```bash\r\nIP2Location Geolocation Traceroute (ip2trace) Version 3.2.0\r\nCopyright (c) 2023 IP2Location.com [MIT License]\r\nhttps://www.ip2location.com/free/traceroute-application\r\n\r\nTraceroute to dns.google ( 8.8.8.8 )\r\n\r\n 1  37.123.114.1  0.3853ms [\"GB\",\"United Kingdom of Great Britain and Northern Ireland\",\"England\",\"London\"]\r\n 2  10.10.32.132  0.4084ms [\"-\",\"-\",\"-\",\"-\"]\r\n 3  10.10.32.17  0.2673ms [\"-\",\"-\",\"-\",\"-\"]\r\n 4  212.78.92.2  0.5546ms [\"GB\",\"United Kingdom of Great Britain and Northern Ireland\",\"England\",\"London\"]\r\n 5  98.158.181.98  1.8706ms [\"US\",\"United States of America\",\"New York\",\"New York City\"]\r\n 6  195.66.236.125  0.5715ms [\"GB\",\"United Kingdom of Great Britain and Northern Ireland\",\"England\",\"London\"]\r\n 7  108.170.246.129  0.5193ms [\"US\",\"United States of America\",\"California\",\"Mountain View\"]\r\n 8  108.170.232.97  0.4749ms [\"US\",\"United States of America\",\"California\",\"Mountain View\"]\r\n 9  8.8.8.8  0.5693ms [\"US\",\"United States of America\",\"California\",\"Mountain View\"]\r\n```\r\n\r\nTraceroute by hostname\r\n\r\n```bash\r\nip2tracepy google.com -d /usr/local/share/ip2location/DB3.BIN -a\r\n```\r\n\r\nExample output:\r\n\r\n```bash\r\nIP2Location Geolocation Traceroute (ip2trace) Version 3.2.0\r\nCopyright (c) 2023 IP2Location.com [MIT License]\r\nhttps://www.ip2location.com/free/traceroute-application\r\n\r\nTraceroute to dns.google ( 8.8.8.8 )\r\n\r\n 1  37.123.114.1  0.3529ms [\"GB\",\"United Kingdom of Great Britain and Northern Ireland\",\"England\",\"London\"]\r\n 2  10.10.32.131  0.3686ms [\"-\",\"-\",\"-\",\"-\"]\r\n 3  10.10.32.17  0.2663ms [\"-\",\"-\",\"-\",\"-\"]\r\n 4  212.78.92.2  19.7358ms [\"GB\",\"United Kingdom of Great Britain and Northern Ireland\",\"England\",\"London\"]\r\n 5  98.158.181.98  9.2373ms [\"US\",\"United States of America\",\"New York\",\"New York City\"]\r\n 6  195.66.236.125  0.5388ms [\"GB\",\"United Kingdom of Great Britain and Northern Ireland\",\"England\",\"London\"]\r\n 7  108.170.246.161  1.6131ms [\"US\",\"United States of America\",\"California\",\"Mountain View\"]\r\n 8  172.253.65.211  1.2376ms [\"US\",\"United States of America\",\"California\",\"Mountain View\"]\r\n 9  216.58.213.14  0.5167ms [\"US\",\"United States of America\",\"California\",\"Mountain View\"]\r\n```\r\n\r\n\r\n\r\n## Download IP2Location Databases\r\n\r\n- Download free IP2Location LITE databases at [https://lite.ip2location.com](https://lite.ip2location.com/)\r\n- For more accurate commercial database, please refer to [https://www.ip2location.com](https://www.ip2location.com/)\r\n\r\nOne you have obtained your download token, you can download the the database using **wget** as below:\r\n\r\n```bash\r\nwget \"https://www.ip2location.com/download?token={DOWNLOAD_TOKEN}&file={DATABASE_CODE}\"\r\n```\r\n\r\n## Support\r\n\r\nEmail: [support@ip2location.com](mailto:support@ip2location.com)\r\nURL: [https://www.ip2location.com](https://www.ip2location.com/)\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python tool to display geolocation information in the traceroute.",
    "version": "3.2.0",
    "project_urls": {
        "Homepage": "https://github.com/ip2location/ip2trace-python",
        "Official Website": "https://www.ip2location.com"
    },
    "split_keywords": [
        "ip2location",
        "geolocation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d76a484cb7926b60f6ef9771e18aae293bdd25811529e4517c1576e389a05e17",
                "md5": "2092414e2a1161894f55eb1733b1befd",
                "sha256": "934cd2894aac73b5fda0539d0a6678184ddde16c3792ed2135cb085cf0872595"
            },
            "downloads": -1,
            "filename": "IP2Trace-3.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2092414e2a1161894f55eb1733b1befd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
            "size": 1017924,
            "upload_time": "2023-05-09T08:06:50",
            "upload_time_iso_8601": "2023-05-09T08:06:50.591672Z",
            "url": "https://files.pythonhosted.org/packages/d7/6a/484cb7926b60f6ef9771e18aae293bdd25811529e4517c1576e389a05e17/IP2Trace-3.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "07ab1a803768369c51a3431ca928486d1bf8b72f0ecd2c63bd4549aad702fb1c",
                "md5": "5b1ae9baab3562b1a75a67028122c145",
                "sha256": "8efb9c82d057500d5dfbd5c2e0ba3a1f0e44e77a896f7d2c74ec450a602547d3"
            },
            "downloads": -1,
            "filename": "IP2Trace-3.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "5b1ae9baab3562b1a75a67028122c145",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
            "size": 1013071,
            "upload_time": "2023-05-09T08:06:54",
            "upload_time_iso_8601": "2023-05-09T08:06:54.813914Z",
            "url": "https://files.pythonhosted.org/packages/07/ab/1a803768369c51a3431ca928486d1bf8b72f0ecd2c63bd4549aad702fb1c/IP2Trace-3.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-09 08:06:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ip2location",
    "github_project": "ip2trace-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "ip2trace"
}
        
Elapsed time: 0.06328s